[SOLVED] Selecting Default sound card in Alsa

Archived topics about LMDE 1 and LMDE 2
Locked
Niks
Level 3
Level 3
Posts: 170
Joined: Thu Feb 11, 2010 6:59 am
Location: Netherlands

[SOLVED] Selecting Default sound card in Alsa

Post by Niks »

I have multiple sound cards in my LMDE64 system and all work fine. [SOLVED] :mrgreen:

After removing all other "options" commands, this is what I added to the end of

Code: Select all

gedit /etc/modprobe.d/alsa-base.conf
to get the card 0 as default [/color]

Code: Select all

#added by me to select default card
options snd_ca0106 index=0
options snd_hda_intel index=1
options saa7134_alsa index=2
options snd_hda_intel index=3
options snd-usb-audio index=4
-------------------------------------------------------------------------------------------------------------------------------

After removing Pulse ( as per instructions in http://forums.linuxmint.com/viewtopic.p ... 31#p547731)
But
I am having problems setting the default card.

I found http://www.alsa-project.org/main/index.php/Asoundrc but it's a lot of fiddling around which ( some peolpe are going to hate me for this :twisted: ) in pulse was very simple and easy!

The reason I removed pulse was to get to get pass through from VLC to my one of my digital outputs which works like a charm now :)

Any one know of a better/simpler/quicker way to do this :?:


UPDATE
Two days after posting this I got feed up not having and sound ( on my local speakers ) so I reinstalled pulse which works fine. I have also checked my 5.1 digital output using ALSA out from VLC and I have what I need for now ......

How ever I still would like to have my local speakers as Default and not the TV card :cry: the way it should be ! ie. the volume keys on the keyboard work again :D
So I am not going to post Solved as it's not and I'm sure I'm not he only one that has this problem after removing pulse.
With out going into the in's and out's of Pulse etc. I always found it the easiest way to route things and never let me down in that sense. I use Jack on other PC's but being a sound guy / musician I'm not intimated by "spaghetti" but this facility is missing in a nice simple GUI form in ALSA WHY :?:

UPDATE 2

Now I understand .....NOT ................no flash being streamed to Pulse and no systems sounds :x

So I really need to have my ALSA problem solved Pulse or no Pulse !
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 7 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Niks
Level 3
Level 3
Posts: 170
Joined: Thu Feb 11, 2010 6:59 am
Location: Netherlands

Wrong sound device selected at start up.[Solved]

Post by Niks »

Nope that's not it at has just switched to an other card :roll:
# Prevent abnormal drivers from grabbing index 0
options bt87x index=-2
options cx88_alsa index=-2
options snd-atiixp-modem index=-2
options snd-intel8x0m index=-2
options snd-via82xx-modem index=-2
# Keep snd-pcsp from beeing loaded as first soundcard
options snd-pcsp index=-2
# Keep snd-usb-audio from beeing loaded as first soundcard
options snd-usb-audio index=-2
#added by me to select default card
options cx88_alsa index=0


Now I think that the cx88 is part of my TV card but it does not get selected as default so the point is the code is not right.
The actual card I want as default is CA0106 which is a Sound blaster Audigy :?

I have re removed pulse again as I want to be sure that I'm only playing with ALSA
mads

Re: Selecting Default sound card in Alsa after Pulse removal

Post by mads »

Dear Niks, two questions:
1- I have read your opening post several times, but still don't quite understand what you are trying to achieve.
Could you please write in simple words, for stupid people like me, what is the problem?
2- What is the output of 'cat /proc/asound/modules'?
Niks
Level 3
Level 3
Posts: 170
Joined: Thu Feb 11, 2010 6:59 am
Location: Netherlands

Re: Selecting Default sound card in Alsa after Pulse removal

Post by Niks »

Thanks mads I will try to make it clear in one go !
cat /proc/asound/modules
0 saa7134_alsa
1 snd_ca0106
2 snd_hda_intel
3 snd_hda_intel
4 snd_usb_audio
I want - 1 snd_ca0106 as default card
So far everything I have tried has not worked. :cry:

Everything = your advise and all I could find so far online ! :roll:

I also made the point that "Pulse" has the facility to route signals very easily ( even though many people hate it ) ALSA has not got simple GUI system to do this :!:

Hope this got it :D
mads

Re: Selecting Default sound card in Alsa after Pulse removal

Post by mads »

Thanks. :)

Your second post shows that you have added these lines to /etc/modprobe.d/alsa-base.conf:

Code: Select all

#added by me to select default card
options cx88_alsa index=0
My suggestion is to replace the above lines with the following lines, save the file and reboot.

Code: Select all

#added by me to select default card
options snd_ca0106 index=0
options saa7134_alsa index=1
Niks
Level 3
Level 3
Posts: 170
Joined: Thu Feb 11, 2010 6:59 am
Location: Netherlands

Re: Selecting Default sound card in Alsa [SOLVED]

Post by Niks »

:D THANKS MADS thats it .....

I don't understand why the card never came up by name in the file but ok I have learnt a little more again! :mrgreen:
Niks
Level 3
Level 3
Posts: 170
Joined: Thu Feb 11, 2010 6:59 am
Location: Netherlands

Re: Selecting Default sound card in ALSA

Post by Niks »

HOLD IT HIT THE BREAKS !! :oops: NOT SOLVED AHHHHHHHHHHHHHHHHHHH :roll:

After restarting it all work perfectly and I was a happy Chappy so I went to bed with a great big :mrgreen:
Next morning and now my USB has become default :?: :?: :?: :?: :?: :?: :?: :?: :?: :?: :?: :?: :?:
OK I thought lets reinstall all ALSA programs to make sure everything was ok and make sure

Code: Select all

gedit /etc/modprobe.d/alsa-base.conf
had all the correct stuff which it did, but no change after reboot!
Having read some of this http://www.volkerschatz.com/noise/alsa.html I ask why do they not mention alsa-base.conf and why do I not have a asoundrc.conf as
If you have read other documents about the asoundrc, you may have learnt that you can redefine ALSA's default device with a line like the following:
pcm.!default { type hw card 0 }
Then I ask if it's that easy then why didn't one of the clever people write a tiny tiny app to show / select / write the default card to that file ???
So what do I do now mads :?:
mads

Re: Selecting Default sound card in Alsa [SOLVED]

Post by mads »

Add this to /etc/modprobe.d/alsa-base.conf:
# Keep snd-usb-audio from beeing loaded as first soundcard
options snd-usb-audio index=-2
Niks
Level 3
Level 3
Posts: 170
Joined: Thu Feb 11, 2010 6:59 am
Location: Netherlands

Re: Selecting Default sound card in Alsa [SOLVED]

Post by Niks »

That line was already in there Mads :cry:

I just rebooted again and got an other card again :( :cry:

here's the whole thing
# autoloader aliases
install sound-slot-0 /sbin/modprobe snd-card-0
install sound-slot-1 /sbin/modprobe snd-card-1
install sound-slot-2 /sbin/modprobe snd-card-2
install sound-slot-3 /sbin/modprobe snd-card-3
install sound-slot-4 /sbin/modprobe snd-card-4
install sound-slot-5 /sbin/modprobe snd-card-5
install sound-slot-6 /sbin/modprobe snd-card-6
install sound-slot-7 /sbin/modprobe snd-card-7
# Cause optional modules to be loaded above generic modules
install snd /sbin/modprobe --ignore-install snd && { /sbin/modprobe --quiet snd-ioctl32 ; /sbin/modprobe --quiet snd-seq ; }
install snd-rawmidi /sbin/modprobe --ignore-install snd-rawmidi && { /sbin/modprobe --quiet snd-seq-midi ; : ; }
install snd-emu10k1 /sbin/modprobe --ignore-install snd-emu10k1 && { /sbin/modprobe --quiet snd-emu10k1-synth ; : ; }

# Prevent abnormal drivers from grabbing index 0
options bt87x index=-2
options cx88_alsa index=-2
options snd-atiixp-modem index=-2
options snd-intel8x0m index=-2
options snd-via82xx-modem index=-2
# Keep snd-pcsp from beeing loaded as first soundcard
options snd-pcsp index=-2
# Keep snd-usb-audio from beeing loaded as first soundcard
options snd-usb-audio index=-2
#added by me to select default card
options snd_ca0106 index=0
options saa7134_alsa index=1
Sees to me that it's all a bit double with the -2 everywhere that's doesn't work :roll:

Oh well next thought please :D
EmonAzzameen

Re: Selecting Default sound card in Alsa [SOLVED]

Post by EmonAzzameen »

Hi,

I have a similar problem with LMDE and ALSA. I replaced Pulse Audio with ALSA on my hp dm1 3101 Netbook.
Sound output is only possible within applications which allow to change the default sound device (e.g. VLC).

I read through the thread, but altering the default device in the conf file has no effect, even after rebooting.

Would be glad if someone could help me out.

Code: Select all

cat /proc/asound/cards

 0 [Generic        ]: HDA-Intel - HD-Audio Generic
                      HD-Audio Generic at 0xf0244000 irq 42
 1 [SB             ]: HDA-Intel - HDA ATI SB
                      HDA ATI SB at 0xf0240000 irq 16

Code: Select all

cat /proc/asound/modules

0 snd_hda_intel
1 snd_hda_intel

Code: Select all

/etc/modprobe.d/alsa-base.conf

# autoloader aliases
install sound-slot-0 /sbin/modprobe snd-card-0
install sound-slot-1 /sbin/modprobe snd-card-1
install sound-slot-2 /sbin/modprobe snd-card-2
install sound-slot-3 /sbin/modprobe snd-card-3
install sound-slot-4 /sbin/modprobe snd-card-4
install sound-slot-5 /sbin/modprobe snd-card-5
install sound-slot-6 /sbin/modprobe snd-card-6
install sound-slot-7 /sbin/modprobe snd-card-7
# Cause optional modules to be loaded above generic modules
install snd /sbin/modprobe --ignore-install snd && { /sbin/modprobe --quiet snd-ioctl32 ; /sbin/modprobe --quiet snd-seq ; }
install snd-rawmidi /sbin/modprobe --ignore-install snd-rawmidi && { /sbin/modprobe --quiet snd-seq-midi ; : ; }
install snd-emu10k1 /sbin/modprobe --ignore-install snd-emu10k1 && { /sbin/modprobe --quiet snd-emu10k1-synth ; : ; }

# Prevent abnormal drivers from grabbing index 0
options bt87x index=-2
options cx88_alsa index=-2
options snd-atiixp-modem index=-2
options snd-intel8x0m index=-2
options snd-via82xx-modem index=-2
# Keep snd-pcsp from beeing loaded as first soundcard
options snd-pcsp index=-2
# Keep snd-usb-audio from beeing loaded as first soundcard
options snd-usb-audio index=-2
options snd_hda_intel index=0

Code: Select all

lspci -v | less

00:01.1 Audio device: ATI Technologies Inc Wrestler HDMI Audio [Radeon HD 6250/6
310]
        Subsystem: Hewlett-Packard Company Device 1611
        Flags: bus master, fast devsel, latency 0, IRQ 42
        Memory at f0244000 (32-bit, non-prefetchable) [size=16K]
        Capabilities: <access denied>
        Kernel driver in use: snd_hda_intel

Code: Select all

uname -r

3.2.0-2-amd64
mads

Re: Selecting Default sound card in Alsa [SOLVED]

Post by mads »

EmonAzzameen wrote:

Code: Select all

cat /proc/asound/modules

0 snd_hda_intel
1 snd_hda_intel
Hi. Your sound devices are named the same, and forcing one into index 0 will not work.
I am not sure, you could try to add enable=1 (to enable) and enable=0 (to disable) options:

options snd-hda-intel enable=1 index=0
options snd-hda-intel enable=0 index=1

or

options snd-hda-intel enable=0 index=0
options snd-hda-intel enable=1 index=1

You need to reboot after editing alsa-base.conf.
EmonAzzameen

Re: Selecting Default sound card in Alsa [SOLVED]

Post by EmonAzzameen »

Yes it worked.

Thanks
mads

Re: Selecting Default sound card in Alsa [SOLVED]

Post by mads »

EmonAzzameen wrote:Yes it worked.

Thanks
No problem, you're welcome.
Glad that it worked. I was not sure at all. :)
Dark Angel

