Skip to contentSkip to conversation

Problems or bugs in snd-usb-audio.ko

DISCUSSION Smery 3 participants 3 messages Aug 31, 2005 – Sep 1, 2005

lore
Share & tools
lore

Smery

author
#0 lore raw

Hello,
I have an USB 2.0 device with one Audio Class interface.
snd_snd-usb_audio.ko detects it and register the corresponding card. But there seems to be some problems with in snd-usb-audio module when reading from this device, (while another USB 1.1 device work fine).

My kernel version is: 2.6.12-1.1372_FC3 (I also tried many other kernels)

I would really appreciate any help! It's very important to get this card working! I can code/debug everything you want to try.

Just let me know as soon as possible. Below is the issue in detail.

$ amixer -c 1 contents
numid=1,iface=MIXER,name='Mic Capture Switch'
  ; type=BOOLEAN,access=rw---,values=1
  : values=on
numid=2,iface=MIXER,name='Mic Capture Volume'
  ; type=INTEGER,access=rw---,values=1,min=0,max=3,step=0
  : values=0
$ arecord -l
  card 1: default [USB 2.0 Video ], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
$ amixer -c 1 cset numid=2 3
numid=2,iface=MIXER,name='Mic Capture Volume'
  ; type=INTEGER,access=rw---,values=1,min=0,max=3,step=0
  : values=3

When recording, it seems there are I/O problems:

$ arecord -d 10 -D hw:1,0 foobar.wav
Recording WAVE 'foobar.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono
arecord: pcm_read:1196: read error: Input/output error

And the file is 44 bytes (just the header):

$ls -l foobar.wav
-rw-r--r-- 1 luca luca 44 31 ago 19:12 foobar.wav

$ file foobar.wav
foobar.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 8 bit, mono 8000 Hz

Below is the Interface Descriptor:
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 1 Audio
bInterfaceSubClass 1 Control Device
bInterfaceProtocol 0
iInterface 0
AudioControl Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 1 (HEADER)
bcdADC 1.00
wTotalLength 38
bInCollection 1
baInterfaceNr( 0) 2
AudioControl Interface Descriptor:
bLength 12
bDescriptorType 36
bDescriptorSubtype 2 (INPUT_TERMINAL)
bTerminalID 1
wTerminalType 0x0201 Microphone
bAssocTerminal 0
bNrChannels 1
wChannelConfig 0x0000
iChannelNames 0
iTerminal 0
AudioControl Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 3 (OUTPUT_TERMINAL)
bTerminalID 2
wTerminalType 0x0101 USB Streaming
bAssocTerminal 0
bSourceID 3
iTerminal 0
AudioControl Interface Descriptor:
bLength 8
bDescriptorType 36
bDescriptorSubtype 6 (FEATURE_UNIT)
bUnitID 3
bSourceID 1
bControlSize 1
bmaControls( 0) 0x03
Mute
Volume
iFeature 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 2
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x84 EP 4 IN
bmAttributes 1
Transfer Type Isochronous
Synch Type none
Usage Type Data
wMaxPacketSize 0x0000 bytes 0 once
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 2
bAlternateSetting 1
bNumEndpoints 1
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 0
iInterface 0
AudioControl Interface Descriptor:
bLength 7
bDescriptorType 36
bDescriptorSubtype 1 (AS_GENERAL)
bTerminalLink 2
bDelay 1 frames
wFormatTag 2 PCM8
AudioControl Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 2 (FORMAT_TYPE)
bFormatType 1 (FORMAT_TYPE_I)
bNrChannels 1
bSubframeSize 1
bBitResolution 8
bSamFreqType 1 Discrete
tSamFreq[ 0] 8000
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x84 EP 4 IN
bmAttributes 1
Transfer Type Isochronous
Synch Type none
Usage Type Data
wMaxPacketSize 0x0009 bytes 9 once
bInterval 4
AudioControl Endpoint Descriptor:
bLength 7
bDescriptorType 37
bDescriptorSubtype 1 (EP_GENERAL)
bmAttributes 0x00
bLockDelayUnits 0 Undefined
wLockDelay 0 Undefined

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

#1 lore raw
Quoted 9 lines · Smery

When recording, it seems there are I/O problems:

$ arecord -d 10 -D hw:1,0 foobar.wav
Recording WAVE 'foobar.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono
arecord: pcm_read:1196: read error: Input/output error

And the file is 44 bytes (just the header):

$ls -l foobar.wav
-rw-r--r-- 1 luca luca 44 31 ago 19:12 foobar.wav

Because your device probably doesn'y support 8 bit mono at 8000Hz, which is the default format of arecord. Use -D plughw:1,0 or specify a format your device supports.

Lee

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

#2 lore raw
Quoted 7 lines · Smery
Quoted 6 lines

I have an USB 2.0 device with one Audio Class interface. snd_snd-usb_audio.ko detects it and register the corresponding card. But there seems to be some problems with in snd-usb-audio module when reading from this device, (while another USB 1.1 device work fine).

My kernel version is: 2.6.12-1.1372_FC3 (I also tried many other kernels)

Please make sure you're using 2.6.13 and the latest ALSA (1.0.10rc1).

Quoted 2 lines · Lee Revell

Because your device probably doesn'y support 8 bit mono at 8000Hz, which is the default format of arecord.

As it happens, this is the only format supported by this device. arecord would have complained if the format wasn't supported.

HTH
Clemens

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf