OpenWrt Forum Archive

Topic: K7.09 + ASUS WL-500gP - USB No Sound

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

I am trying to create a music player and have done the following so far:

1. Flashed with K7.09
2. Intalled ipkg wl
3. Installed USB 1.1 support ipkg kmod-usb-uhci, usbutils
4. Installed audio support ipkg-s
    kmod-usb-audio
    kmod-soundcore
    kmod-alsa
    sox
    alsa-utils
    libltdl
5. Installed mpd and modified mpd.conf
6. Followed http://sokrates.mimuw.edu.pl/~sebek/openwrt/ instructions and created the file /etc/modules.d/72-snd-usb-audio

Rebooted

a. dmesg showed that my soundcard is detected
b. usbutils showed the card
c. dsp, mixer and mixer1 are created in /dev/sound
d. lsmod shows that all the modules defined in 72-snd-usb-audio are loaded

Created the mpd database with mpd --create-db and started mpd. My mpd client machine is a Vista box running BJJ. It connects to mpd, shows all the files and I can play a song. BJJ shows that song is playing.

The light where my headphone is connected on the USB card starts blinking, it was solid before. I follow BJJ to the end of the song and then the light stops blinking.

But here's the bottomline - NO sound!

The USB soundcard tests ok on Windows machines with good sound, so that's working. The headphone is the one that I use all the time, so that's working too and even tested with the same soundcard.

I'm at a loss and don't know how to debug this problem. Please help!

Thanks much!

(Last edited by confused2008 on 17 Feb 2008, 06:42)

can you post the relevant parts from dmesg and your mpd.conf?

have you turned up the volume in BJJ?

doublecheck that your headphone and USB-card is working on windows

Works perfect on my ASUS WL-500G Premium. Though, I can only speak for latest trunk and 2.6 Kernel without wireless (brcm47xx target).

I installed USB2 support then kmod-sound-core, kmod-usb-audio and mpd. I changed /etc/mpd.conf to my needs and started mpd the first time with --create-db then with --no-create-db. I not used the init script.

Then installed gmpc and connected to my router an I could play and listen smile

I'm using a Terratec AUREON 5.1 USB MKII sound card.

uibi, yes the USB card and headphones checked out ok once again on my Vista box.

forum2008, unfortunately I'll have to stay with 2.4 since I need wireless capabilities.

dmesg
-------

...
Linux version 2.4.34 (nbd@ds10) (gcc version 3.4.6 (OpenWrt-2.0)) #3 Sun Sep 30 20:33:21 CEST 2007
...
usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
...
usb-uhci.c: $Revision: 1.275 $ time 08:58:50 Sep 29 2007
usb-uhci.c: High bandwidth mode enabled
PCI: Enabling device 01:03.0 (0000 -> 0001)
UHCI: Enabling VIA 6212 workarounds
usb-uhci.c: USB UHCI at I/O 0x100, IRQ 2
usb-uhci.c: Detected 2 ports
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 2 ports detected
PCI: Enabling device 01:03.1 (0000 -> 0001)
UHCI: Enabling VIA 6212 workarounds
usb-uhci.c: USB UHCI at I/O 0x120, IRQ 2
usb-uhci.c: Detected 2 ports
usb.c: new USB bus registered, assigned bus number 2
hub.c: USB hub found
hub.c: 2 ports detected
usb-uhci.c: v1.275:USB Universal Host Controller Interface driver
usb.c: registered new driver audio
audio.c: v1.0.0:USB Audio Class driver
hub.c: new USB device 01:03.0-1, assigned address 2
usbaudio: device 2 audiocontrol interface 0 has 1 input and 1 output AudioStreaming interfaces
usbaudio: device 2 interface 2 altsetting 1 channels 1 framesize 2 configured
usbaudio: valid input sample rate 24000
usbaudio: device 2 interface 2 altsetting 1: format 0x00000010 sratelo 24000 sratehi 24000 attributes 0x00
usbaudio: device 2 interface 1 altsetting 0 does not have an endpoint
usbaudio: device 2 interface 1 altsetting 1 channels 2 framesize 2 configured
usbaudio: valid output sample rate 48000
usbaudio: device 2 interface 1 altsetting 1: format 0x01000010 sratelo 48000 sratehi 48000 attributes 0x00
usbaudio: registered dsp 14,3
usbaudio: constructing mixer for Terminal 3 type 0x0301
usbaudio: registered mixer 14,0
usbaudio: constructing mixer for Terminal 6 type 0x0101
usbaudio: registered mixer 14,16
usb_audio_parsecontrol: usb_audio_state at 81b7b400
usb.c: registered new driver snd-usb-audio


