# Alsa/udev - no soundcard (SOLVED - cs461x interferes)

## guero61

I've been running Gentoo for... some time.  Just recently reinstalled my desktop on a new 120G drive I acquired, and am having trouble with the sound system.  On my old build, the sound worked flawlessly - I was using devs, snd-cs46xx for the driver, and it was happy.  Now I've built this thing on the (hybrid?) udev that the udev guide recommends, and I can't get my sound working.  I've followed the Alsa tutorial, I've searched, and found nothing that would work.  Tried both alsa-drivers and the kernel's drivers, but to no avail.  When I start 'alsasound' service, I get the following error:

```

 * Loading ALSA modules ...

 *   Loading: snd-card-0 ...                                                                                                                                                                  [ ok ]

 *   Loading: snd-seq-oss ...                                                                                                                                                                 [ ok ]

 *   Loading: snd-pcm-oss ...                                                                                                                                                                 [ ok ]

 * ERROR: Failed to load necessary drivers                                                                                                                                                    [ ok ]

 * Restoring Mixer Levels ...

 * No mixer config in /etc/asound.state, you have to unmute your card!                                                                                                                        [ ok ]

```

The second error isn't so much of a problem; once I get it up and running I can unmute it.  However, with the prior message, there's no warning/error in the kernel logs, nothing.  I noted that starting alsasound doesn't load the snd-cs46xx driver, but fiddling with that didn't help.  Ergh.  What does anyone need to help me on this?Last edited by guero61 on Sun May 22, 2005 7:24 am; edited 1 time in total

----------

## NeddySeagoon

guero61,

This message  

```
* Loading ALSA modules ...

 *   Loading: snd-card-0 ...
```

is the snd-cs46xx module being loaded.

Did you make ALSA as modules or built in?

Modules make ALSA easier to debug. 

```
lsmod | grep snd
```

will show you all the sound modules you have loaded (not built in).

Do you have anything in /dev/snd  and /dev/sound  ?

----------

## guero61

It's been built as fully modular - I've got the kernel drivers (instead of alsa-driver) going on at the moment.

```

[root@monkey ~] lsmod | grep snd

snd_pcm_oss            55584  0 

snd_mixer_oss          20544  1 snd_pcm_oss

snd_seq_oss            35584  0 

snd_seq_midi_event      7936  1 snd_seq_oss

snd_seq                55248  4 snd_seq_oss,snd_seq_midi_event

snd_cs46xx             89480  0 

snd_rawmidi            25952  1 snd_cs46xx

snd_seq_device          8652  3 snd_seq_oss,snd_seq,snd_rawmidi

snd_ac97_codec         77944  1 snd_cs46xx

snd_pcm                96584  3 snd_pcm_oss,snd_cs46xx,snd_ac97_codec

snd_timer              26756  2 snd_seq,snd_pcm

snd                    58340  10 snd_pcm_oss,snd_mixer_oss,snd_seq_oss,snd_seq,snd_cs46xx,snd_rawmidi,snd_seq_device,snd_ac97_codec,snd_pcm,snd_timer

soundcore              10336  1 snd

snd_page_alloc          9924  2 snd_cs46xx,snd_pcm

[root@monkey ~] 

```

A look into /dev/snd and /dev/sound shows this:

```
/dev/snd:

total 0

crw-rw----  1 root audio 116,  1 May  8 09:32 seq

crw-rw----  1 root audio 116, 33 May  8 09:32 timer

/dev/sound:

total 0

crw-rw----  1 root audio 14, 1 May  8 09:32 sequencer

crw-rw----  1 root audio 14, 8 May  8 09:32 sequencer2

```

So, it looks like it's getting part of the way there and quitting; looks like with the kernel modules this actually gets as far as loading snd-cs46xx.  Nothing in dmesg...

I guess what I'll try at the moment is compiling the whole ALSA architecture in, but that really shouldn't make a difference.

----------

## NeddySeagoon

guero61,

Its done what you have told it - all the modules are there but the devices in /dev/ are missing.

This is either a udev issue - its not made the devices, or you have the wrong low level driver for your sound chip.

Please post your lspci output so we can check the sound chip.

Run 

```
emerge udev -p
```

and post your udev version number too.

----------

## quatsch

sometimes, it helps to run 

alsaconf

It's either in the alsa-tools or alsa-utils package. It should match the driver version . I use the alsa-project versions and not the gentoo packages. The gentoo pacakges seem weird when it comes to alsa.

Also, you might want to unload the alsa modules, take a good look at /dev and then load the modules to see what devices get created. Sometimes, udev does not rename the devices right for some reason or other so that you have the devices but with the wrong names.

