XBMCbuntu and Subsonic jukebox

Need help? Post your questions here.

Moderator: moderators

XBMCbuntu and Subsonic jukebox

Postby Avathar » Sat Mar 24, 2012 6:36 pm

Hi folks!

I'm running subsonic 4.6 on a XBMCbuntu RC2 install.
In general it works, playing music and videos over the web and on android works fine. But playing music locally doesn't work. I've tried this guide: http://sourceforge.net/apps/mediawiki/su...rs#Jukebox , but i only get
Code: Select all
Available mixers:
PulseAudio Mixer


as available mixers. Well, i use an Nvidia GPU and HDMI as audio output, and in XBMC all works fine, but with subsonic i doesn't get any output.
I had also troubles with my previous install (ubuntu server 11.10 with xbmc dharma), where xbmc seemed to lock the audio device, so no other process could use it. It worked only if i stopped xbmc.

in the subsonic.log i get the following, but i don't know if it's an error or just debug output:
Code: Select all
[2012-03-24 19:27:00,847] DEBUG TranscodeInputStream - Starting transcoder: [/var/subsonic/transcode/ffmpeg] [-ss] [0] [-i] [/Daten/Musik/Rock/The Dandy Warhols/2003 - Welcome To The Monkey House/The Dandy Warhols - 1.02 - We Used To Be Friends.mp3] [-v] [0] [-f] [au] [-]
[2012-03-24 19:27:00,889] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg) ffmpeg version N-31780-gd5d74cf, Copyright (c) 2000-2011 the FFmpeg developers
[2012-03-24 19:27:00,889] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)   built on Aug  9 2011 14:18:27 with gcc 4.5.2
[2012-03-24 19:27:00,889] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)   configuration: --disable-ffplay --disable-ffprobe --disable-ffserver --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libvpx --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvpx --enable-version3 --enable-bzlib --enable-static --disable-shared --extra-libs=-static --extra-cflags=--static
[2012-03-24 19:27:00,889] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)   libavutil    51. 11. 1 / 51. 11. 1
[2012-03-24 19:27:00,889] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)   libavcodec   53.  9. 1 / 53.  9. 1
[2012-03-24 19:27:00,889] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)   libavformat  53.  6. 0 / 53.  6. 0
[2012-03-24 19:27:00,889] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)   libavdevice  53.  2. 0 / 53.  2. 0
[2012-03-24 19:27:00,890] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)   libavfilter   2. 28. 1 /  2. 28. 1
[2012-03-24 19:27:00,890] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)   libswscale    2.  0. 0 /  2.  0. 0
[2012-03-24 19:27:00,890] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)   libpostproc  51.  2. 0 / 51.  2. 0
[2012-03-24 19:27:00,913] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg) [mp3 @ 0x9406b20] max_analyze_duration 5000000 reached at 5015510
[2012-03-24 19:27:00,913] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg) Input #0, mp3, from '/Daten/Musik/Rock/The Dandy Warhols/2003 - Welcome To The Monkey House/The Dandy Warhols - 1.02 - We Used To Be Friends.mp3':
[2012-03-24 19:27:00,913] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)   Metadata:
[2012-03-24 19:27:00,913] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)     date            : 2003
[2012-03-24 19:27:00,913] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)     track           : 2/13
[2012-03-24 19:27:00,913] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)     disc            : 1/1
[2012-03-24 19:27:00,913] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)     album_artist    : The Dandy Warhols
[2012-03-24 19:27:00,913] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)     encoder         : LAME v3.97
[2012-03-24 19:27:00,913] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)     title           : We Used To Be Friends
[2012-03-24 19:27:00,913] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)     artist          : The Dandy Warhols
[2012-03-24 19:27:00,913] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)     album           : Welcome To The Monkey House
[2012-03-24 19:27:00,913] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)     replaygain_album_gain: -8.82 dB
[2012-03-24 19:27:00,913] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)     replaygain_album_peak: 1.161511
[2012-03-24 19:27:00,913] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)     replaygain_track_gain: -9.70 dB
[2012-03-24 19:27:00,913] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)     replaygain_track_peak: 1.131116
[2012-03-24 19:27:00,913] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)   Duration: 00:03:20.01, start: 0.000000, bitrate: 260 kb/s
[2012-03-24 19:27:00,913] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)     Stream #0.0: Audio: mp3, 44100 Hz, stereo, s16, 224 kb/s
[2012-03-24 19:27:00,918] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg) Output #0, au, to 'pipe:':
[2012-03-24 19:27:00,918] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)   Metadata:
[2012-03-24 19:27:00,918] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)     date            : 2003
[2012-03-24 19:27:00,918] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)     track           : 2/13
[2012-03-24 19:27:00,918] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)     disc            : 1/1
[2012-03-24 19:27:00,918] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)     album_artist    : The Dandy Warhols
[2012-03-24 19:27:00,918] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)     replaygain_track_peak: 1.131116
[2012-03-24 19:27:00,918] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)     title           : We Used To Be Friends
[2012-03-24 19:27:00,919] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)     artist          : The Dandy Warhols
[2012-03-24 19:27:00,919] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)     album           : Welcome To The Monkey House
[2012-03-24 19:27:00,919] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)     replaygain_album_gain: -8.82 dB
[2012-03-24 19:27:00,919] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)     replaygain_album_peak: 1.161511
[2012-03-24 19:27:00,919] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)     replaygain_track_gain: -9.70 dB
[2012-03-24 19:27:00,919] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)     encoder         : Lavf53.6.0
[2012-03-24 19:27:00,919] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)     Stream #0.0: Audio: pcm_s16be, 44100 Hz, stereo, s16, 1411 kb/s
[2012-03-24 19:27:00,919] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg) Stream mapping:
[2012-03-24 19:27:00,919] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg)   Stream #0.0 -> #0.0
[2012-03-24 19:27:00,919] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg) Press [q] to stop, [?] for help


