You are not logged in.

#1 2014-05-08 13:48:23

jpjenkins
Member
Registered: 2014-03-24
Posts: 104

Change default USB sound driver.

Due to my laptop crashing everytime I change my usb device, trial and error is taking me forever so I was hoping someone can guide me.

I can't work out how to change the default driver for my external card.

This is my alsa-base.conf

# lists the order of the sound cards

options snd slots=snd_ca0106,snd_hda_intel
options snd_ca0106 index=1

#-2 means that it will never be loaded as the primary card.
options snd_hda_intel index=0

This is my asound.conf

defaults.ctl.card 0
defaults.pcm.card 0

This is my modprobe.conf

options snd-hda-intel index=0

options snd-ca0106 index=1

(Is there more information needed?)

However, the driver that is loaded is snd_usb_audio, I remove it and load ca0106 manually and check lsmod to find that it's not being used by anything. How do I point my card in the right direction?

Or perhaps someone can point me in the right direction for getting this sorted, I know it's something easy.

Cheers!

Offline

#2 2014-05-08 15:10:04

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: Change default USB sound driver.

# lists the order of the sound cards

options snd slots=snd_ca0106,snd_hda_intel
options snd_ca0106 index=1

#-2 means that it will never be loaded as the primary card.
options snd_hda_intel index=0

Why do you use both methods? Either use slots or index.

defaults.ctl.card 0
defaults.pcm.card 0

Why? Those are set to 0 already in /usr/share/alsa/alsa.conf.

options snd-hda-intel index=0

options snd-ca0106 index=1

Why another configuration file?

jpjenkins wrote:

(Is there more information needed?)

Yes, what exactly do you want to achieve? Do you want to set your usb card as default device? What hardware do you use.

lspci -nn|grep -i audio; lsusb

Offline

#3 2014-05-08 16:08:40

jpjenkins
Member
Registered: 2014-03-24
Posts: 104

Re: Change default USB sound driver.

Thanks for the reply, I'm quite clueless about this.

I'm trying to load the ca0106 driver for my external usb soundcard, a creative soundblaster live 5.1. The speakers were working fine with snd_usb_audio driver but the problem was that the headphone socket wasn't there (mapped in mixer).

After some searching I found out that the ca0106 is the correct driver for the hardware and after seeing this pastebin.com/8hkyJC14 on another post, I noticed there was a mixer setting for 'phones'. Score. I presume I would get all that functionality just by using the ca0106 driver?

I can't get my head around all these configuration files

asound.state - modules.conf - alsa-base.conf - .asoundrc


Here's what I've got so far, from my search and your advice:

I modified .asoundrc:

snd_hda_intel   {
    type hw
    card 0
}

snd_ca0106 {
	type hw
	card 2
}

  pcm.ca0106 {
          type hw
          card 2
       }
       
       ctl.ca0106 {
          type hw
          card 2
       }

But I don't know what pcm or ctl do. Also, it was advised from somewhere else that I use the 'card' identifier as the name of my hardware, which I found to be 'External'. I decided against it, being aware that there is a lot of outdated information floating around. Wise?

My alsa-base.conf now looks like this:

# lists the order of the sound cards

options snd-ca0106 index=1 vid=041e pid=3040 
options snd_hda_intel index=0

Is the vId and pid a good thing to have there? I can change my device to what I want in alsamixer so the order isn't important.

I cam across a little problem and I'm wondering...
in the file /proc/asound/modules

I have

0 snd_hda_intel

I wanted to add the snd_ca0106 but I can't write to the file as it's always in use. Is this another case of duplicate configuration files or is it necessary?

Do I have to set a conf file in modprobe to autoload the ca0106 driver?

I can't find any information on it because I'm probably being a moron not doing something obvious, I hope someone can point it out! So confused.

Cheers

Offline

#4 2014-05-08 16:18:11

jpjenkins
Member
Registered: 2014-03-24
Posts: 104

Re: Change default USB sound driver.

Also:

Bus 005 Device 003: ID 041e:3040 Creative Technology, Ltd SoundBlaster Live! 24-bit External SB0490
card 2: External [SB Live! 24-bit External], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

This is from lsmod, as you can see snd-usb-audio still gets loaded... why?! There's no ca0106.

snd_usb_audio         118323  2 
snd_usbmidi_lib        19756  1 snd_usb_audio
snd_rawmidi            18742  1 snd_usbmidi_lib
snd_seq_device          5180  1 snd_rawmidi
snd_hda_codec_hdmi     36588  1 
snd_hda_codec_realtek    46566  1 
snd_hda_codec_generic    53211  1 snd_hda_codec_realtek
snd_hda_intel          37704  4 
snd_hda_codec          99871  4 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_intel
snd_hwdep               6332  2 snd_usb_audio,snd_hda_codec
snd_pcm                79815  4 snd_usb_audio,snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel
snd_timer              18718  1 snd_pcm
snd                    59286  24 snd_hda_codec_realtek,snd_usb_audio,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_rawmidi,snd_hda_codec_generic,snd_usbmidi_lib,snd_hda_codec,snd_hda_intel,snd_seq_device

Thanks

Offline

#5 2014-05-08 16:30:05

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: Change default USB sound driver.

Well, your ~/.asoundrc has wrong syntax and is in that form not necessary right now, delete it. Yes it is recommended to use card name references, since it solves the boot order problem and is more descriptive, but comes with another issue of other names when multiple cards of the same model are used.

jpjenkins wrote:

asound.state - modules.conf - alsa-base.conf - .asoundrc

In order:
- used to store and restore current mixer state, meaning all control settings (volume levels, switches for input and output)
- Next two are used by modprobe (usually located in /etc/modprobe.d) to set different options for specified modules or blacklist them
- is the alsa configuration file, takes precedence to /etc/asound.conf

jpjenkins wrote:

Is the vId and pid a good thing to have there?

Yes, in majority of cases.
The file /proc/asound/modules only shows what is loaded and used, it is not a part of any configuration.
Do you use a sound server like pulseaudio or jack?
I would recommend following steps:
First see if you manage to get your usb sound card running with the snd-usb-audio module, as it is loaded by default. There may be module options, that will fix your problem.
If that fails, use a configuration file in /etc/modprobe.d to set configuration for your sound card in a similar order:

options snd-ca0106 vid=041e pid=3040
blacklist snd-usb-audio

Edit: index not necessary here.

Look at the arch linux alsa wiki for more information.

Edit:
So you want to have a volume control for the headphone jack? Or is there no sound at all coming from the headphone jack? Is there only one device for card 2 [External]?

It may be worth a try to load hdajackretask from alsa-tools package with your sound card plugged in, see if you usb card is recognised, some users report to work with other chipsets.

Last edited by emeres (2014-05-08 16:42:10)

Offline

Board footer

Powered by FluxBB