# kernel module snd-ca0106 for a soundblaster-live '24 bit'

## axlotl

I was going nuts trying to get this card to work with the snd-emu10k1 module, compiling it into the kernel, alternately loading it as a module, then I discovered that according to this page at alsa-project.org, I've been using the wrong driver, which would explain the lack of noise coming from the card. What I need, it seems, is the snd-ca0106 driver. But in the kernel config under Advanced Linux Sound Architecture->PCI, I don't see that driver. So I downloaded the alsa package and unzipped it and found the source for the driver along with a Makefile. Two questions:

1) I am in uncharted territory, personally, if I actually have to compile a driver manually into the kernel. Am I on the right path?

2) Am I making too much work for myself? Is there some way to compile that driver into the kernel without manually modifying the config? Can I just compile it and load it with modprobe?

OK, that's 4 questions.

----------

## s2

The snd-ca0106 driver is in gentoo-dev-sources-2.6.11-r1 (my current kernel), listed as SB Audigy LS / Live 24bit.

Not sure at which version it was added, though.

You could still build the driver yourself if you need (doesn't need to be inside the kernel tree, ./configure should find that), and modprobe it, but since the driver is included in newer kernels, that shouldn't be necessary.

 :Smile: 

----------

## axlotl

oh, damn, I can't believe I didn't put my kernel version. It's gentoo-dev-sources for x86 which is 2.6.10-r6.

So I'm building this for someone else and then I'll only have access to it over a telephone line and modem because they live far away, so I need it to be fairly rock-solid. Call it a "production environment." How much can I rely on the 2.6.11-r1 kernel and where is it in portage? 

Or, alternatively, what parameters can I use to judge the stability of this more bleeding-edge kernel? Don't odd numbers refer to development branches? Or is that just for the second part of the version number (after the first dot, as in "2.5")? I guess I could always just give them a variety of grub options. "Use this one if you want sound, and use the other when you want everything else to work." Hmm.....

----------

## axlotl

OK, I see that =gentoo-dev-sources-2.6.11-r1 is masked by the ~x86 keyword, so I'm really reluctant to use it in this particular case, where it's not my computer. So the question I'm posting returns to the original one, namely, "How can I compile my own driver module to load into the kernel?" Or, should I load it as module, where do I put the module after I compile it? Are there configure flags I should look for? etc.

I'm not a programmer and compiling is kinda like a toaster for me: I put the bread in and push down the knob and assume I'll get toast out.

----------

## s2

Okay.

The instructions on the ALSA page you linked too are a bit more than you need.

Since the ALSA packages are in portage, you can save some work.

In /etc/make.conf, add

```
ALSA_CARDS="ca0106"
```

In the kernel, you'll need to enable all the relevant ALSA stuff (except choosing a specific driver).

Then just do a

```
emerge alsa-driver
```

That should will build and install the snd-ca0106 module.

The ALSA modules configuration file is located at /etc/modules.d/alsa

Emerging alsa-utils is a good idea too, gives the mixer app and a few other nifty things.

Now, whenever you upgrade the kernel, you'll have to re-emerge alsa-driver.

However, if you upgrade to a kernel that has the 1.0.8 ALSA drivers built in (i.e.  => 2.6.11), you'll need to UNmerge alsa-driver to avoid any conflicts (since the drivers are included in the kernel, there would be no need to build them elsewhere).

Note that I haven't tried this (SB Live Value on emu10k1 has been in the kernel for quite some time), but should work fine.

EDIT: As a side note, I've never had any problems with even the ~x86 gentoo-dev-sources, which I cannot say about some of the other patchsets in this forum (you know who you are...)

----------

## axlotl

I'm going to start working with this, but before I start I wanna post this problem with your first step, s2, in case you (or anyone) happens to respond whilst I try to figure out a workaround myself. (Probably first step I'm gonna compile a kernel without ALSA and try your step #1 again)

```

bash-2.05b# emerge -pv alsa-driver 

These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild  N    ] media-sound/alsa-driver-1.0.8_rc1  -debug -doc +oss 0 kB 

Total size of downloads: 0 kB

bash-2.05b# emerge -v alsa-driver

Calculating dependencies ...done!

>>> emerge (1 of 1) media-sound/alsa-driver-1.0.8_rc1 to /

>>> md5 src_uri ;-) alsa-driver-1.0.8rc1.tar.bz2

 * Determining the location of the kernel source code

 * Found kernel source directory:

 *     /usr/src/linux

 * Found sources for kernel version:

 *     2.6.10-gentoo-r6-snd_mod

 * Checking for suitable kernel configuration options

 *   ALSA is already compiled into the kernel.

 * Please check to make sure these options are set correctly.

 * Once you have satisfied these options, please try merging

 * this package again.

!!! ERROR: media-sound/alsa-driver-1.0.8_rc1 failed.

```

[edit]

Well, when alsa is compiled into the kernel, I can't emerge alsa-driver. When I don't compile alsa in, I can emerge alsa-driver, but (assumedly because there's no alsa) it doesn't drive the chipset when I load it. Possibly if I compile alsa as a module too? I'll try that now.

[/edit]

----------

## axlotl

OK, I've compiled about 20 kernels now, trying various combinations of this as module and that compiled into the kernel, and I'm tired of it. How does one set ~x86 as emergable? Isn't it a setting in /etc/make.conf? Can at least ONE other person tell me I can rely on gentoo-dev-sources-2.6.11-r1 is probably reliable for casual, non-system-taxing home use, at least provisionally? (Not that I don't trust you, s2, just that I'd like a second opinion).

I'll probably let this sit for a day or so and then just do it (I imagine I can find the environment flag for ~x86 by then).

[edit]

never mind, I remembered ACCEPT_KEYWORDS finally.

[/edit]

----------

## s2

Ok then.

My bad.  :Embarassed: 

You can do it with the alsa-driver-1.0.8 release, but you've got to update the files yourself, or get a kernel that has ALSA 1.0.8 built in.

If you want to do that download / copy from /usr/portage/distfiles the alsa-driver-1.0.8.tar.bz2 package to a temporary directory and (as root):

```
tar -xjf alsa-driver-1.0.8.tar.bz2

cp -R alsa-driver-1.0.8/alsa-kernel/* /usr/src/linux/sound/
```

That will update the kernel's sound stuff with the newer code from alsa-driver-1.0.8. Just adjust the kernel config, rebuild,  and you've got it.

Alternatively and mostly painless,

To set ~x86 for a specific package, add an entry to /etc/portage/package.keywords

such as

```
sys-kernel/gentoo-dev-sources ~x86
```

This way, you can keep your system on stable x86 profile while getting the latest versions only for packages of your choice.

You could switch to ~x86 systemwide by adding ~x86 to ACCEPT_KEYWORDS in /etc/make.conf, but that might take all day. (probably have to recompile the whole system as it tries to upgrade everything to ~x86)

[edit]

and just now I read your [edit]  :Twisted Evil: 

[/edit]

----------

## black hole sun

axlotl;

Compile in the kernel alsa (_not_ oss) and all of its options as built in (*). Then compile and use that kernel.

Then do

emerge alsa-libs && alsa-utils

Reboot and see what happens.  :Very Happy:  That always works for me, I have a SB Audigy 2

----------

## axlotl

Thanks for the help; I finally just used 2.6.11-r1. Note future users: on-board ethernet is burried deep (under a line beginning "EISA and...").

----------

