# Alsasound needs to be restarted post-boot to get audio?

## epsilon72

Yet another entry in the ongoing (and endless, I might add) saga of "intel_hda SUCKS".   :Cool: 

For some reason, no matter which alsa driver version I use, (I've tried 1.0.15, *.16, and 9999) I get no sound with my sigmatel audio on my laptop UNLESS I restart alsasound about ten seconds after the thing is done booting.  I've tried putting alsasound in the boot runlevel and the default runlevel, with the same result.  I've tried this with the sound-core support (it's called 'snd', I think?) as a module and compiled into the kernel.  This is really annoying.

It has been doing this ever since I switched from genkernel to a much *better* kernel configuration (both were with 2.6.24-r3), but the sound driver portions of the two configs are the same.

Why is alsasound being buggy?  How can I solve this?

----------

## NeddySeagoon

epsilon72,

What do you have in /etc/modules.d/alsa

----------

## muon

Hello,

I've the same problem.

My hardware:

- ASUS F3T notebook

- Audio device: nVidia Corporation MCP51 High Definition Audio (rev a2)

- aplay -l tells after restart:

```

card 0: NVidia [HDA NVidia], device 0: ALC861VD Analog [ALC861VD Analog]

  Subdevices: 0/1

  Subdevice #0: subdevice #0

-----------> this device is missing directly after boot

card 0: NVidia [HDA NVidia], device 1: ALC861VD Digital [ALC861VD Digital]

  Subdevices: 1/1

  Subdevice #0: subdevice #0

-----------

card 0: NVidia [HDA NVidia], device 6: Si3054 Modem [Si3054 Modem]

  Subdevices: 1/1

  Subdevice #0: subdevice #0

```

/etc/modules.d/alsa contains:

```

alias   snd-card-0 snd-hda-intel

options snd-card-0 model=3stack-660-digout 

alias   sound-slot-0 snd-hda-intel

```

kernel: linux-2.6.24-gentoo-r4 built with genkernel

Removing or using a different model-option doesn't make any difference.

I can do whatever I want, the SPDIF device is only recognized after a restart of ALSA

----------

## epsilon72

 *NeddySeagoon wrote:*   

> epsilon72,
> 
> What do you have in /etc/modules.d/alsa

 

```

alias /dev/mixer snd-mixer-oss

alias /dev/dsp snd-pcm-oss

alias /dev/midi snd-seq-oss

options snd-hda-intel probe_mask=1 model=5stack

alias snd-card-0 snd-hda-intel

alias sound-slot-0 snd-hda-intel

```

----------

## muon

Hello again,

During the boot process I see that udev in loading the snd-hda-intel module, obviously without the model= option.

I don't know exactly happens, but it prints on the screen: udev loading snd-hda-intel...          [OK]

The ALSA init script simply does a modprobe on the modules given in /etc/modules.d/alsa which does nothing if the module is already loaded.

This might be the reason why one has to restart ALSA.

Can anyone tell, how to prevent udev from loading the ALSA modules?

----------

## epsilon72

 *muon wrote:*   

> Hello again,
> 
> During the boot process I see that udev in loading the snd-hda-intel module, obviously without the model= option.
> 
> I don't know exactly happens, but it prints on the screen: udev loading snd-hda-intel...          [OK]
> ...

 

I asked this question earlier, and the answer I received was pretty much "you can't, unless you remove support for said module from your kernel".

Udev doesn't seem to automatically load modules that are in /etc/modules.autoload.d/kernel-2.6, but that doesn't make a difference, as the alsa restart problem is still present.

Maybe we could make some sort of custom init script that does "rmmod snd_hda_intel" after udev?   :Razz: 

----------

## PaulBredbury

 *muon wrote:*   

> obviously without the model= option.

 

Without? Run "update-modules" and look for the line in /etc/modprobe.conf, because that is the file that udev/modprobe uses.

----------

## epsilon72

 *PaulBredbury wrote:*   

>  *muon wrote:*   obviously without the model= option. 
> 
> Without? Run "update-modules" and look for the line in /etc/modprobe.conf, because that is the file that udev/modprobe uses.

 

The "model=blahblahblah" 'loads' fine for me, so I guess that may not be the problem?

----------

## muon

Thanks to PaulBredbury and epsilon72,

I of course did run update-modules before, but it didn't help.

After you told that udev uses the modules.conf I had the idea, that udev addressed the ALSA module by its real name 'snd-hda-intel' and does not use the alias 'snd-card-0' as the ALSA init script does when it greps and modprobes at startup.

Thus udev can't apply the right options to the module because the option is an option to 'snd-card-0' not to 'snd-hda-intel'.

I simply added

```
options snd-hda-intel model=3stack-660-digout
```

to my /etc/modules.d/alsa, ran update-modules again, reboot and...

Voilá, my guess was right, now it does as supposed.

----------

## epsilon72

I checked my alsa module file and the above solution wouldn't have worked for me because it was already specified as snd_hda_intel.

But - for whatever strange reason (at least today) the sound appears to be behaving normally...I can't explain why, since I didn't change anything.  I dislike these "moody" pieces of software.

I'll post here again if the problem reappears.

----------

## epsilon72

I checked my laptop again today, and it appears that whatever happened yesterday was a fluke.  The sound still doesn't work on startup.

Any more ideas?

edit: I'm testing removing the sound card specific options from the alsa module file.  Sound worked this time, so I'll try testing some more.  (this thing is so random)

edit number 2: It appears to be working...for the moment.  This is strange because I'll install the driver in one instance and not need those model specific options; other times without them I can't even run 'alsamixer' without some sort of error.  (and this is with the same driver version...)

----------

## TheZog

I've had the same issue myself w/ a snd_intel8x0 module. Plus even after I restart alsasound it rarely continues to work the whole day. I'll go to play an mp3 or video and no audio found again.

Using ~AMD64 with gentoo kernels 2.6.24-r4, 2.6.24-r5 & now 2.6.25

No errors showing up in dmesg and all of the modules are loaded.

It's driving me crazy!

Does anyone have any ideas?

# ALSA portion

alias char-major-116 snd

# OSS/Free portion

alias char-major-14 soundcore

#

alias snd-card-0 snd-intel8x0

##  OSS/Free portion

alias sound-slot-0 snd-card-0

##

# OSS/Free portion - card #1

alias sound-service-0-0 snd-mixer-oss

alias sound-service-0-1 snd-seq-oss

alias sound-service-0-3 snd-pcm-oss

alias sound-service-0-8 snd-seq-oss

alias sound-service-0-12 snd-pcm-oss

alias /dev/mixer snd-mixer-oss

alias /dev/dsp snd-pcm-oss

alias /dev/midi snd-seq-oss

----------

## Hara

sample problem here

00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 02)

Codec: SigmaTel STAC9228

Address: 0

Vendor Id: 0x83847616

Subsystem Id: 0x10280227

Revision Id: 0x100201

cat /etc/modules.d/snd_hda_intel 

options snd_hda_intel model=3stack

----------

## Hara

FYI,

Kernel upgrade (ie intel audio drivers fixed upstream) solves the problem

----------

## shur

I am having the same problem with a soundblaster live card and with modules snd_emu10k1 and snd_emu10k1_synth. On boot, alsasound modules are loaded but the sound does not work. Either an alsasound restart or running alsaconf will fix the problem, but I would like to find out what is really going on here, and have it start on boot as it did previously. Unfortunately I am unable to pinpoint the change that caused the problem. I do frequent updates but don't reboot each time, shame on me. All I can say is that it is an update that occurred during the month of April to the stable system.

I do have another sound card on the motherboard, an 82801G, but I have configured alsa to use the soundblaster live card, and never had problems with this before last month.

Current version of alsa is 1.0.16, installed on April 14, 2008.

----------

## shur

The problem may be related to the two sound cards, because initially both modules (snd-emu10k and snd-hda-intel) are loaded and the sound doesn't work. After reloading alsa, only the  snd-emu10k is loaded and the sound does work. What is strange is that snd-hda-intel seems to load at boot although I can't find any reference to it in the alsa configuration files.

----------

## shur

In fact that is what the problem was. I added the intel sound module to the modules blacklist and removed it from the kernel config, and all is well again.

----------

## ddriver

I've been struggling with a similar problem for a while, and just running alsaconf after every reboot.

Now I've solved it - and improved my config into the bargain.

The problem in my case is that there are two other peripherals in my system which look like sound cards. One is a USB webcam with built-in microphone and the other is a USB headset. On boot these came up as sound cards 0 and 1, and the VIA sound card on my MB was sound card 2. Alsaconf was fixing this by unloading the module for the USB devices, although this wasn't really what I wanted.

When I started to look into this I realised what a pile of poo alsaconf is. For gentoo it is modifying files in /etc/modules.d, regardless of the fact that my system runs a 2.6 kernel. modules.d and modules.conf have no place in a 2.6 system, it just confuses people (me included). I took the opportunity to completely remove modules.d and modules.conf and move the functionality to modprobe.d and modprobe.conf where they belong.

The key to setting the VIA card to be the first card is the index keyword (better than blacklisting other modules). So what I have is a file called /etc/init.d/modprobe.d/sound which looks like this:

```

alias /dev/mixer snd-mixer-oss

alias /dev/dsp snd-pcm-oss

alias /dev/midi snd-seq-oss

# Set this to the correct number of cards.

options snd cards_limit=3

options snd-via82xx index=0

options snd_usb_audio index=1,2

alias snd-card-0 snd-via82xx

alias sound-slot-0 snd-via82xx

alias snd-card-1 snd_usb_audio

alias sound-slot-1 snd_usb_audio

alias snd-card-2 snd_usb_audio

alias sound-slot-2 snd_usb_audio

```

I needed to run update-modules to refresh modprobe.conf, and now it all works properly after a reboot.

Hope my experience helps someone.

----------

