[Resolved] Subsonic Requires Pulse Audio for Jukebox?

Need help? Post your questions here.

Moderator: moderators

[Resolved] Subsonic Requires Pulse Audio for Jukebox?

Postby asayler » Sat Dec 17, 2011 6:36 am

Hello,

I'm trying to get the Jukebox mode to work using Subsonic 4.6 on Ubuntu 11.04 Server. This is a headless server, and as such, I have only ALSA, not Pulse installed. When I start Subsonic with a Jukebox player setup, I get the following error in the log:

Code: Select all
[2011-12-16 23:28:31,824] ERROR JukeboxService - Error in jukebox: javax.sound.sampled.LineUnavailableException
javax.sound.sampled.LineUnavailableException
        at org.classpath.icedtea.pulseaudio.PulseAudioMixer.openImpl(PulseAudioMixer.java:714)
        at org.classpath.icedtea.pulseaudio.PulseAudioMixer.openLocal(PulseAudioMixer.java:588)
        at org.classpath.icedtea.pulseaudio.PulseAudioMixer.openLocal(PulseAudioMixer.java:584)
        at org.classpath.icedtea.pulseaudio.PulseAudioMixer.open(PulseAudioMixer.java:579)
        at org.classpath.icedtea.pulseaudio.PulseAudioDataLine.open(PulseAudioDataLine.java:94)
        at org.classpath.icedtea.pulseaudio.PulseAudioSourceDataLine.open(PulseAudioSourceDataLine.java:75)
        at org.classpath.icedtea.pulseaudio.PulseAudioSourceDataLine.open(PulseAudioSourceDataLine.java:90)
...


It follows that I get no audio when I play to the Jukebox player in Subsonic.

The server plays sound fine outside of Subsonic when I do something like this:
Code: Select all
aplay test.wav

So I know the sound system is working.

When I run the java test script (here: http://sourceforge.net/apps/mediawiki/subsonic/index.php?title=Players#Jukebox), I get the following output:

Code: Select all
Available mixers:
PulseAudio Mixer
USBDAC [default]
USBDAC [plughw:0,0]
Port USBDAC [hw:0]


Thoughts?

-Andy
Last edited by asayler on Wed Dec 21, 2011 9:52 pm, edited 1 time in total.
asayler
 
Posts: 29
Joined: Sat Nov 12, 2011 11:12 pm

Re: Subsonic Requires Pulse Audio for Jukebox?

Postby asayler » Wed Dec 21, 2011 9:51 pm

I think I found the issue:

Under the default Ubuntu java install (openJDK), the default soundcard is a Pulse virtual soundcard, regardless of whether or not PulseAudio is setup locally. Since Subsonic defaults to using the default java card, this causes the issue.

I resolved the issue by installing Oracle Java 7, which defaults to the correct real soundcard as its main sound card. Jukebox seems to work fine using Oracle Java 7. Info on obtaining Oracle Java 7 and switching a Ubuntu system to using it can be found here: https://help.ubuntu.com/community/Java.

Here is an update of the java soundcard listing under Oracle Java 7:
Code: Select all
Available mixers:
USBDAC [default]
USBDAC [plughw:0,0]
Port USBDAC [hw:0]


I did not try, but I imagine the issue could also be solved by sticking with openJDK and switching the soundcard that Subsonic uses via the steps found here: viewtopic.php?f=2&t=2038.

As others have mentioned, adding a sound card selection option in the GUI (or better yet, multiple jukebox players where it is a per-player setting) would also make this less of an issue.
asayler
 
Posts: 29
Joined: Sat Nov 12, 2011 11:12 pm

Re: [Resolved] Subsonic Requires Pulse Audio for Jukebox?

Postby feisar » Tue Dec 27, 2011 10:57 am

Hi, I'm running Subsonic 4.6 on Ubuntu Server 11.10 and I'm having the same issue - no sound when using as a jukebox (which was one of the main reasons for wanting the software). I do have Pulse Audio installed and would like to stick with open-jre (rather than Oracle's version) as it is the recommend version to use with Ubuntu.

Trouble is, after I have installed 'openjdk-6-jdk' and compiled and run the java script here, http://forum.subsonic.org/forum/viewtopic.php?f=2&t=2038 my list of Java audio devices are:

Available mixers:
PulseAudio Mixer

So even if I could tell Subsonic to use a different device it would appear there are no others! I know sound can work as audio works fine when I'm logged in to the server and use Banshee or aplay etc.

Anyone have any ideas?
Thanks
feisar
 
Posts: 4
Joined: Tue Dec 27, 2011 10:08 am

Re: [Resolved] Subsonic Requires Pulse Audio for Jukebox?

Postby asayler » Tue Dec 27, 2011 6:35 pm

If you have PulseAudio installed and working, then isn't the PulseAudio mixer output what you want?

Also, generally PulseAudio use is discouraged on Ubuntu Server since it does not play so nice without an XServer running and a user logged in. If you are trying to make this work, you probably need to run Pulse in System-Wide mode: http://www.pulseaudio.org/wiki/SystemWideInstance (generally discouraged for security reasons). In normal mode, PulseAudio will only worked when you are logged in, which may also be what's breaking the Jukebox.

I'd spend some time making sure you have Pulse workign correctly, even when no user is logged in. Aplay isn't the best way to test this since it bypasses the PulseAudio system and plays to ALSA directly. Alternatively, try removing PulseAudio and just using pure ALSA.

Good luck,
Andy
asayler
 
Posts: 29
Joined: Sat Nov 12, 2011 11:12 pm

Re: [Resolved] Subsonic Requires Pulse Audio for Jukebox?

Postby feisar » Mon Jan 02, 2012 9:16 am

Thanks for the reply,

I guess me calling the machine a 'server' is a little misleading as it has a full desktop installed and people login and use it as a desktop too (it's used in the living room for DVDs, streaming etc.). Because of this, Pulse Audio needs to be installed. And you're right, the PulseAudio mixer output should be the one I want. The trouble is that then Subsonic doesn't output anything, whether a user is logged in or not.

The other problem of course is that even if I was to remove Pulse Audio, I'm assuming, OpenJDK would still only show the PulseAudio mixer as an output option.

The good news is that using this guide to install Oracle's Java 7 on Ubuntu means that Subsonic outputs fine in Jukebox mode. The down side to this is that other Java plugins etc. on the system need to be changed to use Oracle's Java 7 too.

I suppose getting OpenJDK working nicely with Pulse Audio is the issue here and that's a little off topic in this forum. Thanks again for your help I will look into running Pulse Audio in system wide mode.
feisar
 
Posts: 4
Joined: Tue Dec 27, 2011 10:08 am

Re: [Resolved] Subsonic Requires Pulse Audio for Jukebox?

Postby mbro » Fri Mar 30, 2012 10:05 pm

I also encountered this issue where a PC running Ubuntu is my "jukebox" and also my subsonic server (it resides in my living room, audio output is piped into the stereo that powers speakers in various locations in the house). I had to compile and run the java code to spit out a listing of audio mixers available for use. See my blog here:

http://mygeekyhomeprojects.blogspot.ca/

I'm not sure if this problem exists on other unix/linux platforms, but a welcome addition would be a spot in the setup menu where you could pick the list of available mixers that subsonic detects (that snippet of java code could provide subsonic with the list). I had to insert a big line of code that I found by perusing the forums and eventually land on the configuration outlined on my blog. I'm very happy with subsonic, and its certainly meeting my needs for music library playback, etc, however this addition might make a slightly less technically inclined user be a little more successful with getting juke box mode running.

Great job Sindre - keep up the exceptional work! I'm definitely donating!
mbro
 
Posts: 23
Joined: Fri Mar 30, 2012 9:59 pm

Re: [Resolved] Subsonic Requires Pulse Audio for Jukebox?

Postby WACOMalt » Fri Oct 12, 2012 3:57 am

Figured Id help out a little. I left a comment on your blog mbro with some added details for people who may not know how to "compile this code" lol :P

http://mygeekyhomeprojects.blogspot.com ... uches.html

Thats a link directly to your post, and with my comment.

Thank fully I was able to get it working perfectly with your help, so THANKS!
WACOMalt
 
Posts: 22
Joined: Fri Oct 12, 2012 3:55 am


Return to Help

Who is online

Users browsing this forum: No registered users and 6 guests