Madplay installation

Discussion about my Wifi Radio project at http://mightyohm.com/wifiradio/ or my WL-520gU talk at NOTACON.
claus14
Posts: 13
Joined: Tue Apr 09, 2013 5:08 pm

Re: Madplay installation

Post by claus14 »

I tried to install mpd even before installing madplay, but there was no space available. After installing the Base image from madox, the space available was 912 kb. After installing kmod-usb-audio and kmod-sound-core it was about 600kb left, if I remember correctly. After installing Alsa drivers, the space left was around 200 kb. Then, I tried to install mpd, but the router needed about 800 kb for that, so it did not install. I think the mpd package itself is not big, but its dependencies take a lot of space. This problem may be fixed with an external flash drive, but I wanted something simple.
I'll add the USB sound card to the list you gave me.
The latest news about my little toy are: last night I remembered that I have an old Creative Inspire T5400 system, bought about 7-8 years ago, that I was not using anymore. I connected only 2 of the speakers and the subwoofer and I'm very happy with the sound.
This is the system:

http://www.newegg.com/Product/Product.a ... 6836116137

As a side info, I found a link with more details about madplay. This guy created a simple program that allows madplay to re-connect to the server, with a 5 secound pause, if the stream and the player exits. Here's the link:
http://codeidol.com/unix/linux-multimed ... P3-Player/
It can be interesting if anybody can adapt this small script to the code you posted.

claus14

User avatar
gerben
Posts: 164
Joined: Sat Oct 16, 2010 8:41 am
Location: Netherlands

Re: Madplay installation

Post by gerben »

MPD is quite big. I didn't know how big the Madox image was, so I wasn't sure MPD wouldn't fit. But like you found out, it doesn't.

To answer your question. Just save the code he provided:

Code: Select all

#!/bin/sh
	while [ 1 ]
	do
		wget -q -O -http://example.com/mystream | madplay -Q --no-tty-control-
		sleep 2
	done
into a file. e.g. "/root/musicplayer.sh". To make the file executable run the following command:

Code: Select all

chmod +x /root/musicplayer.sh
Next change the line you added to /etc/rc.local to:

Code: Select all

(sleep 5;/root/musicplayer.sh)&
If you want multiple stations in your "playlist" just repeat the line starting with "wget ...", and change the url accordingly. Then, to go to the next station, you just need to run

Code: Select all

killall madplay

claus14
Posts: 13
Joined: Tue Apr 09, 2013 5:08 pm

Re: Madplay installation

Post by claus14 »

Thank you, Gerben.
It seems that I'm missing something. I spent some time last night, trying to make the changes and create the sh file. So, I created a musicplayer.sh file with Notepad, replacing "http://example.com/stream" with my stream's IP address, and saved it on my desktop. Then, I opened WinSCP and moved this sh file to the root of the router. Within WinSCP, there's a way to do a command, like "execute". I tried to do the "execute" command of

"chmod +x /root/musicplayer.sh",

but it had an error.
Then, I created a new command that uses the chmod line. I tried both ways, remote command and local command.
After that, I changed the code of my etc/local with the one you gave me. I saved the changes and then I rebooted the router, but there was no sound.
Other option that I used was to type the chmod command inside Putty. I did that, but again, no sound.
So, this is where I am at this moment. These were my first times playing with WinSCP and Putty, so my experience is not that great.
What am I doing wrong ?
Thank you.

claus14

User avatar
gerben
Posts: 164
Joined: Sat Oct 16, 2010 8:41 am
Location: Netherlands

Re: Madplay installation

Post by gerben »

You say "the root of the router". Note that there is actually a folder called 'root' in the root of the filesystem. Quit confusing looking at it now. Make sure you place the file in that folder.

You can change the permission with winscp directly: http://winscp.net/eng/docs/ui_properties
No need to use chmod.

Next open putty. Run `cat /root/musicplayer.sh` to verify that the file was uploaded correctly. This command should output the contents of you shell script.

Try running the script with the command `/root/musicplayer.sh`. If all is well, you should hear some music.

PS. It would be helpful if you provided the error message instead of just saying "it had an error" :-)

claus14
Posts: 13
Joined: Tue Apr 09, 2013 5:08 pm

Re: Madplay installation

Post by claus14 »

I did the steps you showed me. I'll attach a few print screens, to see exactly what I have at this moment. Something else may be the culprit. Still not working.
One of the photos will show that file is placed in Root subfolder and Putty shows the content of the sh file.
The second file shows that all the boxes with the sh file properties are checked.
Maybe a view of System Log will give you a better idea.
Thank you.
Attachments
root.png
system log.png
winscp.png

User avatar
gerben
Posts: 164
Joined: Sat Oct 16, 2010 8:41 am
Location: Netherlands

Re: Madplay installation

Post by gerben »

Those screenshots are really useful. The logs seem to provide the answer to the problem
madplay: unrecognized option '--no-tty-control-'
So remove the text '--no-tty-control-' from your script file. So the line should end like this

Code: Select all

... | madplay -Q
If that doesn't work try the original parameters that worked previously. So

Code: Select all

... | madplay -

User avatar
gerben
Posts: 164
Joined: Sat Oct 16, 2010 8:41 am
Location: Netherlands

Re: Madplay installation

Post by gerben »

Now that I look at it; it seems wget is also complaining. Just use the original line of code in your shell script. So:

Code: Select all

wget -O - http://example.com/mystream | madplay -

claus14
Posts: 13
Joined: Tue Apr 09, 2013 5:08 pm

Re: Madplay installation

Post by claus14 »

Ok, I'm back after a very loooong break. Gerben, I made all the changes you specified last week, one by one. Initially, I deleted "no tty control" and...still no sound.
Then, I changed the sh file the way you pointed, first with

"... | madplay -Q"

and then with

"... | madplay -"

Again, no sound. Lastly, I used the original code in my shell script, from your last post. Again, no sound. I'll attach the system logs, the problem is with wget.
Last week I told you about an error with WinSCP, without giving you other details. Today, I'll fix that mistake of being short with my explanations and I'll attach another screenshot with that error. The interesting thing is, every time I try to connect to my router by using WinSCP, it tells me that "groups not found". After I click OK, it connects to the router without any messages, and I can see the tree structure.
So, at this moment I reverted back to the only working solution, the one without the "sh" file and with the wget script in my /etc/rc.local.
Attachments
system log.png
error.png

User avatar
gerben
Posts: 164
Joined: Sat Oct 16, 2010 8:41 am
Location: Netherlands

Re: Madplay installation

Post by gerben »

Try running rc.local directly, instead of restarting, and then checking the logs.
Just use putty to connect to the router, and then run `/etc/rc.local`. Post what you see next.

claus14
Posts: 13
Joined: Tue Apr 09, 2013 5:08 pm

Re: Madplay installation

Post by claus14 »

Sorry, Gerben. I'm afraid I quite don't understand. I'll attach 2 screenshots, with what I have right now. This is the original setting, with no "sh" file. Can you please be more clear about running putty ? Thank you.
Attachments
logs.png
local.png

Post Reply