OpenWrt Forum Archive

Topic: usb audio support (patch)

The content of this topic has been archived on 29 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

sent this to patches@openwrt.org as directed in the docs but it bounced sad

Hi devs,
The attached patch adds support for usb soundcards. It is a fairly
trivial patch which I created as described in the buildroot howto. I
did need to add a trivial kernel patch though, to change a few instances
of sprintf to snprintf in sound_core.c as I was getting unresolved
symbols for strcpy.

FYI, audio support is a standard feature of the stock asus wl500g/x
firmware so I think it would be a welcome addition to openwrt. Currently
I have not packaged any actual audio players, making this seem somewhat
useless, however I have built and use "mpd" which I will package next.
There are also the asus music binaries floating around as well as a copy
of "madplay" which people may wish to use to actually play stuff.

The patch is against current CVS (4/9/05).

comments/suggestions welcome,

Thanks,
David Collett

[ removed patch to make thread more readable ]

(Last edited by davico on 9 Oct 2005, 21:52)

thx a lot, I will apply it shortly.

Can you suggest any USB audio device for testing/using, which is cheap and good?

I corrected the Mailadress, further patches and bugreports to openwrt-devel@openwrt.org .

Sunshine!

Sure, the card I use is:
http://www.soundmax.com.tw/product/SD-102.htm

It was cheap ($20 Australian), and uses a c-media chip supported by the linux driver.
Perhaps a UsbAudio wiki page is in order? I can do this if you like?

Dave

UsbAudio page would be nice.

Can you resent your patch to openwrt-devel@openwrt.org. Copy&paste from forum is really ugly and I failed with doing it right wink

wondering why there are no usable information about openWRT with audio on the ASUS wl500g (USB)  this seems the first thread mentioning specific 'software'.

i build madplay because i cannot find any ipkg for that - and it works great with the USB audio kernel modules in the old 'buildroot' environment.
additionally i connected a LCD via a USB2serial converter and display id3 tags of mp3 files from a USB cardreader. this all works with 70% CPU usage (mp3 192Kbits and VBR) on the 'normal' wl500g with 125MHz.

i used very cheap hardware: USB 1 hub (5€), USB audio stereo adapter (9,95€), cardreader (7€)... if someone want to know where to get this in germany i can tell you..

before i reinvent the wheel: is there any project out there that uses an WLAN router as a mobile mp3 player in car-environment, wich can be easily accessed via network neigbourhood?

i've already coded the id3-tag-to-LCD-via_usb2serial into the madplayer and now working on some external buttons..

..i've been absent awhile.. there seems to be some changes here ;-) i will look for the audio wiki

and let me say something to the 'SDK':
great work and many thanks to all developers!
BUT: it was very difficult for me to find a way to successfully build an image and even additional software for the ASUS wl500g (wich is the only device i used openWRT for). it takes time to get familiar with the structure and build processes.

i have a lot of services running on this device for a couple of month and even additional hardware - and no problems so far. even if i use the old 'buildroot'.
but i have issues with the newer stuff. and because i'm familiar with the old one (and it works), i don't know if it makes much sense to write an obsolete Howto...

hehe, you are fast.. there's the wiki.. so let me have a look at it :-)

(Last edited by cyberwulf on 28 Sep 2005, 17:16)

Can you tell me where to find USB audio for 9,95?

i have mine from www.conrad.de in germany. it works great (unless it seems to only support 48K sampling rate ;-) )

the usb headset from a friend of mine is working too.

a picture of my router with USB hardware can be found here

great :-)
you say, mpd is the only available audio application (through packages).
let me mention that madplay works too and i can host a package for that if anyone likes (and traffic is not too immense)

With madplay you can even play streams with the script found in the linked post. 

http://wl500g.info/showpost.php?p=12136 … stcount=21

It needs just a little change regarding netcat. This should be replaced with busybox's nc.

There's also a madplay binary linked, but an openwrt-packages would be definitively better!


The uclinux-branch of mpd doesn't seem to be able to play streams, unfortunately.

Madplay sounds like a good candidate for an official package, have you integraded it into buildroot or built the package by hand? Buildroot is not too hard and I'm confident the package would be accepted if you wish to give it a crack (though you might be best waiting for libmad (see below)).

Regarding the uclinux branch of mpd: As it happens, there is no need to use this branch as wrt hardware has an mmu. I discovered this after initially getting confused between uclinux and uclibc (doh!). I decided to stick with the uclinux branch as it has libmad, vorbis (tremor) and flac all included in the source tree which is very convienient. I intend to split these out now though to pave the way for more packages to link against them (there is already libogg/libvorbis in CVS now for icecast) so you can expect the mpd package to switch to the official releases some time. It will hopefully work better.

Dave

Hi Dave, I already tried to build the official mpd a few weeks ago but I failed.  I hope you are more successful than me, then there would be no more need for madplay at least for me.

i've packed madplay with libmad (and libid3tag) in a package by hand - even if i build it within the full buildroot environment ;-)

it needs libgcc and libz to run.

you can download it for testing purposes here

(Last edited by cyberwulf on 7 Oct 2005, 18:15)

Hi All,
I have created packages for libFLAC, libmad, libvorbisidec (tremor), and a new mpd package from the main branch which is build against these new libs. It all seems to work very nicely. I've integrated these packages into buildroot and will submit them to the devs shortly.

In the meantime you can find them here:
http://users.tpg.com.au/davico/openwrt/packages/

You also need the existing libid3tag package, I've put it at the above location for convienience since it is not in whiterussian.

I havent tested mpd with streams yet, it should work though. Let me know if you have any problems.

Dave

Hi Dave, thank you very much for your work! Now I don't have to use madplay for playing streams anymore.

What client are you using?
With both mpc and gmpc I always get an error message like:

 error: error parsing version number at "0"

phpMp2 works.

I am using the gmpc package in ubuntu, it is version 0.11.2.
My mpd package is based on the subversion repository, not the stable release, so that could explain your version error (though my gmpc works...). The reason I used subversion was because it has native oss output rather than libao and I couldnt be bothered packaging libao.

phpmp[2] would be nice to have in openwrt also, I tried using it with lighthttp/php4-fastcgi packages but it chewed up too much ram and caused playback problems in mpd. I could use one or the other but not both! My new mpd package seems to use a LOT less memory though, so I might try again and maby whip up a package for that too.

Dave

Actually, I spoke too soon.
I was actually using an mpd I built before I packaged it all up. During the packaging, I added "-dave" to the version string to try and prevent any confusion that this was actually an official 0.12.0 release. That is almost certainly the cause of your problem...

I'll fix it up and upload some new packages now.

ok, I've stuck a fixed mpd package up now, the others are the same

Dave, the new packages works perfectly. Thanks again!

The discussion might have continued from here.