----------

## guero61

Hmmm... Well, I'm positive I've the right driver:

```

0000:00:00.0 Host bridge: VIA Technologies, Inc. VT8366/A/7 [Apollo KT266/A/333]

0000:00:01.0 PCI bridge: VIA Technologies, Inc. VT8366/A/7 [Apollo KT266/A/333 AGP]

0000:00:08.0 Ethernet controller: D-Link System Inc RTL8139 Ethernet (rev 10)

0000:00:09.0 Serial controller: 3Com Corp, Modem Division (formerly US Robotics) 56K FaxModem Model 5610 (rev 01)

0000:00:0b.0 Multimedia audio controller: Cirrus Logic CS 4614/22/24 [CrystalClear SoundFusion Audio Accelerator] (rev 01)

0000:00:0f.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11)

0000:00:0f.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)

0000:00:11.0 ISA bridge: VIA Technologies, Inc. VT8233A ISA Bridge

0000:00:11.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06)

0000:00:11.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 23)

0000:00:11.3 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 23)

0000:00:13.0 RAID bus controller: Triones Technologies, Inc. HPT366/368/370/370A/372/372N (rev 05)

0000:01:00.0 VGA compatible controller: nVidia Corporation NV20 [GeForce3 Ti 200] (rev a3)

```

And my udev should be the latest; I just ran -uvD world last night

```

[ebuild   R   ] sys-fs/udev-056  (-selinux) -static 0 kB 

```

As a pre-emptive strike, here's my /etc/modules.d/alsa, less the comments:

```

alias char-major-116 snd

alias char-major-14 soundcore

alias snd-card-0 snd-cs46xx

alias sound-slot-0 snd-card-0

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

options snd cards_limit=1

```

One thing catches my eye, quatsch - whereas the version of most of the alsa stuff is 1.0.8-r1, alsa-utils is at 1.0.8; alsa-tools is at 1.0.8-r1.  Is there something jacked up there?

I've run alsaconf - it finds the right sound card, but also fails at starting alsasound.

----------

## quatsch

I actually wouldn't use the alsasound script. I had similar problems when trying to get alsa going on my laptop and since the script seems to be a very bloated version of

modprobe snd-{the appropriate name for your card}

modprobe snd-pcm-oss

alsactl restore

I just have the snd modules autoloaded and then do alsactl restore in a script that is run at startup. Works for me  :Smile: 

Also, I installed *all* alsa related stuff using stuff from alsa-project.org - alsa-libs, alsa-driver, alsa-oss, etc. In the kernel I just have soundcore compiled as module (alsa and oss are disabled). This got my alsa up and going after running alsaconf and maybe it helps in your case, too. I think there is something not right with gentoo's alsa. If it works, you could use the --inject option with emerge to make portage think alsa is installed the gentoo way so it won't complain about missing alsa.

----------

## NeddySeagoon

quatsch,

There have been problems recently with the kernel and also-drivers not working together, lots of undefined symbols. For an old sound card, where the driver is not under heavy development, or being developed at all, alsa from the kernel will be OK. If you have a bleeding edge sound chip, its worth trying alsa-drivers.

----------

## NeddySeagoon

guero61, 

Whats in dmesg as a result of loading the sound modules.

less /proc/interrupts will also be interesting.

Can you post both please?

----------

## quatsch

NeddySeagoon,

are the problems gentoo ebuild related or the alsa-project's code? b/c my problems were with the ebuilds. compiling stuff using the source code from alsa-project never made any problems for me. if there's something wrong with the ebuilds, which i suspect, it's probably worth trying the source code from alsa-project.

----------

## NeddySeagoon

quatsch,

The problems were related to differences in what was actually provided by the kerenl to what the alsa-drivers expected to get. 

The source code of the alsa-drivers provided kerenl modues was in advance of the kernel. As far as I know, the ebuilds were OK.

I have fairly old soundcards intel8x0, emu10k1, usb-audio and snd-bt878, so I use the kerenl modules anyway.

----------

## jorgbell

Thank you EVERYBODY I had a very similar problem on my machine but through reading what you were all saying its now working.

Got sounds on kde as it started, MAGIC

----------

## guero61

Whoops!  Got caught up with Stargate SG-1 Monday last night...

There's no dmesg output; the modules load cleanly.  Before I migrated to this new system using udev, everything worked perfectly.  I always configure my kernels by hand, and they always work, so I'm 99.999% certain it's not the modules.  No hardware has changed in this system, save moving to the new HD.  So, I'm pretty sure it's something up with udev, but what I'm not sure.

The following is the output of 'cat /proc/interrupts' with all the appropriate modules loaded.

```

           CPU0       

  0:  249922987          XT-PIC  timer

  1:      83505          XT-PIC  i8042

  2:          0          XT-PIC  cascade

  5:     326981          XT-PIC  uhci_hcd, uhci_hcd, eth0

  7:         36          XT-PIC  parport0

  9:          0          XT-PIC  acpi

 10:     312172          XT-PIC  ide2

 11:   19374738          XT-PIC  bttv0, nvidia

 12:    1458438          XT-PIC  i8042

 14:      96446          XT-PIC  ide0

 15:         98          XT-PIC  ide1

NMI:          0 

ERR:          0

```

Following quatcsh's directions above (modprobe/alsactl), I get the following message after the alsactl command:

```

alsactl: load_state:1267: No soundcards found...

```

----------

## quatsch

when you run alsaconf, does it detect the card? Does it error out anyway? You should run alsaconf with no snd modules loaded.

----------

## NeddySeagoon

guero61,

Your /proc/interrups shows your sound card has not claimed an IRQ. I'm not sure how your sound card will appear but I know what all the IRQs you have do an none of them are sound. He you go

irq 0 timer. Produces a IRQ every 16.6ms and is used to keep track of time

irq 1 i8042. The keyboard controller interrupt.

irq 2 cascade. irq 8-15 are wired here.

irq 5 uhci_hcd, uhci_hcd, eth0. Two Intel/VIA USB root hubs and your Network

irq 7 parport0 your printer port

irq 9 acpi Power Savings - that can cause problems

irq 10 ide2 A Plug in IDE controller

irq 11 bttv0, nvidia  You TV-Card and nVidia kerenl module

irq 12 i8042 - Your mouse

irq 14 and 15 - Your motherbaord IDE interfaces.

Your irq is either not being routed or shut down. Some things to try.

```
dmseg | grep obody
```

If all's well, it will just return to the prompt. Do check that you have the entire dmesg still. It should start off with some memory layout information. 

```
dmesg | less 
```

.

Edit your grub.conf file to add  

```
acpi=off
```

 to your kernel line, then reboot. That turns acpi off without a kernel rebuild. All the details can be found in /usr/src/linux/Documentation/kernel-parameters.txt

Watch the boot messages (its not in dmesg) for a warning about badly behaved PCI device drivers. The message gives some advice about PCI interrupt routing and another kernel option. Use shift+page up to scroll the console buffer.

----------

## guero61

Curious, that... I _do_ see the warning in dmesg about IRQs being routed via ACPI now.  I'll try the 'acpi=off', and if that doesn't work, 'pci=routeirq'.  I'll keep us posted.

[edit]

Of course, I *do* still have my old Gentoo install laying around; when the 'acpi=off' and 'pci=routeirq' tricks didn't work, I tried booting into it.  Sure enough, when inserting the snd-cs46xx module, I get a kernel log message about IRQ 5, and 'cat /proc/interrupts' shows the sound card on IRQ 5.  I found some very minor configuration differences between that kernel and my current one, so I flattened those out.  Once I boot to the new kernel, we should have a pretty definitive answer as to whether or not it's:

1.  The kernel version

2.  udev/coldplug/hotplug (which was my first suspicion)

[/edit]

----------

## guero61

I'm not sure what to think any more.  The kernel is seeing the damned thing - even without any sound-related services starting (runlevel 1), it autoprobes the snd-cs46xx module, just like it autoprobes the bttv module.  Why wouldn't it get an IRQ?  Would udev affect that, or are we looking at a kernel issue?

```

[root@monkey ~] uname -srvmpio

Linux 2.6.11-gentoo-r7 #5 Thu May 12 21:14:32 CDT 2005 i686 AMD Athlon(tm) XP 1800+ AuthenticAMD GNU/Linux

[root@monkey ~] 

```

----------

## NeddySeagoon

guero61,

Its either an interrupt routing problem or the interrupt is being shut down by another card that shares the interrupt, so nothing on that irq works.

Can you post your entire dmesg please.

----------

## guero61

I really appreciate you guys' help on all this!

I'm a little hesitant to post the entire dmesg here, really because it's so noisy and is hard to troubleshoot.  If I need to, I will, but I've done a few boots with the different kernels, did some diffs on dmesg outputs, and came up with a few interesting tidbits:

vanilla boot:

```

# note it finds the gameport on the soundcard

ACPI: PCI interrupt 0000:00:0b.0[A] -> GSI 5 (level, low) -> IRQ 5

gameport: CS416x Gameport on pci0000:00:0b.0 speed 1612 kHz

# this message was without equivalent in the older kernel (2.6.10-gentoo-r6)

PCI: Via IRQ fixup

```

acpi=off

```

# note, again, that the gameport is found but not the soundcard on which it resides

gameport: CS416x Gameport on pci0000:00:0b.0 speed 1569 kHz

```

pci=routeirq

```

# the kernel seemed to be going serially through the PCI interrupts; however, it skipped over 0a.0,

# which according to lspci, is that of the soundcard

ACPI: PCI interrupt 0000:00:09.0[A] -> GSI 10 (level, low) -> IRQ 10

ACPI: PCI interrupt 0000:00:0b.0[A] -> GSI 5 (level, low) -> IRQ 5

# same message as vanilla boot above

ACPI: PCI interrupt 0000:00:0b.0[A] -> GSI 5 (level, low) -> IRQ 5

gameport: CS416x Gameport on pci0000:00:0b.0 speed 1612 kHz

```

old kernel

```

# unique to _new_ kernels (above 3)

__iounmap: bad address c00fffd9

# old kernel says this

CPU 0 irqstacks, hard=c04d9000 soft=c04d8000

# while new kernel says this

CPU 0 irqstacks, hard=c04c6000 soft=c04c5000

# When snd-cs46xx loads, the following messages pop up in dmesg:

ACPI: PCI interrupt 0000:00:0b.0[A] -> GSI 5 (level, low) -> IRQ 5

ACPI: PCI interrupt 0000:00:0b.0[A] -> GSI 5 (level, low) -> IRQ 5

```

NOTE:  I can provide the full dmesg for any of the boots, I was just hoping to save some space and be less confusing to whoever comes next, searching for this.

----------

## NeddySeagoon

guero61,

I've had a look at the dmesg files you sent me and as you say, there is nothing out of the ordinary there.

They are remarkable for whats not there. The joystick device it detected but no signs of the sound card itself.

How does the the low level sound driver get loaded?

Are you able to mod probe it by hand and get it to work ?

----------

## guero61

That's what's incredible.  Everything that should be there is, save one tiny, important exception.

With the new installation, the modules are loaded on boot (auto-load?); on the old installation, I have to run 'modprobe snd-cs46xx', and the twin messages at the bottom of my last post appear.

What I'm going to try next is updating the old system (uses devfs instead of udev) and use the latest kernel (with as similar a kconfig as possible), see if that's the problem.

----------

## NeddySeagoon

guero61,

I don't know what to suggest next but I hate being beaten by things like this.

You can send me your lspci output and kernel config file (/usr/src/linux/.config) and I will look them over if you like.

----------

## guero61

I'm not beaten, not by a long shot.  I'll go so far as to completely re-build using devfs, if that's what it takes.  I just need to get non-work time to do it.

----------

## guero61

Well, a week later, a new kernel, and no sound.  I compiled the latest kernel with my old system and my current config set, and got no sound.  So, it's not tied just to udev - evidently something about this kernel or my configuration.  NeddySeagoon - you want to take a look at the config?

[edit]

Maybe I'm blind - just looking at a diff between the two .config files, I came up with something rather immediate - in the old kernel, I didn't have the cs461x gameport enabled; in the new one, I have it fully compiled in.  Hmmm...  Given the stuff above, that seems too coincidental - I'm going to disable/module it and see what we get.

[/edit]

[edit]

THAT WAS IT!!!  After a bit of experimentation, it seems that if the cs461x gameport driver is loaded before the snd-cs46xx module, it will take over the card, rendering it unusable for sound.  I was able to remove the cs461x module and modprobe snd-cs46xx without a problem.  One possible manner in which to mitigate this would be to manually edit /lib/modules/<kernel version>/modules.dep and make snd-cs46xx a dependency of cs461x; YMMV.  I just completely excluded it from the kernel - all of my controllers are USB anyway.  Thanks to all who offered so much help!

[/edit]

----------

## NeddySeagoon

guero61,

That a hard one. If you load the modules for sound and game port in the right order, do they both work ?

That can be automated by building as modules and adding the module names (in the right order) to /etc/modules.autoload.d/kern...

----------

## guero61

 *NeddySeagoon wrote:*   

> 
> 
> That a hard one. If you load the modules for sound and game port in the right order, do they both work ?
> 
> 

 

It seems to work in that it loads correctly and I can see it, but since I have nothing to hook up to it...

----------