Re: [SOLVED] Selecting Default sound card in Alsa

Post by Dark Angel »

I registered on the forum just to post my thanks to this thread.
Since installing Mint 13 XFCE I havehad nothing but trouble getting the volumeand mute hotkeys working on my Eeepc. I run Slackware 13.37 XFCE on my desktop and have had nowhere near as much trouble with it (Alsa) as with this (Pulse) so I've been trying to get rid of Pulse for days.but every time I tried I woud end up with no sound, Fixing the default audio device finally soled he issue and now everything works as it should.

THANKYOU! :D

Beer-buying may or may not be involved, but can't be ruled out.
thebitpit

Re: [SOLVED] Selecting Default sound card in Alsa

Post by thebitpit »

I tried it and it worked, but I got an error message from the kernel loader. Digging some more I noticed that index is not a single digit, it is an array of int. It works in your example because the last value that was used is "1" (an array of one int). This make the second hardware detected have the index of 0. The first hardware detected is lost because it was not moved to a different index and was replaced by the second hardware detected.

Enable is an array of bool. I assume it is the same length as the array of int used in index. I have not experimented with it except that I discovered that a "0" is not a valid value. The kernel loader reported this error and caused me to dig deeper even though it worked.

I have the snd_hda_intel module compiled into my kernel so I set it using boot parameters. I added this to the kernel command line.

Code: Select all

snd-hda-intel.index=1,0
This is all that I need to swap the order of the hardware for card0 and card1 of the snd_hda_intel driver.
It does not disable any devices. Now html5 plays along with flash. Now that you have card0 (the default device) connected to the right hardware, any fiddling with asound.conf or .asoundrc, trying to fix it, should be removed.

For a loaded driver module you might try;

Code: Select all

options snd-hda-intel index="1,0"
I think that there is a bug in the way html5 is handled in that it is does not respect alsa remapping.
wheeledgoat

Re: [SOLVED] Selecting Default sound card in Alsa

Post by wheeledgoat »

I know, thread from 2012 and I'm resurrecting it. Usually I'd know better, but I'm only putting my own recent experience with this here for the next guy that searches his way here. It's still a relevant topic as of this writing.

On Mint 16 - Petra w/ KDE 4.11

As soon as I installed a GTX 760 card, it's hdmi audio took over. I could no longer get my pci sound card to work, just like the dudes above. I'd go into System Settings > Multimedia > Audio & Video Settings > Audio Hardware Setup and select which device I wanted to use, and save/apply. As soon as I'd close that window and check again, that blasted hdmi audio would be selected again. Couldn't get the audio to my pci card no matter what, not even for a moment, not even using the "test" buttons when it looked like I had it selected.

The initial solutions above of trying to prioritize them with "index=0" and "index=1" in alsa-base.conf didn't work, same problem.

What did work for me was adding that infernal hdmi audio device to the blacklist file in same directory as alsa-base.conf (/etc/modprobe.d). BINGO. works without any modifications to the alsa-base.conf priority (cause there's nothing else for it to select!)

Good luck to the next guy.
Locked

Return to “LMDE Archive”