View the Most Wanted LQ Wiki articles.
Go Back > Forums > Linux Forums > Linux - Hardware
User Name
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?


  Search this Thread
Old 10-03-2013, 02:55 AM   #1
Registered: Jul 2003
Location: Fort Worth, Texas
Distribution: Mepis Linux 2004
Posts: 547

Rep: Reputation: 30
Linux and ALSA default sound card, two methods fail to set firefox/chrome sound.

Hi there,

I have a requirement for alsa, because pulse audio is limited to the bitrates it can play music over digitial USB/PCM with... so it is inferior to alsa's technology.

I've set up my alsa sound to go to card 2, a usb audio device for my hifi sound setup. Most applications can manually be configured for hw:2,0 and it works fine.

However, things that make assumptions Firefox, Chrome, and my desktop manager still output sound to the laptop.

I've tried to force defaults by adding a file called ~/.asoundrc, and 1 line to the bottom of the alsa modprobe conf as well.

Alsa seems to ignore these configurations, and still presents the default output to my speakers.
Where is the defaults set in Linux Mint when you use ALSA from the repositories?

I removed pulse audio as it does not support proper PCM bitrate resolutions for high quality audio.

# First attempt to set defaults
jon@epoch2 ~ $ cat /home/jon/.asoundrc
pcm.!default {
	type hw
	card 2

ctl.!default {
	type hw           
	card 2

# Second attempt, last line added to set usb-audio as card 0, but it fails to work.

jon@epoch2 ~ $ cat /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 $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-ioctl32 ; /sbin/modprobe --quiet --use-blacklist snd-seq ; }
# Workaround at bug #499695 (reverted in Ubuntu see LP #319505)
install snd-pcm /sbin/modprobe --ignore-install snd-pcm $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-pcm-oss ; : ; }
install snd-mixer /sbin/modprobe --ignore-install snd-mixer $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-mixer-oss ; : ; }
install snd-seq /sbin/modprobe --ignore-install snd-seq $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-seq-midi ; /sbin/modprobe --quiet --use-blacklist snd-seq-oss ; : ; }
install snd-rawmidi /sbin/modprobe --ignore-install snd-rawmidi $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-seq-midi ; : ; }
# Cause optional modules to be loaded above sound card driver modules
install snd-emu10k1 /sbin/modprobe --ignore-install snd-emu10k1 $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-emu10k1-synth ; }
install snd-via82xx /sbin/modprobe --ignore-install snd-via82xx $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-seq ; }

# Load saa7134-alsa instead of saa7134 (which gets dragged in by it anyway)
install saa7134 /sbin/modprobe --ignore-install saa7134 $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist saa7134-alsa ; : ; }
# Prevent abnormal drivers from grabbing index 0
options bt87x index=-2
options cx88_alsa index=-2
options saa7134-alsa index=-2
options snd-atiixp-modem index=-2
options snd-intel8x0m index=-2
options snd-via82xx-modem index=-2
#options snd-usb-audio index=-2
options snd-usb-caiaq index=-2
options snd-usb-ua101 index=-2
options snd-usb-us122l index=-2
options snd-usb-usx2y index=-2
# Ubuntu #62691, enable MPU for snd-cmipci
options snd-cmipci mpu_port=0x330 fm_port=0x388
# Keep snd-pcsp from being loaded as first soundcard
options snd-pcsp index=-2
# Ensure this is loaded as first sound card <<<< jon_k
options snd-usb-audio index=-1
# Tried index=0 as well, but this makes no difference after a reboot.... index=0 and index=-1 still pick my laptop speakers by default.

Last edited by jon_k; 10-03-2013 at 03:13 AM.
Old 10-03-2013, 03:10 AM   #2
Registered: Jul 2003
Location: Fort Worth, Texas
Distribution: Mepis Linux 2004
Posts: 547

Original Poster
Rep: Reputation: 30
Someone suggested asoundconf, it lets you pick the default sound card with a gui.
I noticed a friendly gui tool is in the repo's, but the geniuses absent mindedly did not bundle the package it depends on...?

jon@epoch2 ~ $ apt-file search asoundconf
app-install-data: /usr/share/app-install/desktop/asoundconf-gtk:asoundconf-gtk.desktop
asoundconf-gtk: /usr/bin/asoundconf-gtk
asoundconf-gtk: /usr/share/applications/asoundconf-gtk.desktop
asoundconf-gtk: /usr/share/doc/asoundconf-gtk/README
asoundconf-gtk: /usr/share/doc/asoundconf-gtk/changelog.Debian.gz
asoundconf-gtk: /usr/share/doc/asoundconf-gtk/copyright
asoundconf-gtk: /usr/share/man/man8/asoundconf-gtk.8.gz

jon@epoch2 ~ $ asoundconf-gtk
sh: 1: /usr/bin/asoundconf: not found
You need to make sure asoundconf is active!
By default, asoundconf's configuration file is ~/.asoundrc.asoundconf
and must be included in ~/.asoundrc. Open this file to make sure it is!

Last edited by jon_k; 10-03-2013 at 03:12 AM.
Old 10-03-2013, 08:09 AM   #3
LQ Guru
Registered: Oct 2003
Posts: 5,067

Rep: Reputation: Disabled

alsa counts from zero so your second card is 1

2) your asoundrc needs a device number.

but since you mention you have usb device you have a number of alternatives on how that is done

The easiest if you never want your onboard or on pci card sound is to blacklist It's sound module.

or you could set up a index=1 for your internal sound device so usb always grabs index=0

otherwise post the output of
cat /proc/asound/pcm
ATM you are likely to see 00-numbers and 01-numbers
change your asoundrc to read something like

pcm.!default {
type hw
card 1
device 3
where device=3 must be a playback device and not an input device or spdif device etc
good luck

Last edited by aus9; 10-03-2013 at 08:10 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] default sound card specification in alsa conf files esllq Linux - Software 2 09-16-2011 01:54 PM
[SOLVED] Set default sound card ursusca Gentoo 2 03-22-2010 04:55 PM
Where alsa looks for the default sound card?? lumacho Slackware 3 09-24-2009 05:54 PM
ALSA not working for Creative Sound Blaster Live 24 Bit sound card vishalsonu Linux - Hardware 7 08-20-2005 02:02 PM
No sound with a CM8738 sound card -- alsa installed istar80 Linux - Hardware 1 06-17-2005 03:02 PM

All times are GMT -5. The time now is 05:37 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration