Default sound card selected incorrectly on boot

Bug #45786 reported by Robert Drozda
50
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Invalid
Low
Ubuntu Audio Team
Hardy
Invalid
Low
Ubuntu Audio Team

Bug Description

i have two sound cards on my system (dapper up to date):

1. onboard chip Nvidia CK804 AC`97, alsa/linux.device_file /dev/snd/controlC0,

2. M-audio Revolution 5.1 VT1720/24 [Envy24PT/HT] PCI Multi-Channel Audio Controller, alsa/linux.device_file /dev/snd/controlC1

.asoundrc.asoundconf:

!defaults.pcm.card Revolution51
defaults.ctl.card Revolution51
defaults.pcm.device 0
defaults.pcm.subdevice -1

pcm.Revolution51 {
           type hw
           card 1
        }

ctl.Revolution51 {
           type hw
           card 1
        }

Both cards are "working" - accesible, playing, capturing, etc.
M-audio should be default system card for playing and capturing music, movies, system sounds and nvidia ck804 is supposed to be secondary card for phone headset.

Symptoms:
gnome-sound-properities panel is showing ck804 as default card, if i change it to m-audio, close panel and open it again there is still ck804 shown, but sound is going from m-audio. On next boot there is a pretty good chance that default sound card is reverted to ck804 and sound is going from phone headphones. Gnome-sound properties is showing ck804 in both cases, ever, and i am unable to change it, never (m-audio is listed, i can select it, but its just not there if i open panel next time).

Changing volume through volume applet from the panel is working for actual "default" card, changing volume through hotkey on keyboard is working just for ck804 even if default nad playing card is m-audio.

There are also other issues with m-audio because of its "multichannel" nature (no master channel). On every boot, front left channel is muted. On volume applet i can select which channels should be affected, so there is s solution how to change volume for multiple channels at once, for keyboard hotkey there is not such possibility. Also changing volume through applet is working not correctly - sound is decreased/incereased only for top half of the gamut, below that there is just a silence.

Is there any workaround for that? set default card somewhere else? And what about m-audio multichannel features? Should dapper work with that, or i will have to tweak it manually ( one channel muted on boot, master volume on 2 channels ... ). Thank you

Revision history for this message
Robert Drozda (drozda) wrote :

Left front channel always muted on boot with m-audio/driver ICE1724 is acknowledged alsa bug - see https://bugtrack.alsa-project.org/alsa-bug/view.php?id=321

Revision history for this message
Nespa (nespa) wrote :

I've pinned the index of sound devices down in /etc/modprobe.b/alsa-base by adding something like:

options snd-usb-audio index=0
options snd_intel8x0 index=1
options snd-mpu401 index=2

and running sudo update-modules
This allows for /etc/asound.conf to use a fixed index number ( index as found in /proc/asound/cards ).

Revision history for this message
Robert Drozda (drozda) wrote :

thank a lot, "default" sound card now seems to work. other parts of my report are probably related to hotkeys (except that annoying alsa bug), so what to do? close this one and create new for hotkeys - volume ?

Some apps are still using "wrong" soundcard, e.g. flash in firefox, some games . any chance to fix it ?

Revision history for this message
Aleksi Nurmi (aleksi-nurmi) wrote :

I can confirm all these bugs. I have a M-Audio Revolution 5.1 + MSI K9N Platinum/NVidia 570 MCP/Realtec ALC883/AC'97/Azalia 1.0/Intel HD Audio/Whatever and I'm running the AMD64 version of Ubuntu 6.06.

Partial workaround (thanks Nespa):

Open terminal and type:
sudo gedit /etc/modprobe.d/alsa-base

Add the following lines:
options snd-ice1724 index=0
options snd-hda-intel index=1

I suppose there is a way to make alsamixer unmute the left channel at startup?

It's quite frustrating not to be able to use keyboard volume buttons as I don't have a volume knob in my active monitor speakers. Only the volume of the left channel changes, even if the gnome mixer is set to control both channels at the same time.

Gnome mixer application doesn't work well with the Revolution: it forgets what tracks it's supposed to show and it has DAC, DAC, DAC 3 and DAC 3 tracks instead of plain DAC and DAC 1 like alsamixer. Only the second DAC / DAC 3 affects the sound volume (the changes are mirrored to the first DAC / DAC 3, but not the other way around).

I wonder if it's possible to write a more user-friendly driver, all the DACs paired and renamed to Front, Back, etc. according to the card in use (5.1 or 7.1). A master channel would be nice, too.

Revision history for this message
Ambimom (ambimom-yahoo) wrote :

Granted I am new to Ubuntu and Linux but this had been driving me crazy. The sound works; the Volume Control preferences show the correct Intel ICH5 (Alsa mixer) default card; but for no apparent reason, system sound preferences default to usb device ox46d:ox8b2, even when the volume control preferences show Intel ICH5.

No manner of trying to change the default in the systems sound preferences works. Then on another boot, it reverts back to ICH5.

When usb is the default, I cannot use Audacity. When ich5 defaults I can use Audacity.

It drove me nuts until I read this. It is definitely a bug.

Revision history for this message
Ambimom (ambimom-yahoo) wrote :

just learned that in addition to Audacity not working when it boots as "usb" the sound on flash doesn't work either. If it boots as "intel" I can watch and listen to youtube for instance, but when it boots as "usb" I can see but not hear the video.

Revision history for this message
Ambimom (ambimom-yahoo) wrote :

Someone in the forums shared this with me and it seems to fix the problem:

Locate the module names of your sound cards with:

less /proc/asound/modules

mine was:

0 snd_emu10k1
1 snd_ice1712

In /etc/modprobe.d/alsa-base replace:

install sound-slot-0 modprobe snd-card-0
install sound-slot-1 modprobe snd-card-1

with:

install sound-slot-0 modprobe snd_ice1712
install sound-slot-1 modprobe snd_emu10k1

or the other way depending on which card you want as the default (sound-slot-0)

Revision history for this message
robert114 (robertreems) wrote :

I have the same problem both with dapper and edgy i hope it will be solved automaticly so the newbies don't run into problems and reboot to Windows...
should i fill in a bug report for edgy???? if so please tell me and i will fill in a new bug report or i will add my comments to an existing one

Revision history for this message
Ambimom (ambimom-yahoo) wrote : Re: [Bug 45786] Re: default sound card is randomly set on boot, settting default sound card through gnome-sound-properties did not work correctly, changing volume through hotkeys (on logitech multimedia keyboard) is bind with card0, not with default card

Robert, I am hoping it gets fixed in Edgy too. Sure,
add it. Why not! Fingers crossed.

--- robert114 <email address hidden> wrote:

> I have the same problem both with dapper and edgy i
> hope it will be solved automaticly so the newbies
> don't run into problems and reboot to Windows...
> should i fill in a bug report for edgy???? if so
> please tell me and i will fill in a new bug report
> or i will add my comments to an existing one
>
> --
> default sound card is randomly set on boot, settting
> default sound card through gnome-sound-properties
> did not work correctly, changing volume through
> hotkeys (on logitech multimedia keyboard) is bind
> with card0, not with default card
> https://launchpad.net/bugs/45786
>

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Revision history for this message
Aleksi Nurmi (aleksi-nurmi) wrote :

I'm happy to say my Revolution 5.1 in Edgy now has a normal PCM stereo volume control. The driver seems fixed but sound card selection doesn't.

Revision history for this message
Louis (louisgag) wrote :

I have a similar problem in edgy with my two sound cards. Sometimes the cmedia card is used and other times the sis is used, but c-media was set to default in the settings. I have attached the dmesg output right after boot of both cases.

Revision history for this message
Louis (louisgag) wrote :
Revision history for this message
Louis (louisgag) wrote :

thanks

Daniel T Chen (crimsun)
Changed in alsa-driver:
assignee: nobody → crimsun
importance: Medium → Low
Revision history for this message
Victor Osadci (victor-os) wrote :

Still an issue with Ubuntu 7.10. I have a Creative PCI card and a on-board intel HD, and I can't get the Intel one to stay as the default.

Revision history for this message
Aleksi Nurmi (aleksi-nurmi) wrote :

For some reason the Revolution 5.1 is the default (over Intel HDA) in Gutsy, now. I don't what kind of logic Gutsy uses, but I'm happy. :) I did a clean install and all the settings seem to stay in gnome-sound-properties. I haven't got a .asoundrc.asoundconf file, though.

Revision history for this message
Aleksi Nurmi (aleksi-nurmi) wrote :

> For some reason the Revolution 5.1 is the default (over Intel HDA) in Gutsy, now.
I don't know know what I did, but it's not any more. Strange because I shouldn't have done anything that affects it. :-/

Revision history for this message
Paul Perkins (thirdspace) wrote :

I'm running Gutsy and just noticed today that applications that had been happily playing through my built-in snd_hda_intel device were failing. It looks like some recent update (or random cosmic rays) caused my two sound devices to swap indexes. I now have

cat /proc/asound/modules
 0 snd_ice1712
 1 snd_hda_intel

I think it was the other order before, and I did nothing that I would expect to change the sound configuration. It seems to me there was a GUI way to set "default sound device" but I can't find it any more. I'll try one of the non-gui ways to control alsa device numbering.

I use the ice1712 for complex (multi-track recording) stuff and the hda_intel for simple playback since the ice1712 fails to provide the simple kind of mixer interface that many sound applications expect to see. But I see that Windows Vista doesn't support my M-Audio Delta sound card (alias ice1712) at all currently.

Revision history for this message
Paul Perkins (thirdspace) wrote :

OK, I appended to /etc/modprobe.d/alsa-base the lines

options snd_hda_intel index=0
options snd_ice1712 index=1

ran sudo update-modules, rebooted.
Now indeed the sound device numbers are swapped (back) and my sound applications are happy again.

Looking at the bug reports which someone has helpfully marked as duplicates of this one, I see that it is said that it is actually indeterminate which device will be number 0, they literally race for it. This is no way to run an operating system!!! Perhaps the system init scripts can and should take responsibility for making the order predictable? Or the alsa-base package which contains the alsa-base file which some of us have modified as a work-around? Of course, a complete fix has to cope with devices being physically removed or added too.

Yet another case of the ALSA API causing people to tear their hair out? Could be.

Revision history for this message
Marco Cimmino (cimmo) wrote :

I have also this problem, when two or more webcams are plugged then default audio device can be taken by one of them, when only one is plugged then all is ok.
So this bug is not fully patched!

Revision history for this message
Marco Cimmino (cimmo) wrote :

this is my situation now:

marco@b-52:~$ cat /proc/asound/cards
 0 [Camera ]: USB-Audio - Camera
                      Camera at usb-0000:00:02.0-4, full speed
 1 [U0x46d0x991 ]: USB-Audio - USB Device 0x46d:0x991
                      USB Device 0x46d:0x991 at usb-0000:00:02.1-9, high speed
 2 [NVidia ]: HDA-Intel - HDA NVidia
                      HDA NVidia at 0xfbff0000 irq 19

Revision history for this message
Marco Cimmino (cimmo) wrote :

Forgot to say that I'm on Gutsy final

Revision history for this message
Daniel T Chen (crimsun) wrote :

Fixed in upstream alsa-driver revision 5492:808153682813 (Introduce slots option to snd module).

Changed in alsa-driver:
assignee: crimsun → ubuntu-audio
status: Confirmed → Fix Committed
Revision history for this message
Marco Cimmino (cimmo) wrote :

Daniel this update will reach Gutsy?

Revision history for this message
Marios Papamichael (mariopmpa) wrote : Re: Problem with sound

Hi i have installed Ubuntu yesterday and i have problems with my sound.
I wrote this command sudo nano /etc/modprobe.d/alsa-base and the bottom line
is options snd-cmipci mpu_port=0x330 fm_port=0x388. I have an intel sound
card so i think i have to add this line in options snd-intel8x0 ac97_quirk=3.
Everytime i add this line then i cant save the changes. I typed sudo update-modules
in another terminal to update the alsa-base but still it says modified.
What do i have to do about that? Thnx!

Revision history for this message
Xan (dxpublica) wrote :

I have this problem in 8.04.1.

If I run asoundconf list, I get:
Please note that you are attempting to run asoundconf as a privileged superuser, which may have unintended consequences.

Names of available sound cards:
Live
SI7012
UART

But really SI7012 is not my default card. At least it does not sound.

Regards,
Xan.

Revision history for this message
Nespa (nespa) wrote :

8.04 brings the joy(s) of PolyAudio

This application (pavucontrol) gives a gui to redirect client program streams to the different soundcards that are in your system.

http://0pointer.de/lennart/projects/pavucontrol/

Revision history for this message
Daniel T Chen (crimsun) wrote :

(Note that there is no way for the computer to magically know which card you want to be the default upon a fresh install of Ubuntu.)

Changed in linux:
status: Fix Committed → Invalid
status: Fix Committed → Invalid
Revision history for this message
Paul Perkins (thirdspace) wrote :

"(Note that there is no way for the computer to magically know which card you want to be the default upon a fresh install of Ubuntu.)"

The above comment has nothing to do with this bug report and is "invalid" as a reason to mark the bug report invalid. What's going on? Is Ubuntu trying to make its "quality" statistics look better by spuriously closing bugs as "invalid"?

Revision history for this message
Jon Smirl (jonsmirl) wrote :

My bug was marked duplicate of this and it really wasn't. My problem is that when you have both a motherboard audio device and a USB one, they initialize in random order and the first one that initializes becomes the default. I wanted a stable initialization order. I don't care which one is default, I just want it always to be the same one.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.