# Usb audio/alsa/soundcards Headset Problem [SOLVED]

## HeXiLeD

Problem: USB headset not working but acting like its working.

Before posting this i removed all alsa files from the OS and re-emerged all alsa packages that i will identify bellow and made new configuration files.

Current status:

 4 Sound cards

Audigy on PCI

Intel onboard

Q9000 webcam

Usb headset

 # cat /proc/asound/cards 

```
 0 [Audigy         ]: Audigy - SB Audigy 1 [SB0090]

                      SB Audigy 1 [SB0090] (rev.3, serial:0x511102) at 0xe880, irq 17

 1 [Intel          ]: HDA-Intel - HDA Intel

                      HDA Intel at 0xf9ff8000 irq 22

 2 [Q9000          ]: USB-Audio - QuickCam Pro 9000

                      Logitech, Inc. QuickCam Pro 9000 at usb-0000:00:1d.7-4, high speed

 3 [U0xd8c0x0c     ]: USB-Audio - USB Device 0xd8c:0x0c

                      USB Device 0xd8c:0x0c at usb-0000:00:1a.7-5.3, full speed
```

All cards are working except number 3 which i am not sure if it is or not.

Alsamixer detects them all and is able to play with their options.

# lsusb 

```
Bus 001 Device 005: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter
```

```
# ls /dev/audio

audio   audio1  audio2  audio3
```

```
 # ls /proc/asound/

Audigy  card0  card1  card2  card3  cards  devices  hwdep  Intel  oss  pcm  Q9000  seq  timers  U0xd8c0x0c  version
```

```
 # cat  /proc/asound/version

Advanced Linux Sound Architecture Driver Version 1.0.20.
```

# cat  /proc/asound/devices

```

  0: [ 0]   : control

  1:        : sequencer

  4: [ 0- 0]: hardware dependent

  6: [ 0- 2]: hardware dependent

  8: [ 0- 0]: raw midi

  9: [ 0- 1]: raw midi

 10: [ 0- 2]: raw midi

 11: [ 0- 3]: raw midi

 16: [ 0- 0]: digital audio playback

 18: [ 0- 2]: digital audio playback

 19: [ 0- 3]: digital audio playback

 24: [ 0- 0]: digital audio capture

 25: [ 0- 1]: digital audio capture

 26: [ 0- 2]: digital audio capture

 32: [ 1]   : control

 33:        : timer

 48: [ 1- 0]: digital audio playback

 49: [ 1- 1]: digital audio playback

 56: [ 1- 0]: digital audio capture

 57: [ 1- 1]: digital audio capture

 64: [ 2]   : control

 88: [ 2- 0]: digital audio capture

 96: [ 3]   : control

112: [ 3- 0]: digital audio playback

120: [ 3- 0]: digital audio capture
```

```
# ls  /proc/asound/card3/

id  oss_mixer  usbbus  usbid
```

(note: i made sure alsamixer had everything at maximum volume and turned on)

 # cat   /proc/asound/card3/oss_mixer

```
VOLUME "" 0

BASS "" 0

TREBLE "" 0

SYNTH "" 0

PCM "" 0

SPEAKER "" 0

LINE "" 0

MIC "Mic" 0

CD "" 0

IMIX "" 0

ALTPCM "" 0

RECLEV "" 0

IGAIN "" 0

OGAIN "" 0

LINE1 "" 0

LINE2 "" 0

LINE3 "" 0

DIGITAL1 "" 0

DIGITAL2 "" 0

DIGITAL3 "" 0

PHONEIN "" 0

PHONEOUT "Speaker" 0

VIDEO "" 0

RADIO "" 0

MONITOR "" 0

```

Alsa configs:

# cat /etc/asound.conf 

```
# For info type: cat /proc/asound/cards

# It is recomended that the card name ID is used instead of the device number.

# Help is here @ http://alsa.opensrc.org/FAQ026

pcm.!default {

    type hw

    card Audigy

}

ctl.!default {

    type hw           

    card Audigy
```

#  /etc/alsa/asound.state

Can be seen here

Complied kernel drivers: (none as (module) - all (*) static)

```
<*> Sound card support  --->

     <*>   Advanced Linux Sound Architecture  --->

     <*>   Sequencer support 

     <*>   OSS Mixer API  

     [*]     OSS PCM (digital audio) API - Include plugin system

     [*]   OSS Sequencer API

     <*>   HR-timer backend support

     [*]  Use HR-timer as default sequencer timer

     [*]   PCI sound devices  --->

         [*]   USB sound devices  ---> 

           <*>   USB Audio/MIDI driver 
```

Driver name:  

```
snd-usb-audio
```

As for usbaudio

```
# grep -ri d8c /usr/src/linux/sound/usb/

/usr/src/linux/sound/usb/usbaudio.c:                        (chip->usb_id == USB_ID(0x0d8c, 0x0201) ||

/usr/src/linux/sound/usb/usbaudio.c:                         chip->usb_id == USB_ID(0x0d8c, 0x0102)) &&
```

```
# uname -r

2.6.30.3
```

Full current kernel can be seen here

I tried to use aplay and arecord to try to troubleshoot the issue  and while it works for the default card it fails for the headset. 

Working example for the default card:

```
$ aplay -Dhw:0,0 evil.wav
```

But it fails for the headset:

```
$ aplay -Dhw:3,0 evil.wav 

Playing WAVE 'evil.wav' : Unsigned 8 bit, Rate 11025 Hz, Mono

aplay: set_params:979: Sample format non available
```

Changing hw:3,0 for anything else other than hw:0,0 also fails.

Reference : http://alsa.opensrc.org/index.php/Aplay

/etc/modules.conf  as no references to audio devices as i believe to be due to the fact that i don't use modules.

I tried to play with the following so i might have messed up something. But then again i don't use compiled modules for audio.

# cat /etc/modprobe.d/alsa.conf

```
# Alsa kernel modules' configuration file.

# Note this system does not use audio modules for the default card

# ALSA portion

#alias char-major-116 snd

# OSS/Free portion

#alias char-major-14 soundcore

##

## IMPORTANT:

## You need to customise this section for your specific sound card(s)

## and then run `update-modules' command.

## Read alsa-driver's INSTALL file in /usr/share/doc for more info.

##

##  ALSA portion

## alias snd-card-0 snd-interwave

## alias snd-card-1 snd-ens1371

##  OSS/Free portion

## alias sound-slot-0 snd-card-0

## alias sound-slot-1 snd-card-1

##

# OSS/Free portion - card #1

## alias sound-service-0-0 snd-mixer-oss

a##lias sound-service-0-1 snd-seq-oss

## alias sound-service-0-3 snd-pcm-oss

## alias sound-service-0-8 snd-seq-oss

## alias sound-service-0-12 snd-pcm-oss

##  OSS/Free portion - card #2

## alias sound-service-1-0 snd-mixer-oss

## alias sound-service-1-3 snd-pcm-oss

## alias sound-service-1-12 snd-pcm-oss

#alias /dev/mixer snd-mixer-oss

#alias /dev/dsp snd-pcm-oss

#alias /dev/midi snd-seq-oss

# Set this to the correct number of cards.

options snd cards_limit=4

```

Emerge packages:

```
 media-libs/alsa-lib  Latest version installed: 1.0.21a

 media-libs/alsa-oss Latest version installed: 1.0.17

 media-plugins/alsa-plugins  Latest version installed: 1.0.21

 media-plugins/gst-plugins-alsa  Latest version installed: 0.10.25

 media-sound/alsa-firmware Latest version installed: 1.0.20

 media-sound/alsa-headers Latest version installed: 1.0.21

 media-sound/alsa-tools Latest version installed: 1.0.21

 media-sound/alsa-utils Latest version installed: 1.0.21-r1
```

Notes: I can hear sound from the headset when i speak to the headset microphone but thats about it.

I can hear the difference when i turn on the micro and when its off and a while ago i had this headset working.

My webcam logitech Q9000 pro microphone works flawlessly. The only module it uses is : uvcvideo

Question:

Any ideas about whats going on ? at least  i would like to try to troubleshoot the issue with aplay and arecord.

----------

## HeXiLeD

So far i have been able to get all the cards working (input/output) and the headset to output sound only.

This is what i get from record:

```
$ arecord -l

card 3: U0xd8c0x0c [USB Device 0xd8c:0x0c], device 0: USB Audio [USB Audio]

  Subdevices: 1/1

  Subdevice #0: subdevice #0