Does some of you guys also use subsonic with xbmcbuntu or can tell me why there is no other audio device, like nvidia hdmi or something?

any help is appreciated
Avathar
 
Posts: 8
Joined: Sun Dec 18, 2011 11:09 am

Re: XBMCbuntu and Subsonic jukebox

Postby Avathar » Fri May 04, 2012 6:51 pm

Well, i had some time again to play around with this..
I finally figured out, why i got no audio devices: it was cause i was using openjdk instead of sun java. I installed sun java 1.7u4 today, and it worked.

But now i have the problem again, that only one device can use the hdmi port.
If i start subsonic configured to use the hdmi audio port, xbmc can't initialize it any more..

Is there a way to bypass this?
Avathar
 
Posts: 8
Joined: Sun Dec 18, 2011 11:09 am

Re: XBMCbuntu and Subsonic jukebox

Postby nutt318 » Thu Aug 30, 2012 3:17 pm

Avathar, where you able to get your XBMCbuntu to play video from the SubSonic server? I installed this XMBC plugin http://forum.xbmc.org/showthread.php?tid=99513 and cannot get it working right, just was wondering what you did to get it to transcode videos.

Thanks!
nutt318
 
Posts: 54
Joined: Thu Dec 09, 2010 9:24 pm

Re: XBMCbuntu and Subsonic jukebox

Postby pcolline » Tue Sep 04, 2012 4:07 am

Below is my experience in getting XBMCbuntu/Eden + Subsonic Jukebox mode side-by-side installation working. The benefits of this include the following:

1. A single machine acts as an xbmc media server and subsonic music server.
2. Movies can be watched at the same time as someone else is playing music (in my case, movie inside, music playing in the backyard).
3. Music managed by subsonic which has applications beyond jukebox mode.
4. Stronger music client support (jukebox or otherwise) than xbmc.

Steps taken by me are below. I spent a few days of work on this so hopefully it contains information that can be useful to others:

Started by following basic install instructions from http://www.subsonic.org/pages/installation.jsp#debian
Installed openjdk 6 package: sudo apt-get install openjdk-6-jre
Downloaded .deb version of subsonic from http://www.subsonic.org/pages/download2.jsp?target=subsonic-4.6.deb
Installed download: sudo dpkg -i subsonic-4.6.deb

After installation, subsonic server was running and I was able to login on port 4040. I then setup a separate full admin user which I used from that point forward.

My music is hosted on a separate machine via SMB. I therefore mounted smb/cifs share and setup subsonic via web gui to point to music on the share. Advice found here: http://www.thatsquality.com/articles/mounting-windows-smb-file-shares-using-cifs

Music wouldn't play in Jukebox mode. Inspection of /var/subsonic/subsonic.log yielded the following error:

ERROR JukeboxService - Error in jukebox: javax.sound.sampled.LineUnavailableException javax.sound.sampled.LineUnavailableException

Search of the web turns up numerous discussions where the solution was to install the Oracle/Sun JDK 6. This was fairly involved since it requires acquiring the download from Oracle (going away as of 11/2012). The instructions on the following page were helpful: https://help.ubuntu.com/community/Java

Note, their download link no longer works since Oracle requires a radio button selection of accepting their license. The start page is here: http://www.oracle.com/technetwork/java/javase/downloads/jre6-downloads-1637595.html

I chose the second link (Linux x86, non rpm version). Worst case, you download it from another computer using the base link and ftp it to the XBMCbuntu machine.

After installation using the ubuntu Java directions from the previous site, I switched Java installation over to Sun Java 6 with the following command (also described on the ubuntu Java site):

sudo update-alternatives --config java

I then restarted subsonic using the following command:

sudo service subsonic restart

At this point, I tried running Jukebox mode again. Everything was looking good, but the music was still not playing. A log inspection no longer showed the original failure (...lineUnavailableException) so this definitely made a difference. Perhaps Java 7 will work just as well.

Further research turned up details regarding how to direct subsonic to use a particular sound card. In my case, I had the Intel sound "card" on the motherboard and a separately installed card for XBMC (w/spdif). The aim was to have XBMC own the spdif connection and subsonic would use the Intel connection.

Found great info here: http://forum.subsonic.org/forum/viewtopic.php?f=2&t=2038

and here: http://sourceforge.net/apps/mediawiki/subsonic/index.php?title=Players#Jukebox

This involved first determining what Java saw in the list of enumerated sound cards by their name. The aforementioned posts described creating a small Java program and after compiling/executing it, dropping that info into the subsonic setup script. At this point, I had forced subsonic to use the Intel analog connection on my XBMCbuntu box.

I restarted subsonic again, and still no luck. The logs looked clean however.

After more research and trying a bunch of things to no avail, I decided to try quitting XBMC. To my surprise, restarting subsonic yielded success! However, restarting XBMC breaks subsonic. I was at least getting closer, but still had to get XBMC and subsonic to play nice together.

I decided to change the subsonic user from root to xbmc. A number of instructions are out there to do this. One particularly helpful site was here:

http://unlockforus.com/installing-subsonic-music-streamer-in-ubuntu-server-10-04-lts-lucid-lynx-2

Instead of creating the subsonic user, I went with re-using the xbmc user to have the best chance of the two programs working together. The instructions therefore need to reflect this:

service subsonic stop
(skip the adduser steps since xbmc already exists)
chown -R xbmc :nogroup /tmp/subsonic
chown -R xbmc :nogroup /var/subsonic
chown -R root:root /var/subsonic/transcode
chown -R root:root /var/subsonic/jetty/*/webapp
chown xbmc /etc/default/subsonic
chmod 754 /etc/default/subsonic
vi /etc/default/subsonic
Change the line SUBSONIC_USER=root to SUBSONIC_USER=xbmc
sudo service subsonic restart
ps -Af | grep subsonic
(confirm subsonic process is running as xbmc user)

Once I did this I was able to successfully run subsonic in Jukebox mode with XBMC simultaneously!

Finishing up:

I eventually setup SMB automount using /etc/fstab:

//192.168.1.100/music /mnt/music cifs rw,user=xxx,password=xxx,file_mode=0777,dir_mode=0777,uid=1000,gid=1000 0 0

The file and directory modes were important as were the uid/gid are the user and group id's for xbmc seen from /etc/group and /etc/passwd. Without one or both, only root user could see the files and subsonic was empty of music.

I rebooted to confirm this would be stable afterward, and I encountered problems. The first was due to the sound devices getting re-ordered. This is easily fixed by following the instructions here:

http://ubuntuforums.org/showthread.php?t=922860

Unfinished business:

Other problems I'm still battling include the fact I need to restart xbmc and subsonic services after booting to get them to play nice together. While it's relatively quick and easy it's not meeting my expectations. Instructions for restarting these services:

sudo service lightdm stop
sudo service subsonic restart
sudo service lightdm start

The other issue is that Jukebox sound, for me at least, has very low gain forcing me to compensate with the amplifier volume control. I was burned a few times thinking subsonic wasn't working when it was simply that I hadn't turned up the sound enough. I was hoping to be able to change the ffmpeg transcoder to boost volume, but it appears that unlike the subsonic clients, there are no knobs for adjusting the Jukebox command line.

So there you have it. If you have some suggestions or comments on the above, please let me know. I will follow-up if I find better solutions.

I do want to thank everyone who laid the groundwork for my success via their posts and suggestions including Sindre himself.
pcolline
 
Posts: 3
Joined: Fri Feb 03, 2012 11:57 pm

Re: XBMCbuntu and Subsonic jukebox

Postby RemkoM » Sun Jan 13, 2013 3:04 pm

Thank you pcolline! this is very complete and will probably help 99% of the users. I like to add that for me switching Java to oracle 7 fixed it. i will also recommend closing xbmc and first try running it from the desktop. since xbmc and subsonic cant use the same output. which is a shame and im going to look to see if this maybe IS possible. if i get it ill let it know. also by default i ran subsonic as user xbmc and not root for the obvious reasons :)

tnx again. i love people that take the time to help.
RemkoM
 
Posts: 22
Joined: Tue Nov 20, 2012 11:11 am


Return to Help

Who is online

Users browsing this forum: No registered users and 57 guests