mpd.conf
-----------
################## AUDIO OUTPUT ##########################
# use this if you want to use OSS audio output
audio_output {
        type            "oss"
        name            "USB audio converter"
        device          "/dev/sound/dsp" # optional
#        format          "44100:16:2" #optional
}

################### VOLUME MIXER #########################
# OSS Mixer
mixer_type              "oss"
mixer_device            "/dev/sound/mixer"
mixer_control           "PCM"

(Last edited by confused2008 on 18 Feb 2008, 03:51)

Ok, after messing with a bit, I decided to remove the /etc/modules.d/72-snd-usb-audio file (based on info at http://sokrates.mimuw.edu.pl/~sebek/openwrt/). After rebooting, I'm getting a high pitched monotonous noise whenever I play a song. So some sound finally...

I did not create any extra files. Just installed the kernel packages to add sound and USB support. Edited /etc/mpd.conf and that's it.

Then I can use gmpc on my Ubuntu box and also I can control the volume from Ubuntu.

forum2008, I followed your suggestion and removed all extra packages. So I now have just usb 1.1 support and kernel audio packages. Similar result as before. What kinda' USB sound card do you have?

uibi, I have a cheapo 99c soundcard that I bought on e-bay, maybe that chipset is somehow incompatible. I'm in the US and will have to try and find a vendor for the link you have provided.

I could possibly try out a different USB card (I've seen a lot of postings about C-Media chipsets), other than that I can't thinK of anything else at this time.

Hello,
I have a general question about using usb audio on openwrt so sorry if I "steal" your topic a bit. I've read several thread about installing usb audio card on openwrt but I'm a bit confused about how to use it. If I understand correctly, I can play audio from a mounted hard disk on the openwrt. Is it also possible to play audio through the network ? for example from a WinXP or another linux host ?

thanks
Tex

Tex-Twil, you could use mpd/madplay to play mp3-streams (look at http://wiki.openwrt.org/UsbAudioHowto )

you could also mount a nfs-share and use it with mpd, i don't know, if this would work with windows-smb too...

uibi wrote:

Tex-Twil, you could use mpd/madplay to play mp3-streams (look at http://wiki.openwrt.org/UsbAudioHowto )

you could also mount a nfs-share and use it with mpd, i don't know, if this would work with windows-smb too...

I've already read this page but I thought that maybe more features can be installed. I was thinking about directly playing music from winamp / amarok, iTunes or whatever through the network on the usb sound card. Something like the Airport from Apple.

cheers,
Tex

Doesn't alsa-utils (which you installed) require alsa-libs (which I don't see mentioned)?

At any rate, I'd see if I could get *anything* to play an actual file through the sound "card."  Specifically, aplay and an actual WAV file, not an MP3.

As I recall, if you have a WAV file, and you can figure out the sound device's path ("lsusb" or some investigating in the /proc/bus/usb directories), you can try "cat filename.wav > /dev/sound_device" and get actual sound.  This is for debugging, not on-going use!

confused2008 wrote:

I could possibly try out a different USB card (I've seen a lot of postings about C-Media chipsets), other than that I can't thinK of anything else at this time.

I've got a C-Media USB dongle, cheap from eBay, which worked the very first time on my Netgear WGT634U, for each of several versions of Kamikaze. Best of luck!

whbjr,

aplay -l : no soundcards found.
Tried playing a wav file by cat mywav.wav > /dev/sound/dsp, the LED blinked but I did not hear anything.

But when I play an mp3, I do hear the monotonous high pitched sound with the LED blinking (for the duration of the song) that I wrote about before. I can also use the volume control on BJJ (mpc) to increase or decrease volume, so at least that part is working! smile

When you bought the sound card on e-bay, did it explicitly tell you it had the C-Media chipset?

(Last edited by confused2008 on 20 Feb 2008, 05:48)

confused2008 wrote:

usbaudio: device 2 audiocontrol interface 0 has 1 input and 1 output AudioStreaming interfaces
usbaudio: device 2 interface 2 altsetting 1 channels 1 framesize 2 configured
usbaudio: valid input sample rate 24000
usbaudio: device 2 interface 2 altsetting 1: format 0x00000010 sratelo 24000 sratehi 24000 attributes 0x00
usbaudio: device 2 interface 1 altsetting 0 does not have an endpoint
usbaudio: device 2 interface 1 altsetting 1 channels 2 framesize 2 configured
usbaudio: valid output sample rate 48000
usbaudio: device 2 interface 1 altsetting 1: format 0x01000010 sratelo 48000 sratehi 48000 attributes 0x00

So your audio card only supports 24KHz and 48KHz sampling rates.  That's a pretty common restriction, sadly.  That doesn't make it unusable, tho.

mpd.conf
-----------
################## AUDIO OUTPUT ##########################
# use this if you want to use OSS audio output
audio_output {
        type            "oss"
        name            "USB audio converter"
        device          "/dev/sound/dsp" # optional
#        format          "44100:16:2" #optional
}

Here, you'll need to tell MPD that only 48KHz can be used.  I.e. uncomment the `format' line and replace 44100 by 48000.  This should fix your problem.  It will ask MPD to resample your music to 48KHz on the fly (when needed).  Problem is that this resampling will most likely either be done poorly (resulting in metallic sound artifacts especially when the music is high-pitched), or will use up a lot of your CPU.  You may want to resample your music offline to 48KHz with a good quality resampler.

Or get a better USB sound card.  Sadly, the supported sample rates are difficult to figure out without plugging the thing into a Linux box.  I currently use an Creative SB! Live 24bit external.

monnier, at this point I'm ready to buy any soundcard that works! Where did you buy your soundcard from, could you please send me a link?

Have spent too much time already trying to get this thing to work.

Thanks much!

Success at last! wink

I upgraded to the 2.6 kernel (thanks forum2008 for the suggestion) and presto everything worked like a charm with just the usb-uhci, usb-audio, sound-core and alsa-utils packages along with mpd and madplay. I've lost wireless...but I can live with that for now. Eventually it'll be there and my plan is to use my wi-fi phone to control the device...dreams.

My el-cheapo soundcard - Tenx Technology Inc, lsusb id 1130:f211, $0.99 from e-bay - is working great (thanks monnier - I adjusted the format to match my soundcard's capabilities and yes I should buy a nice one when I have some money).

Once again, thanks everyone for their suggestions - you guys are too cool!

(Last edited by confused2008 on 21 Feb 2008, 03:46)

Glad to report success on the 2.4 kernel as well, based on the earlier findings on the 2.6 kernel. Not having wireless was kinda' bugging me! wink

So here's my general process (Asus WL-500gP, Tenx Tech USB Audio)
---------------------------------------------------------------------------------
USB:
kmod-usb-uhci, usbutils

Audio:
kmod-usb-audio, kmod-sound-core, alsa-utils
kmod-alsa (2.4 only)

Apps:
mpd, madplay

Config:
Nothing in 2.6, it just works!
In 2.4 remove /etc/modules.d/60-usb-audio
Adjust mpd.conf to use the correct device, format and mixer-device

dmesg:
Should not show the creation of dsp, mixer etc.

/dev/snd/ will show:
controlC0
pcmC0D0c
pcmC0D0p
timer

Well, hopefully this helps anybody in my situation.

confused2008 wrote:

uibi, I have a cheapo 99c soundcard that I bought on e-bay, maybe that chipset is somehow incompatible. I'm in the US and will have to try and find a vendor for the link you have provided.

I could possibly try out a different USB card (I've seen a lot of postings about C-Media chipsets), other than that I can't thinK of anything else at this time.

just for the record: the speedlink soundcard i mentioned has also a C-Media chipset

I'm glad that you sound works now.

confused2008 wrote:

In 2.4 remove /etc/modules.d/60-usb-audio
dmesg:
Should not show the creation of dsp, mixer etc.

/dev/snd/ will show:
controlC0
pcmC0D0c
pcmC0D0p
timer

Well, hopefully this helps anybody in my situation.

Great!
I comment out audio from 60-usb-audio, it works for my also 0.99$ ebay sound card. Thanks.
It's bit misleading for audio.o in kmod-alsa section in audio how-to. audio.o is from kmod-usb-audio, OSS driver, not kmod-alsa.

Moved this line from alsa to OSS section in audio how-to.
" . This adds the standard kernel module audio.o which provides OSS sound support."

(Last edited by Fall on 26 Feb 2008, 11:32)

(Slow response, sorry!)

Reading between the lines, it looks like one question people have is, "How do I know if a dongle is going to have the C-Media chipset?"  It looks like one big clue is the term "3D" in the description:

USB 2.0 3D Sound 5.1 Card U01
USB 5.1 CHANNEL EXTERNAL SOUND AUDIO 3D CARD ADAPTER
USB 2.0 TO 3D AUDIO SOUND CARD ADAPTER VIRTUAL 5.1 SC16

So, here's how I look for them: eBay Search: USB 3D (sound,audio)
- Pay attention to the item's location - some electronics sellers are in Honk Kong - I prefer them closer to my home :-)
- There's at least one seller who's got them for $0.99 + $2.75 shipping - a bargain!

I hope this helps!

whbjr, if the product is not advrtised as having a C-Media chipset, the only way to find what it has is by running lsusb *after* you buy it! The links in your post show products that most likely do *not* have the C-Media chipset, irrespective of where they originate and whether the description has a "3D" label. I bought a similar one and had to go through the hoops to get it to work.

(Last edited by confused2008 on 27 Feb 2008, 15:51)

Well, then perhaps I was lucky (good luck, bad luck... you decide). I got a generically-exact one of those dongles, same "3D SOUND" label, same jacks, same LED, all that... and mine is:

# cat /proc/bus/usb/devices
...
T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  4 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0d8c ProdID=000c Rev= 1.00
S:  Product=C-Media USB Headphone Set

Hi!

I tried mpd on my Asus WL-500Gp under 2.4 and 2.6 systems too. On 2.4 system i installed kmod-sound-core, and kmod-alsa, kmod-usb-audio not. Alsamixer started, and works, controls volume, etc. Mpd only works, if in mpd.conf file every three audio_ouput section remains commented. If i uncomment any of the two alsa section, the following error occured:

couldn't find audio output plugin for type "alsa" at line xx

If i uncomment the oss section, mpd starts without errors, i can edit playlists, etc., but can't play sounds.

On 2.6 system with only kmod-sound-core (kmod-alsa don't exists under 2.6), mpd never works. Alsamixer can't starts, following error occured:

function snd_ctl_open failed for default: No such device

Mpd with default mpd.conf, every three audio_output commented, don't starts, following error:

No audio_output specified and unable to detect a default audio output device

With any alsa output uncommented:

couldn't find audio output plugin for type "alsa" at line 88

With oss output, mpd started, but don't plays any sound, i can edit playlists, like on 2.4 system. Mpd only works under 2.6, if i installed kmod-usb-audio package too (which needs only oss support, described in: http://wiki.openwrt.org/UsbAudioHowto ) and in mpd.conf file oss section uncommented.

I'm totally confused... How can i detect, which output used by mpd on 2.4 system, alsa or oss (emulation?)? Somebody can explain me how this works? Why can't use alsa output in the mpd.conf, under 2.4 and 2.6 too?

Thanks!

whbjr wrote:

(Slow response, sorry!)

Reading between the lines, it looks like one question people have is, "How do I know if a dongle is going to have the C-Media chipset?"  It looks like one big clue is the term "3D" in the description:

USB 2.0 3D Sound 5.1 Card U01
USB 5.1 CHANNEL EXTERNAL SOUND AUDIO 3D CARD ADAPTER
USB 2.0 TO 3D AUDIO SOUND CARD ADAPTER VIRTUAL 5.1 SC16

So, here's how I look for them: eBay Search: USB 3D (sound,audio)
- Pay attention to the item's location - some electronics sellers are in Honk Kong - I prefer them closer to my home :-)
- There's at least one seller who's got them for $0.99 + $2.75 shipping - a bargain!

I hope this helps!

Have anyone know how sampling rate is allowed at microphone input of USB 2.0 TO 3D AUDIO SOUND CARD ADAPTER VIRTUAL 5.1 SC16 PD552 device?

I have tried it on my asus WL-500gp and I get 24kHz mono sampling rate but if I tried it on my desktop PC I get the 192kHz stereo.

The discussion might have continued from here.