```

```
$ arecord -L

default:CARD=U0xd8c0x0c

    USB Device 0xd8c:0x0c, USB Audio

    Default Audio Device

front:CARD=U0xd8c0x0c,DEV=0

    USB Device 0xd8c:0x0c, USB Audio

    Front speakers

surround40:CARD=U0xd8c0x0c,DEV=0

    USB Device 0xd8c:0x0c, USB Audio

    4.0 Surround output to Front and Rear speakers

surround41:CARD=U0xd8c0x0c,DEV=0

    USB Device 0xd8c:0x0c, USB Audio

    4.1 Surround output to Front, Rear and Subwoofer speakers

surround50:CARD=U0xd8c0x0c,DEV=0

    USB Device 0xd8c:0x0c, USB Audio

    5.0 Surround output to Front, Center and Rear speakers

surround51:CARD=U0xd8c0x0c,DEV=0

    USB Device 0xd8c:0x0c, USB Audio

    5.1 Surround output to Front, Center, Rear and Subwoofer speakers

surround71:CARD=U0xd8c0x0c,DEV=0

    USB Device 0xd8c:0x0c, USB Audio

    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers

iec958:CARD=U0xd8c0x0c,DEV=0

    USB Device 0xd8c:0x0c, USB Audio

    IEC958 (S/PDIF) Digital Audio Output

```

And this is what happens:

```
arecord -D plughw:3,0 -v -r 48000 -t wav ~/record.wav
```

```
Recording WAVE '/home/user/record.wav' : Unsigned 8 bit, Rate 48000 Hz, Mono

Plug PCM: Linear conversion PCM (S16_LE)

Its setup is:

  stream       : CAPTURE

  access       : RW_INTERLEAVED

  format       : U8

  subformat    : STD

  channels     : 1

  rate         : 48000

  exact rate   : 48000 (48000/1)

  msbits       : 8

  buffer_size  : 24000

  period_size  : 6000

  period_time  : 125000

  tstamp_mode  : NONE

  period_step  : 1

  avail_min    : 6000

  period_event : 0

  start_threshold  : 1

  stop_threshold   : 24000

  silence_threshold: 0

  silence_size : 0

  boundary     : 6755399441055744000

Slave: Hardware PCM card 3 'USB Device 0xd8c:0x0c' device 0 subdevice 0

Its setup is:

  stream       : CAPTURE

  access       : MMAP_INTERLEAVED

  format       : S16_LE

  subformat    : STD

  channels     : 1

  rate         : 48000

  exact rate   : 48000 (48000/1)

  msbits       : 16

  buffer_size  : 24000

  period_size  : 6000

  period_time  : 125000

  tstamp_mode  : NONE

  period_step  : 1

  avail_min    : 6000

  period_event : 0

  start_threshold  : 1

  stop_threshold   : 24000

  silence_threshold: 0

  silence_size : 0

  boundary     : 6755399441055744000

  appl_ptr     : 0

  hw_ptr       : 0

Status(R/W):

  state       : PREPARED

  trigger_time: 0.000000

  tstamp      : 582607.186362933

  delay       : 0

  avail       : 0

  avail_max   : 0

arecord: xrun:1206: read/write error, state = PREPARED

```

```
$ arecord -D plughw:3,0

Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono

RIFF$WAVEfmt @dataarecord: xrun:1206: read/write error, state = PREPARED
```

# /var/log/messages

shows:

```
kernel: cannot submit datapipe for urb 0, error -28: not enough bandwidth
```

arecord: xrun:1206: read/write error, state = PREPARED seems to be a kernel error.

Current kernel is 2.6.32.9 vanilla-sources and the driver is compiled statically. 

Any ideas ?

----------

## HeXiLeD

I just found the solution to the problem here.

 *Quote:*   

> Are these USB 1.1 devices? Remember that both of these are isochronous
> 
> devices, which means they reserve a certain percentage of the bandwidth as
> 
> soon as they are configured. USB will not allow you to oversubscribe the
> ...

 

I changed the usb headset port to a usb 2.0 hub and the kernel error is gone. I can also record with the micro.

This problem seems to be caused by "lack of enough usb 1.1 bandwidth"for 2 devices like this in the same hub.

[SOLVED]

----------

