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

Madplay installation

Post by claus14 »

Hello everyone,
I'm planning to make a wifi radio, to stream web radio stations.
Recently, I bought a Tp-Link router, model TL-WR703N. It is a small travel router, supported by Openwrt: http://wiki.openwrt.org/toh/tp-link/tl-wr703n

A few specs:
-Atheros AR7240 CPU (400Mhz)
-Atheros AR9331 Chipset (integrated wireless)
-802.11 b/g/n 150Mbps (130Mbps real)
-wireless power output 20dBm - 100mW
-4 MB flash memory
-32 MB RAM
-USB 2.0 port (High-Speed only, use an external High-Speed hub for Full/Low-Speed devices)
-Powered via micro-USB socket
-Tiny form factor: 5.7cm x 5.7cm x 1.8cm

I found a way to install the new firmware, without going thru telnet and ssh stuff, from http://www.madox.net.
I installed their Base image, that contains the Luci interface and has basic modules. For a beginner, that was a great help, since the Luci interface is included in the image file.
Reading more and more, I found that I have to install the following packages:
-kmod-usb-audio
-kmod-sound-core
-alsa drivers
I installed all three of them, from Madox's repository and I'm stuck with installation of madplay. They don't have it in their repository and when I tried to download from openwrt's repository I got the message : "package found but incompatible with structure architectures configured".
I looked at the space available and I still have ~ 244 kb free, for modules installation.
Can anyone help me, how can I install madplay on this router ?
Thank you in advance.
claus14

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

Re: Madplay installation

Post by gerben »

Could you post the contents of /etc/opkg.conf ?
What version of OpenWrt does Madox use?

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

Re: Madplay installation

Post by claus14 »

Content of opkg.conf:

src/gz http://www.madox.net http://www.madox.net/wr703n/35706_2013-02-23/packages
dest root /
dest ram /tmp
lists_dir ext /var/opkg-lists
option overlay_root /overlay

The version I have is : BARRIER BREAKER (35706_2013-02-23, r35706)
The kernel is 3.7.9
The location of their image files is:
http://www.madox.net/blog/projects/tp-link-tl-wr703n/

A stupid question: is madplay the only player for streaming web radio stations ?
This is what I'm looking for...
Thank you.

claus14
Attachments
package.png
Interface.png

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

Re: Madplay installation

Post by gerben »

Mightyohm used MPD for audio playback. I don't know madplayer. But looking at the package size Madplayer is a bit smaller. But I'm not sure if either of them will fit into you 240kb free.

The error you received seems to suggest that you downloaded the madplayer package for the wrong platform. Where did you download it from. I think the correct location should be http://downloads.openwrt.org/snapshots/ ... /packages/

You could change the second url on the first line of /etc/opkg to this url, so you can just install it from the web-interface. So

Code: Select all

src/gz http://www.madox.net http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/
By installing this way, opkg will automatically install any dependant packages.

Let me know how it goes.

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

Re: Madplay installation

Post by claus14 »

Thank you so much, Gerben. It was a great help.
I changed the repository to the one you gave me and I rebooted the router. Initially, it had a little error, probable didn't do the update. I pressed the "Update lists" once again and it did the update. I'll attach 2 prints screens with the messages I got while updating.
It seems the router already had some of the dependencies installed, because I still have room left, 136 kb.
Now, I'm still waiting for the delivery of my USB sound card ordered from Ebay. I'm so anxious to see the results.

The line with the wget command has to be in the Local Startup, I believe...

Again, thank you very much for your help !!
Attachments
startup.png
update2.png
update.png

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

Re: Madplay installation

Post by gerben »

I forgot to mention you had to run opkg update. This was because the cache was still pointing to the madox repository. But you figured that one out yourself. Glad you got everything working so far.

But I don't understand you wget question. You never mentioned wget before. Putting it where you made a nice red arrow would run the wget command at system startup, though not necessarily after madplayer has started.

Happy to help.

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

Re: Madplay installation

Post by claus14 »

Last night, when I wrote the reply, I was in a little hurry, and I forgot to specify the other details. Sorry...
From Openwrt's website, at "USB Audio Support", there's an example of how to configure wget to play an audio stream. Here's the link:

http://wiki.openwrt.org/doc/howto/usb.audio

My understanding is that, if I configure wget to a specific internet audio stream, it will play using madplay, right after it finished the boot process.
So, that will be the place for the wget command...
And something else. How do I make sure that madplay starts right after the boot process ?
Thank you.

claus14

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

Re: Madplay installation

Post by gerben »

madplayer will probably already start at boot. From the openwrt web interface you can enable your application. Otherwise you could do something like '/etc/init.d/madplayer enable'

You can indeed put the wget at the red arrow. However, to be sure madplayer has already started you would probably have to add a delay. Also, the wget command would block the process. So you'd have to daemonise the process. So you would end up with something like:

Code: Select all

(sleep 5;wget -O - http://64.236.34.97:80/stream/1014 | madplay -)&
PS. seeing how madplayer doesn't really support internet-radio. If you plan on using it only for internet-radio, I would suggest using mpd and mpc.

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

Re: Madplay installation

Post by claus14 »

I have great news !
Tired of waiting for the delivery of my USB sound card from Ebay (purchased almost 4 weeks ago), I went to Fry's today and I bought a sound card from them. This is the model:

http://www.frys.com/product/6560623?sit ... IN_RSLT_PG

The image is different than the product itself, the plastic in the photo looks cheap. The one that I bought today has a rubberized cover, very smooth and nice.
Ok, so I used the code you had in your post, with the delay for the madplay and, within ~30 seconds after I connected this Tp-Link router to the big router, I was able to hear music from radio ! The quality is great, without any clicks or pops. At this moment I'm listening radio thru headsets, but I can tell that the quality of sound is great. I want to specify this, because some other members complained about sound quality using other USB sound cards.
Interesting thing is that the volume buttons don't work. The headsets I use have an in-line volume control, so this is not a big problem.
To be honest, I have no idea how to check what chipset this USB is using. I read that CM119 is the good one, but I don't know if I have that one or another one.
Also, I connected this USB card to my computer, to see if I can find more information, but i says "USB generic sound card".
So, the packages that I'm using right now are:
-kmod-usb-audio
-kmod-sound-core
-ALSA drivers
-madplay
Something else I wanted to say... before installing these packages, I tried to install mpd, but there wasn't enough memory left, so it didn't install it.
I wanted to use this small router without external USB memory (a flash drive). Again, for a beginner, it can be a challenge to mount drive, external root and something like that. I preffered the easy way.
Gerben, I cannot thank you enough for all your help. In turn, I hope that one day I can help other members, by giving more details about my settings, which I just did. There are so many ways to tweak this and one of them can be the "cron" function. That would be for me my next step to learn.
Attachments
wget.png

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

Re: Madplay installation

Post by gerben »

Your welcome. Glad to hear you got it working.

Have you tried removing madplayer before installing MPD?

PS. adding your adapter the the list of USB-audio adapters known to work with OpenWrt/mpd at viewtopic.php?f=2&t=232&start=40 would be very helpful.

Post Reply