Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Getting USB headset to work with ALSA

Need help with peripherals or devices?
Post Reply
Message
Author
pjimenez
Posts: 5
Joined: 2017-01-03 11:59

Getting USB headset to work with ALSA

#1 Post by pjimenez »

Hi everyone, first time posting in this forum. I'm asking for help now but I'm willing to contribute too.

I just got a LX-3000 LifeChat USB headset and what I'd like to do is having it as a hotplug device, so that the system chooses it as the default card over the internal sound card when it's plugged in. The same way, I want the system to choose the internal sound card as the default card when the headset is unplugged.

I'm very far from achieving that. All I've managed to do is getting one card or the other to work, but never both at the same time.

Code: Select all

# cat /proc/asound/modules
 0 snd_usb_audio
 1 snd_hda_intel

Code: Select all

# cat /proc/asound/cards
 0 [LX3000         ]: USB-Audio - Microsoft LifeChat LX-3000
                      C-Media Electronics Inc. Microsoft LifeChat LX-3000 at usb-0000:00:1d.3-2, full
 1 [Intel          ]: HDA-Intel - HDA Intel
                      HDA Intel at 0xfeaf8000 irq 44
/etc/modprobe.d/alsa-base.conf file is completely ignored no matter what it's written on the file. The files that are working for me in order to select one card or the other as the default card are /usr/share/alsa/alsa.conf and ~/.asoundrc
~/.asoundrc is receving priority. When the file doesn't exist, then alsa.conf file sets the default card.

EDIT. It seems like /etc/modprobe.d/alsa-base.conf actually does something. It sets which card is number 0 and which is number 1.

Code: Select all

# cat /etc/modprobe.d/alsa-base.conf
options snd_hda_intel index=-1
options snd_usb_audio index=-2

Code: Select all

# cat  /usr/share/alsa/alsa.conf
...
defaults.ctl.card 0
defaults.pcm.card 0
...
When the USB headset is the default card and I unplug it, this is what happens. (The wav file I'm providing does exist and is played correctly when the headset is plugged in)

Code: Select all

$ aplay Kurzweil-K2000-Big-Mono-Bass-C1.wav 
aplay: main:722: audio open error: No such file or directory 

$ alsamixer
cannot open mixer: No such file or directory
The behaviour I would want is that once the headset is unplugged, the internal sound card becomes the one that manages the sound output.

I've also been experiencing a weird issue with ~/.asoundrc . I'm using a very simple configuration.

Code: Select all

$ cat ~/.asoundrc
pcm.!default {
    type hw
    card 1
}

ctl.!default {
    type hw           
    card 1
}
When I use an application that is playing some audio, then I get this.

Code: Select all

$ aplay musica/Kurzweil-K2000-Big-Mono-Bass-C1.wav 
aplay: main:722: audio open error: Device or resource busy
However, aplay works fine in this situation when ~/.asoundrc file does not exist and the USB headset is set as the default card sound in /usr/shar/alsa/alsa.conf file.

Post Reply