Koozali.org: home of the SME Server

How can I run mpg123 at startup?

Offline FrancisT

  • **
  • 23
  • +0/-0
How can I run mpg123 at startup?
« on: October 07, 2006, 10:29:51 AM »
I am running mpg123 playing mp3s stored on the server.  This is fed out to a LPFM (Low Power FM) transmitter.  I have a play list that should keep it going for about 20 days.

What I would like to be able to do is:
1. If the server restarts, or on startup, to run the 'mpg123 -@ playlist' command from within the music directory.
2. When mpg123 gets to the end of the play list file, to re-run the 'mpg123 -@ playlist' command.

This would allow the radio station to keep running indefinately.

Any help would be greatly appreciated.
...

Offline mmccarn

  • *
  • 2,651
  • +10/-0
How can I run mpg123 at startup?
« Reply #1 on: October 09, 2006, 04:55:48 PM »
write a script that does what you want and add it to the end of /etc/rc.local

Offline william_syd

  • *****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
How can I run mpg123 at startup?
« Reply #2 on: October 10, 2006, 03:54:16 AM »
Considerng how SME works this looks interesting

Supervise mpg123.
Regards,
William

IF I give advise.. It's only if it was me....

Offline FrancisT

  • **
  • 23
  • +0/-0
How can I run mpg123 at startup?
« Reply #3 on: October 10, 2006, 07:11:57 AM »
Thanks, I have put the script in /etc/rc.local, but have yet to do a restart.

I have about 1850 mp3 files, I used rl, I think (Random Lines), 4 times and combines into one list.  At the moment it has been running 8 days and is about 1/4 through.

I had a few corrupt files, but I've deleted them and it runs sweet as.

It's running on an IBM eServer, P4 3.0 1500Mb RAM, 73Gb SCSI Hard Disk, Genius Sound card.  This file & print serves, Firewall & Internet & mpg123.  The hard disk activity light flickers every 4 or 5 seconds and there has been no degrading of it's performance since running mpg123.

The transmitter 400mw & has a range of just over 1 kilometre, so it cover our urban area.  If I lived in the centre of town coverage would be better.

Thanks for you help.

Francis
...

Offline william_syd

  • *****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
How can I run mpg123 at startup?
« Reply #4 on: October 10, 2006, 08:12:06 AM »
Is it possible for you to share your script ?

FYI.
Code: [Select]
Why is /service better than inittab and ttys and init.d and rc.local? Why should my package rely on svscan and supervise?

Answer: Several reasons:
                                           inittab   ttys    init.d  rc.local  /service
Easy service installation and removal         No      No      Yes      No         Yes
Easy first-time service startup               No      No      No       No         Yes
Reliable restarts                             Yes     Yes     No       No         Yes
Easy, reliable signalling                     No      No      No       No         Yes
Clean process state                           Yes     Yes     No       No         Yes
Portability                                   No      No      No       No         Yes
Regards,
William

IF I give advise.. It's only if it was me....

Offline william_syd

  • *****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
Re: How can I run mpg123 at startup?
« Reply #5 on: October 11, 2006, 03:37:06 PM »
Quote from: "FrancisT"
I am running mpg123 playing mp3s stored on the server.  This is fed out to a LPFM (Low Power FM) transmitter.  I have a play list that should keep it going for about 20 days.

What I would like to be able to do is:
1. If the server restarts, or on startup, to run the 'mpg123 -@ playlist' command from within the music directory.
2. When mpg123 gets to the end of the play list file, to re-run the 'mpg123 -@ playlist' command.

This would allow the radio station to keep running indefinately.

Any help would be greatly appreciated.


If you haven't done it yet I wrote up a method I used that should restart the playlist after the last song is played.
Using Supervise to keep mpg123 going...
Regards,
William

IF I give advise.. It's only if it was me....

mente

Re: How can I run mpg123 at startup?
« Reply #6 on: October 11, 2006, 05:35:29 PM »
Quote from: "FrancisT"
I am running mpg123 playing mp3s stored on the server.  


How did vou get mpg123 to run on SME7?

Thanks for you help.

Clemente

Offline william_syd

  • *****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
Re: How can I run mpg123 at startup?
« Reply #7 on: October 12, 2006, 01:59:08 AM »
Quote from: "mente"
Quote from: "FrancisT"
I am running mpg123 playing mp3s stored on the server.  


How did vou get mpg123 to run on SME7?

Thanks for you help.

Clemente


You can follow this how-to
http://no.longer.valid/phpwiki/index.php/How-To%20Play%20Sound%20In%20Console%20Mode

or just to get mpg123 up and running for mp3's

mpg123 jukebox (Autostart/Autorepeat) HowTo
Regards,
William

IF I give advise.. It's only if it was me....