Skip to content

Instantly share code, notes, and snippets.

@nsonnad
Created November 11, 2015 03:01
Show Gist options
  • Save nsonnad/8ab51ecf840ed310c449 to your computer and use it in GitHub Desktop.
Save nsonnad/8ab51ecf840ed310c449 to your computer and use it in GitHub Desktop.
How to setup subsonic on ubuntu with a DAC

What I had to do to get Subsonic working on Ubuntu with a USB DAC:

  1. Download subsonic .deb package and install with sudo dpkg -i subsonic-x-x.deb, as per instructions.

  2. Set up users w/ jukebox mode

  3. For some reason the jukebox doesn't work with openjdk java, but this post suggests using the "sun" version, which is now the oracle version. This works.

Now audio plays out of the computer but not through DAC. You have to get the Java name for the DAC audio device and tell subsonic to use that. To do:

(Instrux here)

Create this java script:

import java.io.*;
import javax.sound.sampled.*;

public class audioDevList{
public static void main(String args[]){

//Get and display a list of
// available mixers.

Mixer.Info[] mixerInfo =
AudioSystem.getMixerInfo();
System.out.println("Available mixers:");
for(int cnt = 0; cnt < mixerInfo.length;
cnt++){
System.out.println(mixerInfo[cnt].
getName());
}//end for loop
}
}

run:

javac audioDevList.java
java audioDevList

will get some output like:

Available mixers:
NVidia [plughw:0,3]
NVidia [plughw:0,7]
NVidia [plughw:0,8]
NVidia [plughw:0,9]
Intel [plughw:1,0]
CX8801 [plughw:2,0]
Port NVidia [hw:0]
Port Intel [hw:1]
Port CX8801 [hw:2]

Add this line to /usr/bin/subsonic:

'-Djavax.sound.sampled.SourceDataLine=#NVidia [plughw:0,7]' \

Finally sudo service subsonic restart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment