PDA

View Full Version : Re: Daemonized MP3 player (linux)



Jake Hawkes
2003-11-10, 11:29
I think it would be as simple as this:

mpg123 http://localhost:9000/stream.mp3 &

run it once, and it should be happy forever. Granted, I have not tested this (no soundcard in
server)

you could wrap this in a script that simply sits in a forever loop:

#!/bin/sh

while (1)
do
mpg123 http://localhost:9000/stream.mp3
# if we get here, mpg123 died
# could send email, write something to the slimp screen, whatever
done


--- Michael Herger <mherger (AT) jo-sac (DOT) ch> wrote:
> I only own one SliMP3 for the living room, but would like to use the
> server in my room, too. My server is a "headless" linux box sitting right
> beside my hifi system. So why not simply connecting its built-in sound
> card to the amp?
>
> What I need is some kind daemonized MP3 player which is simply listening
> to http://localhost:9000/stream.mp3. All control would be done using
> SliMP3's web interface.
>
> Does anybody know of such a setup? What do you think about the idea?
>
> I have been googling and found a mplayer daemon (pretty recent:
> http://mplayerd.sourceforge.net/) or some perl modules which can daemonize
> mpg123 (http://beppu.lbox.org/proj/mp3-daemon.html). I'll have a closer
> look...
>
> Regards,
>
> --
>
> Michael
>
> -----------------------------------------------------------
> http://www.jo-sac.ch/lindenberg - die JO des SAC Lindenberg
> http://www.jo-sac.ch - JO-SAC inoffiziell!
> http://photo.jo-sac.ch - mein kleines Photoalbum
>
>

mherger
2003-11-10, 12:01
> I think it would be as simple as this:
> mpg123 http://localhost:9000/stream.mp3 &

This would be to simple to be true :-). After leaving the shell (closing
my ssh connection) will it stay alive?

Michael



> run it once, and it should be happy forever. Granted, I have not tested
> this (no soundcard in server)
>
> you could wrap this in a script that simply sits in a forever loop:
>
> #!/bin/sh
>
> while (1)
> do
> mpg123 http://localhost:9000/stream.mp3
> # if we get here, mpg123 died
> # could send email, write something to the slimp screen, whatever
> done
>
>
> --- Michael Herger <mherger (AT) jo-sac (DOT) ch> wrote:
>> I only own one SliMP3 for the living room, but would like to use the
>> server in my room, too. My server is a "headless" linux box sitting
>> right
>> beside my hifi system. So why not simply connecting its built-in sound
>> card to the amp?
>>
>> What I need is some kind daemonized MP3 player which is simply listening
>> to http://localhost:9000/stream.mp3. All control would be done using
>> SliMP3's web interface.
>>
>> Does anybody know of such a setup? What do you think about the idea?
>>
>> I have been googling and found a mplayer daemon (pretty recent:
>> http://mplayerd.sourceforge.net/) or some perl modules which can
>> daemonize
>> mpg123 (http://beppu.lbox.org/proj/mp3-daemon.html). I'll have a closer
>> look...
>>
>> Regards,
>>
>> --
>>
>> Michael
>>
>> -----------------------------------------------------------
>> http://www.jo-sac.ch/lindenberg - die JO des SAC Lindenberg
>> http://www.jo-sac.ch - JO-SAC inoffiziell!
>> http://photo.jo-sac.ch - mein kleines Photoalbum
>>
>>

Ted Rathkopf
2003-11-10, 13:58
Aaarr, Michael Herger <mherger (AT) jo-sac (DOT) ch>
What ye be sayin'?

>> I think it would be as simple as this:
>> mpg123 http://localhost:9000/stream.mp3 &
>
> This would be to simple to be true :-). After leaving the shell
> (closing my ssh connection) will it stay alive?
>
> Michael

What are you using to ssh in? If you are using a command line ssh,
you could do

ssh -f serverbox mpg123 http://localhost:9000/stream.mp3

-f Requests ssh to go to background just before command execution.
This is useful if ssh is going to ask for passwords or
passphrases, but the user wants it in the background. This
implies -n. The recommended way to start X11 programs at a
remote site is with something like ssh -f host xterm.

Though I think the idea of an running mpg123 in an infinite loop is a
good one. In which case you would do:

ssh -f serverbox runmpg123

where runmpg123 is the name of the script that runs mpg123 in an
infinite loop.


--
Ted Rathkopf