OpenWrt Forum Archive

Topic: USB audio device not detected

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

I have an audio usb device which is not being recognized on my NSLU2 with openWrt trunk, r15407.  Nothing is reported about it by "dmesg | tail" or "lsusb".  When I plug it into a ubuntu PC I get the following results from those commands.

$ dmesg | tail -n 5
[190609.552038] usb 2-2: new full speed USB device using uhci_hcd and address 6
[190609.712954] usb 2-2: configuration #1 chosen from 1 choice
[190609.722321] input: C-Media USB Headphone Set   as /devices/pci0000:00/0000:00:1d.1/usb2/2-2/2-2:1.3/input/input8
[190609.761649] input,hidraw2: USB HID v1.00 Device [C-Media USB Headphone Set  ] on usb-0000:00:1d.1-2
[190610.057649] usbcore: registered new interface driver snd-usb-audio
$ lsusb
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 006: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 046d:c513 Logitech, Inc. MX3000 Cordless Desktop Receiver
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

I think I have the relevant sound and usb modules installed.  I assume it would be detected at boot time or at insertion by "hotplug".  I don't know anything about how this should work, but "/etc/hotplug.d/usb" is a stub with no active content. 

I looked in the kamikaze documentation here -- http://kamikaze.openwrt.org/docs/openwr … 340001.3.1   Unfortunately the section "1.3.1 Hotplug" is empty.  Where do I find information about hotplug and how to go about detecting and connecting to this usb device?

lizby wrote:
Bus 002 Device 006: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter

It's there.

- Directly connected to the routers USB port or via a USB HUB (if HUB, active one?)

(Last edited by Yanira on 28 Apr 2009, 18:40)

>It's there

The lsusb output quoted is from a ubuntu PC.  With a new flash of the stock 8.09 firmware onto the NSLU2, r14511, as released, lsusb shows it as it shows on the ubuntu system.  But it still is not allocated to a device--dmesg | tail shows the following:

usb 1-1: new full speed USB device using ohci_hcd and address 3
usb 1-1: configuration #1 chosen from 1 choice

The device is found but not assigned to something like /dev/dsp1.  lsmod | grep audio shows this:

snd_usb_audio          49920  0
snd_usb_lib            10112  1 snd_usb_audio
snd_pcm                45480  2 snd_usb_audio,snd_pcm_oss
snd_hwdep               3844  1 snd_usb_audio
snd                    28308  8 snd_usb_audio,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer,snd_rawmidi,snd_seq_device,snd_hwdep
usbcore                84468  4 snd_usb_audio,snd_usb_lib,ohci_hcd

What am I missing?

Also, what is the chance of the empty section "1.3.1 Hotplug" --  in the kamikaze documentation here -- http://kamikaze.openwrt.org/docs/openwr … 340001.3.1 -- being filled in?  Is there information available on the use of hotplug in Kamikaze?

(Last edited by lizby on 1 May 2009, 21:24)

Ahy help with this?  I plugged in a Behringer UCA202 usb sound device, known to work with openWrt on a bifferboard.  lsusb reports it as follows, "Bus 001 Device 004 ID 08bb:9202 Texas Instruments Japan", but "dmesg | tail" reports only

usb 1-1: new full speed USB device using uhci_hcd and address 4
usb 1-1: configuration #1 chosen from 1 choice

No /dev/audio0 is created.

This is a new checkout of trunk, r16007.  This is lsmod:

Module                  Size  Used by    Not tainted
uhci_hcd               18252  0 
pl2303                 11300  0 
ftdi_sio               26024  0 
ark3116                 8836  0 
videodev               23392  0 
compat_ioctl32           384  0 
v4l1_compat            12100  1 videodev
v4l2_common             7040  0 
usb_storage            58759  0 
usbserial              20208  3 pl2303,ftdi_sio,ark3116
snd_usb_audio          49920  0 
snd_usb_lib            10112  1 snd_usb_audio
ehci_hcd               29740  0 
ohci_hcd               14884  0 
nf_nat_tftp              448  0 
nf_conntrack_tftp       2408  1 nf_nat_tftp
nf_nat_irc               736  0 
nf_conntrack_irc        2548  1 nf_nat_irc
nf_nat_ftp              1216  0 
nf_conntrack_ftp        4544  1 nf_nat_ftp
ipt_MASQUERADE           992  1 
iptable_nat             2408  1 
nf_nat                  8886  5 nf_nat_tftp,nf_nat_irc,nf_nat_ftp,ipt_MASQUERADE,iptable_nat
xt_state                 800  6 
nf_conntrack_ipv4       7308  9 iptable_nat,nf_nat
nf_conntrack           31832  11 nf_nat_tftp,nf_conntrack_tftp,nf_nat_irc,nf_conntrack_irc,nf_nat_ftp,nf_conntrack_ftp,ipt_MASQUERADE,iptable_nat,nf_nat,xt_state,nf_conntrack_ipv4
sd_mod                 15344  0 
ipt_REJECT              1504  2 
xt_TCPMSS               1760  1 
ipt_LOG                 3936  0 
xt_multiport            1824  0 
xt_mac                   672  0 
xt_limit                 960  1 
iptable_mangle          1120  0 
iptable_filter           928  1 
ip_tables               7024  3 iptable_nat,iptable_mangle,iptable_filter
xt_tcpudp               1760  3 
x_tables                6660  11 ipt_MASQUERADE,iptable_nat,xt_state,ipt_REJECT,xt_TCPMSS,ipt_LOG,xt_multiport,xt_mac,xt_limit,ip_tables,xt_tcpudp
snd_pcm_oss            30752  0 
snd_mixer_oss          10784  1 snd_pcm_oss
snd_pcm                45480  2 snd_usb_audio,snd_pcm_oss
snd_timer              12932  1 snd_pcm
snd_rawmidi            12352  1 snd_usb_lib
snd_seq_device          3272  1 snd_rawmidi
snd_hwdep               3844  1 snd_usb_audio
snd_page_alloc          4264  1 snd_pcm
snd                    28308  8 snd_usb_audio,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer,snd_rawmidi,snd_seq_device,snd_hwdep
soundcore               2852  1 snd
ppp_async               5696  0 
ppp_generic            16116  1 ppp_async
slhc                    3776  1 ppp_generic
crc_ccitt                960  1 ppp_async
vfat                    7136  0 
fat                    35388  1 vfat
ext3                   84740  0 
jbd                    27444  1 ext3
ext2                   40740  0 
nls_iso8859_1           2848  0 
nls_cp437               4384  0 
usbcore                84468  11 uhci_hcd,pl2303,ftdi_sio,ark3116,usb_storage,usbserial,snd_usb_audio,snd_usb_lib,ehci_hcd,ohci_hcd
scsi_mod               59712  2 usb_storage,sd_mod
nls_base                4096  4 vfat,fat,nls_iso8859_1,nls_cp437

Any advice on getting this audio device or the one in the original post to work would be appreciated.

That kinda looks like snd_usb_audio doesn't recognize the device. Which would be strange. Could you provide full dmesg for both the working bifferboard + the nslu2?

Can you plug a usb serial device or usb drive into the nslu2 and have it recognized?

Also, you should be looking for /dev/snd/* or /dev/dsp*

Unfortunately the bifferboard on which the audio device was reported to work was not mine.  It was reported here:

http://tech.groups.yahoo.com/group/biff … message/20
(Note: above link requires a yahoo signon)
(Above poster installed: kmod-usb-audio, kmod-usb-core, kmod-sound-core, alsa-utils--I have those)

Here is the dmesg output.  USB storage and USB serial work.  I have put comments in near the end of this listing where I plugged in those devices and they were recognized, and also where I plugged in the usb sound device and it wasn't given a device.

Linux version 2.6.26.6 (lance@Ubun1) (gcc version 4.1.2) #4 Fri May 22 23:47:44 EDT 2009
CPU: XScale-IXP42x Family [690541f1] revision 1 (ARMv5TE), cr=000039ff
Machine: Linksys NSLU2
Memory policy: ECC disabled, Data cache writeback
On node 0 totalpages: 8192
  DMA zone: 64 pages used for memmap
  DMA zone: 0 pages reserved
  DMA zone: 8128 pages, LIFO batch:0
  Normal zone: 0 pages used for memmap
  Movable zone: 0 pages used for memmap
CPU0: D VIVT undefined 5 cache
CPU0: I cache: 32768 bytes, associativity 32, 32 byte lines, 32 sets
CPU0: D cache: 32768 bytes, associativity 32, 32 byte lines, 32 sets
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
Kernel command line: root=/dev/mtdblock4 rootfstype=squashfs,jffs2 console=ttyS0,115200 init=/etc/preinit noinitrd
PID hash table entries: 128 (order: 7, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 32MB = 32MB total
Memory: 30404KB available (1780K code, 169K data, 92K init)
SLUB: Genslabs=12, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Calibrating delay loop... 266.24 BogoMIPS (lpj=1331200)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 480 bytes
NET: Registered protocol family 16
IXP4xx: Using 16MiB expansion bus window size
NSLU2: Using MAC address 00:04:5a:0f:e0:f5 for port 0
PCI: IXP4xx is host
PCI: IXP4xx Using direct access for memory space
PCI: bus0: Fast back to back transfers disabled
dmabounce: registered device 0000:00:01.0 on pci bus
dmabounce: registered device 0000:00:01.1 on pci bus
dmabounce: registered device 0000:00:01.2 on pci bus
NET: Registered protocol family 2
Switched to high resolution mode on CPU 0
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
NET: Registered protocol family 1
IXP4xx Queue Manager initialized.
squashfs: version 3.0 (2006/03/15) Phillip Lougher
Registering mini_fo version $Id$
JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
msgmni has been set to 59
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xc8000000 (irq = 15) is a XScale
console [ttyS0] enabled
serial8250.0: ttyS1 at MMIO 0xc8001000 (irq = 13) is a XScale
eth0: MII PHY 1 on NPE-B
IXP4XX-Flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
IXP4XX-Flash.0: Found an alias at 0x800000 for the chip at 0x0
 Intel/Sharp Extended Query Table at 0x0031
Using buffer write method
cfi_cmdset_0001: Erase suspend on write enabled
erase region 0: offset=0x0,size=0x20000,blocks=64
Searching for RedBoot partition table in IXP4XX-Flash.0 at offset 0x7e0000
6 RedBoot partitions found on MTD device IXP4XX-Flash.0
Creating 6 MTD partitions on "IXP4XX-Flash.0":
0x00000000-0x00040000 : "RedBoot"
0x00040000-0x00060000 : "SysConf"
0x00060000-0x00080000 : "Loader"
0x00080000-0x00180000 : "Kernel"
0x00180000-0x007e0000 : "rootfs"
mtd: partition "rootfs" set to be root filesystem
mtd: partition "rootfs_data" created automatically, ofs=400000, len=3E0000 
0x00400000-0x007e0000 : "rootfs_data"
0x007e0000-0x00800000 : "FIS directory"
i2c /dev entries driver
rtc-x1205 0-006f: chip found, driver version 1.0.8
rtc-x1205 0-006f: rtc core: registered rtc-x1205 as rtc0
i2c-gpio i2c-gpio.0: using pins 7 (SDA) and 6 (SCL)
IXP4xx Watchdog Timer: heartbeat 60 sec
Registered led device: nslu2:green:ready
Registered led device: nslu2:red:status
Registered led device: nslu2:green:disk-1
Registered led device: nslu2:green:disk-2
TCP westwood registered
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
XScale DSP coprocessor detected.
rtc-x1205 0-006f: setting system clock to 2009-05-25 01:03:53 UTC (1243213433)
VFS: Mounted root (squashfs filesystem) readonly.
Freeing init memory: 92K
Please be patient, while OpenWrt loads ...
mini_fo: using base directory: /
mini_fo: using storage directory: /jffs
firmware: requesting NPE-B
NPE-B: firmware's license can be found in /usr/share/doc/LICENSE.IPL
NPE-B: firmware functionality 0x2, revision 0x2:1
eth0: link down
br-lan: Dropping NETIF_F_UFO since no NETIF_F_HW_CSUM feature.
device eth0 entered promiscuous mode
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
PPP generic driver version 2.4.2
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
br-lan: port 1(eth0) entering learning state
br-lan: topology change detected, propagating
br-lan: port 1(eth0) entering forwarding state
ip_tables: (C) 2000-2006 Netfilter Core Team
Driver 'sd' needs updating - please use bus_type methods
nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
ohci_hcd: 2006 August 04 USB 1.1 'Open' Host Controller (OHCI) Driver
PCI: enabling device 0000:00:01.0 (0140 -> 0142)
ohci_hcd 0000:00:01.0: OHCI Host Controller
ohci_hcd 0000:00:01.0: new USB bus registered, assigned bus number 1
ohci_hcd 0000:00:01.0: irq 28, io mem 0x48000000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 3 ports detected
PCI: enabling device 0000:00:01.1 (0140 -> 0142)
ohci_hcd 0000:00:01.1: OHCI Host Controller
ohci_hcd 0000:00:01.1: new USB bus registered, assigned bus number 2
ohci_hcd 0000:00:01.1: irq 27, io mem 0x48001000
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 2 ports detected
USB Universal Host Controller Interface driver v3.0
PCI: enabling device 0000:00:01.2 (0140 -> 0142)
ehci_hcd 0000:00:01.2: EHCI Host Controller
ehci_hcd 0000:00:01.2: new USB bus registered, assigned bus number 3
ehci_hcd 0000:00:01.2: irq 26, io mem 0x48002000
ehci_hcd 0000:00:01.2: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
usb usb3: configuration #1 chosen from 1 choice
hub 3-0:1.0: USB hub found
hub 3-0:1.0: 5 ports detected
usbcore: registered new interface driver snd-usb-audio
usbcore: registered new interface driver usbserial
usbserial: USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
Linux video capture interface: v2.00
usbserial: USB Serial support registered for ark3116
usbcore: registered new interface driver ark3116
usbserial: USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver ftdi_sio
ftdi_sio: v1.4.3:USB FTDI Serial Converters Driver
usbserial: USB Serial support registered for pl2303
usbcore: registered new interface driver pl2303
pl2303: Prolific PL2303 USB to serial adaptor driver
[---------- Here is where I plugged in the USB thumb drive--recognized fine ----]
usb 3-2: new high speed USB device using ehci_hcd and address 2
usb 3-2: configuration #1 chosen from 1 choice
scsi0 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 2
usb-storage: waiting for device to settle before scanning
scsi 0:0:0:0: Direct-Access     Kingston DataTraveler 2.0 1.00 PQ: 0 ANSI: 2
sd 0:0:0:0: [sda] 7847936 512-byte hardware sectors (4018 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 23 00 00 00
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] 7847936 512-byte hardware sectors (4018 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 23 00 00 00
sd 0:0:0:0: [sda] Assuming drive cache: write through
 sda: sda1 sda2 sda3
sd 0:0:0:0: [sda] Attached SCSI removable disk
usb-storage: device scan complete
usb 3-2: USB disconnect, address 2
[---------- Here is where I plugged in the pl2303 serial cable--recognized fine ----]
usb 2-1: new full speed USB device using ohci_hcd and address 2
usb 2-1: configuration #1 chosen from 1 choice
pl2303 2-1:1.0: pl2303 converter detected
usb 2-1: pl2303 converter now attached to ttyUSB0
usb 2-1: USB disconnect, address 2
pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0
pl2303 2-1:1.0: device disconnected
[---------- Here is where I plugged in the audio device--no joy ----]
usb 2-1: new full speed USB device using ohci_hcd and address 3
usb 2-1: configuration #1 chosen from 1 choice
usb 2-1: USB disconnect, address 3

I started over from scratch with kamikaze 8.09, r14511 from February.  I installed the following:

opkg install kmod-usb-ohci [kmod-usb-core was installed with this]
opkg install kmod-usb-audio [kmod-sound-core was installed with this]
opkg install kmod-usb2

This is the last of the output from "dmesg | tail"

hub 3-0:1.0: USB hub found
hub 3-0:1.0: 5 ports detected
usbcore: registered new interface driver snd-usb-audio
usb 2-1: new full speed USB device using ohci_hcd and address 2
usb 2-1: configuration #1 chosen from 1 choice

This is the output from lsusb

Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

What is missing?  What is supposed to be detccting the usb device and associating it with, for instance, /dev/dsp1 (as happens when the device is plugged into a Ubuntu PC)?  Any help would be much appreciated.

(Last edited by lizby on 27 May 2009, 03:49)

(lizby asked for details of my working setup)

My WGT634U works fine with a C-Media USB Audio dongle, but I'm running a slightly-old version:

# grep KAMI /etc/banner
 KAMIKAZE (bleeding edge, r8480) -------------------

# uname -r
2.6.22.4

[ sorry, I don't have "lsusb" ]
[ portion of /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

[ syslog when starting /usr/bin/mpd ]
Apr 25 23:45:47 music user.info : No "audio_output" defined in config file
Apr 25 23:45:47 music user.info : Attempt to detect audio output device
Apr 25 23:45:47 music user.info : Attempting to detect a alsa audio device
Apr 25 23:45:47 music user.info : ALSA lib pcm.c:2014:(snd_pcm_open_conf) Invalid type for PCM default definition (id: default, value:cards.pcm.default)
Apr 25 23:45:47 music user.info : Error opening default alsa device: Invalid argument
Apr 25 23:45:47 music user.info : Attempting to detect a oss audio device
Apr 25 23:45:47 music user.info : Successfully detected a oss audio device

# lsmod | egrep 'snd|audio|usb'
usb_storage            27664  0
scsi_mod               72160  2 usb_storage,sd_mod
snd_usb_audio          56672  1
snd_usb_lib            11904  1 snd_usb_audio
ehci_hcd               28016  0
uhci_hcd               19728  0
ohci_hcd               14064  0
snd_pcm_oss            40000  0
snd_mixer_oss          13728  2 snd_pcm_oss
snd_pcm                56704  2 snd_usb_audio,snd_pcm_oss
snd_timer              15952  1 snd_pcm
snd_rawmidi            15840  1 snd_usb_lib
snd_hwdep               4784  1 snd_usb_audio
snd_page_alloc          5104  1 snd_pcm
snd                    35344  7 snd_usb_audio,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer,snd_rawmidi,snd_hwdep
soundcore               3664  2 snd
usbcore               102032  7 usb_storage,snd_usb_audio,snd_usb_lib,ehci_hcd,uhci_hcd,ohci_hcd

I have no idea if this will help, but there you have it.

-All is working now.  By accident, so I don't know which piece filled in the puzzle (by the way, thank you whbjr--I got it working before I saw your post, but I didn't know about "cat /proc/bus/usb/devices").

After my last post I wanted to move a file to the device, so I turned on usb storage with:

opkg install kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 kmod-usb-storage

When I rebooted, I noticed a green light on the sound device.  I tried "madplay Bugaloo.mp3", and it worked.  Weenie Campbell country blues internet radio also worked with:

wget -O -  http://lax1.loudcity.fast-serv.com:80/2122.64.live.mp3 | madplay -

All four of the sound devices pictured here worked:  http://i42.tinypic.com/1o6ao6.jpg

I'm not sure which module installed with opkg above did the trick, but I will try to reinstall later adding one by one.

No /dev/dsp0 device was created, is it was on a Ubuntu PC.  How would I determine the device name?  I tried "ls /dev" outputting to a file before and after plugging in the device.  diff showed only these two lines added, but I don't know what they mean:

+usbdev2.4_ep00
+usbdev2.4_ep85

But I'm happy now, and ready to move on to wireless USB on the NSLU2 (again).

The discussion might have continued from here.