sound card selection dropdown on the jukebox

Got an idea? Missing something? Post your feature request here.

Moderator: moderators

sound card selection dropdown on the jukebox

Postby adio » Sun Jan 23, 2011 2:51 pm

Hello,

There would be very useful to be able to select the sound card used for playing the music in jukebox mode - from the web interface or maybe from the Subsonic Control Panel.

At the moment I'm using Winamp manually configured on the 'speakers' sound card for ambiance music, and using the headphones as the default sound card for browsing the web and watching clips on Youtube at the same time.

It would be so cool to be able to give to all people in my house access to change the music in 'jukebox' mode wile still clicking happily around the net on the headphones.

Keep on the wonderful work!
adio
 
Posts: 1
Joined: Sun Jan 23, 2011 2:19 pm

Postby 3R3 » Tue Jan 25, 2011 3:24 pm

id like thi feature too. with ubuntu, my jukebox not working is probably a result of SS selecting the wrong driver. but im at a loss as to where to change the soundcard for jukebox mode.
User avatar
3R3
 
Posts: 332
Joined: Mon May 04, 2009 2:09 pm
Location: Germany

Postby maxslug » Sun Mar 06, 2011 8:43 pm

I'm having the same problem -- I have two sound cards and I think it's playing out of the wrong one.

EDIT: Temp workaround found, and I added it to the wiki :
https://sourceforge.net/apps/mediawiki/ ... rs#Jukebox

Any ideas?
-m
maxslug
 
Posts: 44
Joined: Tue Oct 26, 2010 11:23 pm

Re: sound card selection dropdown on the jukebox

Postby epicurus » Wed Oct 05, 2011 10:21 pm

I tried to use the instructions on the wiki, but no matter what card I choose. I only have one. Subsonic states it cannot find it. this is the code I think ought to be correct per the wiki
Code: Select all
'-Djavax.sound.sampled.SourceDataLine=#rev50 [plughw:0,0]' \


when I restart subsonic this is the code
Code: Select all
* Restarting Subsonic Daemon subsonic                                          /usr/bin/subsonic: 127: -Djavax.sound.sampled.SourceDataLine=#rev50 [plughw:0,0]: not found
Started Subsonic [PID 2933, /var/subsonic/subsonic_sh.log]


Any help would be greatly appreciated. If I add the line at the beginning of /usr/bin/subsonic subsonic will run, but I cannot play m4a. I have gone through the transcoding stuff and that did not resolve the issue.

Thanks again.
epicurus
 
Posts: 10
Joined: Thu Mar 10, 2011 7:30 pm

Re: sound card selection dropdown on the jukebox

Postby maxslug » Wed Oct 05, 2011 10:28 pm

epicurus wrote:
Code: Select all
* Restarting Subsonic Daemon subsonic                                          /usr/bin/subsonic: 127: -Djavax.sound.sampled.SourceDataLine=#rev50 [plughw:0,0]: not found
Started Subsonic [PID 2933, /var/subsonic/subsonic_sh.log]



That's a shell script error, your new argument is not reaching subsonic -- you probably need to add a final backslash ( \ ) on the line previous to this one.

-m
maxslug
 
Posts: 44
Joined: Tue Oct 26, 2010 11:23 pm

Re: sound card selection dropdown on the jukebox

Postby epicurus » Fri Oct 07, 2011 1:34 am

Thank you for replying so promptly. That did not work this is what I have now, I have tried a number of variations all do not work, I provided my whole \usr\bin\subsonic, the '-dja... is at the end so feel free to scroll the code all the way down. I tried to put it in bold:
Code: Select all
#!/bin/sh

###################################################################################
# Shell script for starting Subsonic.  See http://subsonic.org.
#
# Author: Sindre Mehus
###################################################################################

SUBSONIC_HOME=/var/subsonic
SUBSONIC_HOST=0.0.0.0
SUBSONIC_PORT=4040
SUBSONIC_HTTPS_PORT=0
SUBSONIC_CONTEXT_PATH=/
SUBSONIC_MAX_MEMORY=100
SUBSONIC_PIDFILE=
SUBSONIC_DEFAULT_MUSIC_FOLDER=/var/music
SUBSONIC_DEFAULT_PODCAST_FOLDER=/var/music/Podcast
SUBSONIC_DEFAULT_PLAYLIST_FOLDER=/var/playlists


quiet=0

usage() {
    echo "Usage: subsonic.sh [options]"
    echo "  --help               This small usage guide."
    echo "  --home=DIR           The directory where Subsonic will create files."
    echo "                       Make sure it is writable. Default: /var/subsonic"
    echo "  --host=HOST          The host name or IP address on which to bind Subsonic."
    echo "                       Only relevant if you have multiple network interfaces and want"
    echo "                       to make Subsonic available on only one of them. The default value"
    echo "                       will bind Subsonic to all available network interfaces. Default: 0.0.0.0"
    echo "  --port=PORT          The port on which Subsonic will listen for"
    echo "                       incoming HTTP traffic. Default: 4040"
    echo "  --https-port=PORT    The port on which Subsonic will listen for"
    echo "                       incoming HTTPS traffic. Default: 0 (disabled)"
    echo "  --context-path=PATH  The context path, i.e., the last part of the Subsonic"
    echo "                       URL. Typically '/' or '/subsonic'. Default '/'"
    echo "  --max-memory=MB      The memory limit (max Java heap size) in megabytes."
    echo "                       Default: 100"
    echo "  --pidfile=PIDFILE    Write PID to this file. Default not created."
    echo "  --quiet              Don't print anything to standard out. Default false."
    echo "  --default-music-folder=DIR    Configure Subsonic to use this folder for music.  This option "
    echo "                                only has effect the first time Subsonic is started. Default '/var/music'"
    echo "  --default-podcast-folder=DIR  Configure Subsonic to use this folder for Podcasts.  This option "
    echo "                                only has effect the first time Subsonic is started. Default '/var/music/Podcast'"
    echo "  --default-playlist-folder=DIR Configure Subsonic to use this folder for playlists.  This option "
    echo "                                only has effect the first time Subsonic is started. Default '/var/playlists'"
    exit 1
}

# Parse arguments.
while [ $# -ge 1 ]; do
    case $1 in
        --help)
            usage
            ;;
        --home=?*)
            SUBSONIC_HOME=${1#--home=}
            ;;
        --host=?*)
            SUBSONIC_HOST=${1#--host=}
            ;;
        --port=?*)
            SUBSONIC_PORT=${1#--port=}
            ;;
        --https-port=?*)
            SUBSONIC_HTTPS_PORT=${1#--https-port=}
            ;;
        --context-path=?*)
            SUBSONIC_CONTEXT_PATH=${1#--context-path=}
            ;;
        --max-memory=?*)
            SUBSONIC_MAX_MEMORY=${1#--max-memory=}
            ;;
        --pidfile=?*)
            SUBSONIC_PIDFILE=${1#--pidfile=}
            ;;
        --quiet)
            quiet=1
            ;;
        --default-music-folder=?*)
            SUBSONIC_DEFAULT_MUSIC_FOLDER=${1#--default-music-folder=}
            ;;
        --default-podcast-folder=?*)
            SUBSONIC_DEFAULT_PODCAST_FOLDER=${1#--default-podcast-folder=}
            ;;
        --default-playlist-folder=?*)
            SUBSONIC_DEFAULT_PLAYLIST_FOLDER=${1#--default-playlist-folder=}
            ;;
        *)
            usage
            ;;
    esac
    shift
done

# Use JAVA_HOME if set, otherwise assume java is in the path.
JAVA=java
if [ -e "${JAVA_HOME}" ]
    then
    JAVA=${JAVA_HOME}/bin/java
fi

# Create Subsonic home directory.
mkdir -p ${SUBSONIC_HOME}
LOG=${SUBSONIC_HOME}/subsonic_sh.log
rm -f ${LOG}

cd $(dirname $0)
if [ -L $0 ] && ([ -e /bin/readlink ] || [ -e /usr/bin/readlink ]); then
    cd $(dirname $(readlink $0))
fi

${JAVA} -Xmx${SUBSONIC_MAX_MEMORY}m \
  -Dsubsonic.home=${SUBSONIC_HOME} \
  -Dsubsonic.host=${SUBSONIC_HOST} \
  -Dsubsonic.port=${SUBSONIC_PORT} \
  -Dsubsonic.httpsPort=${SUBSONIC_HTTPS_PORT} \
  -Dsubsonic.contextPath=${SUBSONIC_CONTEXT_PATH} \
  -Dsubsonic.defaultMusicFolder=${SUBSONIC_DEFAULT_MUSIC_FOLDER} \
  -Dsubsonic.defaultPodcastFolder=${SUBSONIC_DEFAULT_PODCAST_FOLDER} \
  -Dsubsonic.defaultPlaylistFolder=${SUBSONIC_DEFAULT_PLAYLIST_FOLDER} \
  -Djava.awt.headless=true \
  -verbose:gc \
  -jar subsonic-booter-jar-with-dependencies.jar > ${LOG} 2>&1 & \
[b] '-Djavax.sound.sampled.SourceDataLine=#rev50 [plughw:0,0]' \[/b]

# Write pid to pidfile if it is defined.
if [ $SUBSONIC_PIDFILE ]; then
    echo $! > ${SUBSONIC_PIDFILE}
fi

if [ $quiet = 0 ]; then
    echo Started Subsonic [PID $!, ${LOG}]
fi



This is the output when I restart subsonic:
Code: Select all
* Restarting Subsonic Daemon subsonic                                          /usr/bin/subsonic: 127: -Djavax.sound.sampled.SourceDataLine=#rev50 [plughw:0,0]: not found
Started Subsonic [PID 4691, /var/subsonic/subsonic_sh.log]
                                                                         [ OK ]


It runs but it still did not find the card, which is odd. Also m4as still do not play in jukebox.
epicurus
 
Posts: 10
Joined: Thu Mar 10, 2011 7:30 pm

Re: sound card selection dropdown on the jukebox

Postby bushman4 » Fri Oct 07, 2011 11:28 am

I'd move the single quotes in the last line...

Code: Select all
${JAVA} -Xmx${SUBSONIC_MAX_MEMORY}m \
  -Dsubsonic.home=${SUBSONIC_HOME} \
  -Dsubsonic.host=${SUBSONIC_HOST} \
  -Dsubsonic.port=${SUBSONIC_PORT} \
  -Dsubsonic.httpsPort=${SUBSONIC_HTTPS_PORT} \
  -Dsubsonic.contextPath=${SUBSONIC_CONTEXT_PATH} \
  -Dsubsonic.defaultMusicFolder=${SUBSONIC_DEFAULT_MUSIC_FOLDER} \
  -Dsubsonic.defaultPodcastFolder=${SUBSONIC_DEFAULT_PODCAST_FOLDER} \
  -Dsubsonic.defaultPlaylistFolder=${SUBSONIC_DEFAULT_PLAYLIST_FOLDER} \
  -Djava.awt.headless=true \
  -verbose:gc \
  -jar subsonic-booter-jar-with-dependencies.jar > ${LOG} 2>&1 & \
  -Djavax.sound.sampled.SourceDataLine='#rev50 [plughw:0,0]' \
Glenn Sullivan
Subsonic 6.1.6 (Unraid Docker)
90 regular Subsonic Users

Library as of 2024-10-28:
4,527 artists
19,996 albums
282,151 songs
10201.40 GB
41,583 hours
User avatar
bushman4
 
Posts: 875
Joined: Thu Dec 02, 2010 1:47 pm
Location: Massachusetts, USA

Re: sound card selection dropdown on the jukebox

Postby epicurus » Sat Oct 08, 2011 3:45 pm

I had already tried that, and I tried it again. No dice. Thank you though. Any other ideas?
epicurus
 
Posts: 10
Joined: Thu Mar 10, 2011 7:30 pm

Re: sound card selection dropdown on the jukebox

Postby mycroft » Mon Oct 17, 2011 7:29 pm

The selection dropdown would be awesome by itself. Paired with the ability to create multiple jukebox players with different playback devices, it would rock.
mycroft
 
Posts: 3
Joined: Mon Oct 17, 2011 7:25 pm

Re: sound card selection dropdown on the jukebox

Postby maxslug » Sat Oct 22, 2011 2:23 am

OK, second problem : the line you added needs to come before these commands :
Code: Select all
> ${LOG} 2>&1 &


Those commands redirect STDOUT and STDERR to $LOG and tells the process to run in the background (daemon).

Here is the fixed version. Note that the final back slash after the & is removed, and that the single quotes are still in there. You need the single quotes because your sound card name has a space and a # in it.

Another shell script gotchas to look out for : Make sure there are no spaces after the back slashes ever. The back slash (line continuation character) has to be the last thing on the line.

-m



Code: Select all
#!/bin/sh

###################################################################################
# Shell script for starting Subsonic.  See http://subsonic.org.
#
# Author: Sindre Mehus
###################################################################################

SUBSONIC_HOME=/var/subsonic
SUBSONIC_HOST=0.0.0.0
SUBSONIC_PORT=4040
SUBSONIC_HTTPS_PORT=0
SUBSONIC_CONTEXT_PATH=/
SUBSONIC_MAX_MEMORY=100
SUBSONIC_PIDFILE=
SUBSONIC_DEFAULT_MUSIC_FOLDER=/var/music
SUBSONIC_DEFAULT_PODCAST_FOLDER=/var/music/Podcast
SUBSONIC_DEFAULT_PLAYLIST_FOLDER=/var/playlists


quiet=0

usage() {
    echo "Usage: subsonic.sh [options]"
    echo "  --help               This small usage guide."
    echo "  --home=DIR           The directory where Subsonic will create files."
    echo "                       Make sure it is writable. Default: /var/subsonic"
    echo "  --host=HOST          The host name or IP address on which to bind Subsonic."
    echo "                       Only relevant if you have multiple network interfaces and want"
    echo "                       to make Subsonic available on only one of them. The default value"
    echo "                       will bind Subsonic to all available network interfaces. Default: 0.0.0.0"
    echo "  --port=PORT          The port on which Subsonic will listen for"
    echo "                       incoming HTTP traffic. Default: 4040"
    echo "  --https-port=PORT    The port on which Subsonic will listen for"
    echo "                       incoming HTTPS traffic. Default: 0 (disabled)"
    echo "  --context-path=PATH  The context path, i.e., the last part of the Subsonic"
    echo "                       URL. Typically '/' or '/subsonic'. Default '/'"
    echo "  --max-memory=MB      The memory limit (max Java heap size) in megabytes."
    echo "                       Default: 100"
    echo "  --pidfile=PIDFILE    Write PID to this file. Default not created."
    echo "  --quiet              Don't print anything to standard out. Default false."
    echo "  --default-music-folder=DIR    Configure Subsonic to use this folder for music.  This option "
    echo "                                only has effect the first time Subsonic is started. Default '/var/music'"
    echo "  --default-podcast-folder=DIR  Configure Subsonic to use this folder for Podcasts.  This option "
    echo "                                only has effect the first time Subsonic is started. Default '/var/music/Podcast'"
    echo "  --default-playlist-folder=DIR Configure Subsonic to use this folder for playlists.  This option "
    echo "                                only has effect the first time Subsonic is started. Default '/var/playlists'"
    exit 1
}

# Parse arguments.
while [ $# -ge 1 ]; do
    case $1 in
        --help)
            usage
            ;;
        --home=?*)
            SUBSONIC_HOME=${1#--home=}
            ;;
        --host=?*)
            SUBSONIC_HOST=${1#--host=}
            ;;
        --port=?*)
            SUBSONIC_PORT=${1#--port=}
            ;;
        --https-port=?*)
            SUBSONIC_HTTPS_PORT=${1#--https-port=}
            ;;
        --context-path=?*)
            SUBSONIC_CONTEXT_PATH=${1#--context-path=}
            ;;
        --max-memory=?*)
            SUBSONIC_MAX_MEMORY=${1#--max-memory=}
            ;;
        --pidfile=?*)
            SUBSONIC_PIDFILE=${1#--pidfile=}
            ;;
        --quiet)
            quiet=1
            ;;
        --default-music-folder=?*)
            SUBSONIC_DEFAULT_MUSIC_FOLDER=${1#--default-music-folder=}
            ;;
        --default-podcast-folder=?*)
            SUBSONIC_DEFAULT_PODCAST_FOLDER=${1#--default-podcast-folder=}
            ;;
        --default-playlist-folder=?*)
            SUBSONIC_DEFAULT_PLAYLIST_FOLDER=${1#--default-playlist-folder=}
            ;;
        *)
            usage
            ;;
    esac
    shift
done

# Use JAVA_HOME if set, otherwise assume java is in the path.
JAVA=java
if [ -e "${JAVA_HOME}" ]
    then
    JAVA=${JAVA_HOME}/bin/java
fi

# Create Subsonic home directory.
mkdir -p ${SUBSONIC_HOME}
LOG=${SUBSONIC_HOME}/subsonic_sh.log
rm -f ${LOG}

cd $(dirname $0)
if [ -L $0 ] && ([ -e /bin/readlink ] || [ -e /usr/bin/readlink ]); then
    cd $(dirname $(readlink $0))
fi

${JAVA} -Xmx${SUBSONIC_MAX_MEMORY}m \
  -Dsubsonic.home=${SUBSONIC_HOME} \
  -Dsubsonic.host=${SUBSONIC_HOST} \
  -Dsubsonic.port=${SUBSONIC_PORT} \
  -Dsubsonic.httpsPort=${SUBSONIC_HTTPS_PORT} \
  -Dsubsonic.contextPath=${SUBSONIC_CONTEXT_PATH} \
  -Dsubsonic.defaultMusicFolder=${SUBSONIC_DEFAULT_MUSIC_FOLDER} \
  -Dsubsonic.defaultPodcastFolder=${SUBSONIC_DEFAULT_PODCAST_FOLDER} \
  -Dsubsonic.defaultPlaylistFolder=${SUBSONIC_DEFAULT_PLAYLIST_FOLDER} \
  -Djava.awt.headless=true \
  '-Djavax.sound.sampled.SourceDataLine=#rev50 [plughw:0,0]' \
  -verbose:gc \
  -jar subsonic-booter-jar-with-dependencies.jar > ${LOG} 2>&1 &

# Write pid to pidfile if it is defined.
if [ $SUBSONIC_PIDFILE ]; then
    echo $! > ${SUBSONIC_PIDFILE}
fi

if [ $quiet = 0 ]; then
    echo Started Subsonic [PID $!, ${LOG}]
fi

maxslug
 
Posts: 44
Joined: Tue Oct 26, 2010 11:23 pm

Re:

Postby LoudCat » Sun Nov 13, 2011 5:06 am

maxslug wrote:I'm having the same problem -- I have two sound cards and I think it's playing out of the wrong one.

EDIT: Temp workaround found, and I added it to the wiki :
https://sourceforge.net/apps/mediawiki/ ... rs#Jukebox

Any ideas?
-m


Sorry for the somewhat late response, but I wanted to thank you for the awesome advice/instructions. Having two sound cards can be a tad frustrating. . .especially if you're working with a variety of audio related programs. I'll check out the thread in a bit and see what I can do. I utilize Pro-Tools, VLC and Quicktime. Does anyone else on here use these programs? What types of sound cards do you use for each program? :)

Oh yeah -- slightly off topic: Has anyone on here ever used 5.1 speakers before? Thinking about getting some.
LoudCat
 
Posts: 1
Joined: Sat Nov 12, 2011 8:31 pm

Re: sound card selection dropdown on the jukebox

Postby garmonti » Sun May 11, 2014 9:58 am

Hello, I am also looking to do this with subsonic on ubuntu, one sound card runs my speakers and the other runs a small fm transmitter for when I am in the garage. There is a pseudo-dual-soundcard which combines them. How do I go about setting subsonic to play through this?

Am I right in thinking that I cannot just paste that code somewhere?
garmonti
 
Posts: 4
Joined: Mon Jun 03, 2013 8:26 pm

Re: sound card selection dropdown on the jukebox

Postby witkacy26 » Fri Dec 05, 2014 10:44 pm

SOLUTION:
Change openjre to oracle's sun-java.

It plays Subsonic junkbox well (tested on Ubuntu 14.04).
witkacy26
 
Posts: 1
Joined: Fri Dec 05, 2014 10:38 pm


Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 5 guests