Page 1 of 1

Auto start MPC playing a Wifi Radio

Posted: Mon Mar 05, 2012 5:44 pm
by mcc253
Hi,

I've recently transformed my Asus 520gu into a wifi radio receiver, thanks to MightyOhm tutorial.

Everytime I reboot or power off, the router losts all the radio links and volume settings which I have added to mpc.
My question is if is there some way to save my prefered wifi radios links and everytime I power on or reboot, the router auto start with mpc playing my favourite wifi radio with for example 90% volume.

Many thanks.

Re: Auto start MPC playing a Wifi Radio

Posted: Tue Mar 06, 2012 8:49 am
by gerben
add the stations to the mpc. Then save the playlist using

Code: Select all

mpc save a-name-for-playlist
then load this station, and set the volume on startup by editing /etc/init.d/mpd. And the end of the start section (after the line containing /usr/bin/mdp) add the following

Code: Select all

/usr/bin/mpc repeat on
/usr/bin/mpc volume 90
/usr/bin/mpc load a-name-for-playlist

Re: Auto start MPC playing a Wifi Radio

Posted: Tue Mar 06, 2012 11:02 am
by mcc253
Many many thanks for your reply. It's working thanks to you :)

I've added in mpd the line commands:
/usr/bin/mpc repeat on
/usr/bin/mpc volume 90
/usr/bin/mpc load myplaylist
/usr/bin/mpc play 1

(I've added one more line "/usr/bin/mpc play 1" to auto-start with the first wifi radio of the playlist).

Just one more question. After the line containing "/usr/bin/mdp" I had this lines which I deleted and wrote over with previous the command lines given by Gerben. The lines were:
#generate playlist and start to play
/usr/bin/mpc listall | /usr/bin/mpc add -
/usr/bin/mpc play
/usr/bin/mpc repeat

Any problem to delete this lines?

One more time, many thanks for your help Gerben.

Re: Auto start MPC playing a Wifi Radio

Posted: Tue Mar 06, 2012 12:51 pm
by gerben
Removing those lines is not a problem.
And you're welcome.

Shameless plug: Check out my other scripts. Maybe you find them useful.
viewtopic.php?f=2&t=247
viewtopic.php?f=2&t=448

Re: Auto start MPC playing a Wifi Radio

Posted: Wed Mar 07, 2012 6:46 am
by mcc253
Very interesting scripts. For now I will try to use the sleep function and also the Web Interface. I'm using MPoD for Iphone and it's working, but I will use your Web interface to use it on my pc.

I have some doubts where to add the code for sleep function, but I will post my questions for you in that specific topic :)

Many thanks once again Gerben.