3. edit /etc/modules.d/alsa for your card (see the Gentoo ALSA guide and also the individual card pages on the ALSA website for how to do this)

4.

Code:

update-modules

5.

Code:

rc-update add alsasound boot

6.

Code:

alsamixer

- unmute what you need and set your levels

7.

Code:

alsactl store

8. Instead of rebooting, you can

Code:

/etc/init.d/alsasound start

Now this method means that the alsasound script takes care of loading the modules at boot, and restores your mixer settings, and also stores them when you shut down._________________Jingle Jangle Jewellery

when i compiled the alsa stuff in the kernel, i had all the important devices like /dev/dsp. when i compiled alsa as modules, only the mixer device was there!

i also recommend the built-in way!

No problems of that sort here. Do you have your /etc/modules.d/alsa set up correctly w.r.t. the oss portion? And do an update-modules before re-booting?

OK I'm glad my little contribution stimulated some discussion. First of all, I am not a Linux expert. So I apologize for any oversights or incompleteness. In fact I was seeking help a week ago, but since that post got no reply I decided to go another and perhaps better way.

So agent-jdh, thank you for providing an alternative way. I immediately tried to follow your suggestions, however I am unable to reproduce them completely. Your first step was:

Quote:

Configure the kernel with the ALSA stuff as modules

I interpreted that as answering "M" instead of "Y" to all options that were mentioned in my post. This is however not possible for OSS API simulation and OSS Sequencer API, so it should look like

However, after recompiling and the kernel and re-merging alsa-lib & alsa-utils, I still noticed that /etc/modules.d/alsa is missing, as it was before. Maybe I should create my own, or even edit /etc/modules.conf directly? The latter is suggested by the ALSA 2.6 documentation (/usr/src/linux-2.6.0-test6/Documentation/sound/alsa/ALSA-Configuration.txt), but strongly discouraged by comments in the file itself!

Further, alsasound was nowhere to be found, and I don't want of course to emerge alsa-driver. So what did I miss?

Finally, the problem that I have with my own setup is that I can't enable the mixer PCM control, and also that settings are not persistent across reboots. I admit that I have not enough knowledge to know why, but I may accidentally discover a solution, somehow. However, expert advice is more than welcome!

when i compiled the alsa stuff in the kernel, i had all the important devices like /dev/dsp. when i compiled alsa as modules, only the mixer device was there!

i also recommend the built-in way!

No problems of that sort here. Do you have your /etc/modules.d/alsa set up correctly w.r.t. the oss portion? And do an update-modules before re-booting?

OK I'm glad my little contribution stimulated some discussion. First of all, I am not a Linux expert. So I apologize for any oversights or incompleteness. In fact I was seeking help a week ago, but since that post got no reply I decided to go another and perhaps better way.

So agent-jdh, thank you for providing an alternative way. I immediately tried to follow your suggestions, however I am unable to reproduce them completely. Your first step was:

Quote:

Configure the kernel with the ALSA stuff as modules

I interpreted that as answering "M" instead of "Y" to all options that were mentioned in my post. This is however not possible for OSS API simulation and OSS Sequencer API, so it should look like

However, after recompiling and the kernel and re-merging alsa-lib & alsa-utils, I still noticed that /etc/modules.d/alsa is missing, as it was before. Maybe I should create my own, or even edit /etc/modules.conf directly? The latter is suggested by the ALSA 2.6 documentation (/usr/src/linux-2.6.0-test6/Documentation/sound/alsa/ALSA-Configuration.txt), but strongly discouraged by comments in the file itself!

Further, alsasound was nowhere to be found, and I don't want of course to emerge alsa-driver. So what did I miss?

Finally, the problem that I have with my own setup is that I can't enable the mixer PCM control, and also that settings are not persistent across reboots. I admit that I have not enough knowledge to know why, but I may accidentally discover a solution, somehow. However, expert advice is more than welcome!

Yes, you should be using 'M' dor _all_ the Alsa options when configuring your kernel. I notice you've still got some as <*> , they should al lbe <M>.

You should create your own /etc/modules.d/alsa then run update-modules. What update-modules does, incidentally, is to build your /etc/modules.conf for you by using the files stored in the /etc/modules.d folder. This means you don't have to edit /etc/modules.conf by hand.

The alsasound script should be installed with the latest alsa-utils (0.97). You might need to use the ACCEPT_KEYWORDS="~x86" (can't remember if you need the quotes, I have this option enabled in /etc/make.conf globally) to get the latest ebuild. You'll notice that when you emerge the latest alsa-utils, it pauses before copying the files across with a message about alsasound, and how it is now included with alsa-utils instead of alsa-driver for use with 2.6 kernels that don't work with alsa-driver.

However, at least one other user in a different alsa/2.6 kernel discussion thread said the /etc/init.d/alsasound file was never created (although he never told me what version of alsa-utils he was emerging), but the actual file is in the 'files' folder under the location of the alsa-utils ebuilds (I'm not at my Gentoo box at the moment, it's something like /usr/portage/media-sound/alsa-utils/files), so you can copy it over manually to /etc/init.d (as he did), and then do 'rc-update add alsasound boot'. To test alsasound is installed, run '/etc/init.d/alsasound start'.

As for OSS emulation, this depends on the contents of the /etc/modules.d/alsa file (remember, if you ever edit this file, you'll need to run update-modules and reboot for changes to take effect). Now I've just had a look at the Gentoo ALSA guide, and the information there is a bit thin. IIRC, I used a combination of the Gentoo ALSA guide and the information on the ALSA Project homepage for card-specific instructions. I can post my /etc/modules.d/alsa file later on from my Gentoo box if that would help you.

So after you've got all this set up, you can set the mixer settings using alsamixer, and once you have them to your satisfaction, running 'alsactl store' will save the settings to a file that the alsasound boot initialisation script will look for when you next boot, which should solve your problem with the mixer settings vanishing at boot. It also saves your current settings to the mixer file when you shut down._________________Jingle Jangle Jewellery

OK thanks once more . I'll give it a try later. My first reaction, however, is that it all seems a bit complicated since ALSA was included in the kernel, as well as the drivers. Also, manually creating such an important and complicated file like /etc/modules.d/alsa should never be necessary in my opinion, and at least be decently described in the documentation .

Kernel size to me is BTW not an issue since I never boot from floppies.

OK thanks once more . I'll give it a try later. My first reaction, however, is that it all seems a bit complicated since ALSA was included in the kernel, as well as the drivers. Also, manually creating such an important and complicated file like /etc/modules.d/alsa should never be necessary in my opinion, and at least be decently described in the documentation .

Kernel size to me is BTW not an issue since I never boot from floppies.

The whole Alsa thing is a bit of a pain actually. You've got to remember though, that 2.6 kernels are still beta, so you can't expect distros, even Gentoo, from playing 100% with them as easily as they would with a 2.4 kernel. Basically, if you're competent enough to feel safe using an unstable kernel, you should be capable of copying and editing a few files.

Now I've never had to copy across the alsasound file anyway, the alsa-utils ebuild installs it just fine here. Once you get your head around exactly how Alsa works, what the alsasound script does, and how it all interacts with your system/kernel, it all becomes clear._________________Jingle Jangle Jewellery

OK please post your /etc/modules.d/alsa file as I may learn from that. However, I should note that 2.6.0-test6 is not "unstable", just development. So far I haven't used ACCEPT_KEYWORDS="~x86"!

I didn't say it was unstable (although "doesn't boot on my system without kernel boot options I've _never_ had to use before, due to recent major APIC/ACPI surgery, could be interpreted as unstable by some), just a constantly moving target at the moment - which might mean it takes a while for other apps/distros to catch up with the changes. Just don't expect it to integrate as seamlessly as a 2.4 kernel quite yet.

Question - without the ~x86 keyword, what is the version of alsa-utils that is being installed?

Here's a copy of my /etc/modules.d/alsa. The only things you should need to change are the 'alias snd-card-0 snd-cs46xx' line for your card, and remove the last line as it is cs46xx-specific.

OK please post your /etc/modules.d/alsa file as I may learn from that. However, I should note that 2.6.0-test6 is not "unstable", just development. So far I haven't used ACCEPT_KEYWORDS="~x86"!

actually, you just have to emerge the alsa-utils with # ACCEPT_KEYWORDS="~x86" emerge alsa-utils and youre fine cause /etc/modules.d/alsa will be created automaticly. i had the same problem that i couldn't find the alsa file, but the new ebuild provides this file! then adjust your personal settings...

OK please post your /etc/modules.d/alsa file as I may learn from that. However, I should note that 2.6.0-test6 is not "unstable", just development. So far I haven't used ACCEPT_KEYWORDS="~x86"!

actually, you just have to emerge the alsa-utils with # ACCEPT_KEYWORDS="~x86" emerge alsa-utils and youre fine cause /etc/modules.d/alsa will be created automaticly. i had the same problem that i couldn't find the alsa file, but the new ebuild provides this file! then adjust your personal settings...

As well as providing the /etc/init.d/alsasound file. So it seems for best compatability with 2.6 kernels, you should be using the alsa-utils-0.9.7.ebuild._________________Jingle Jangle Jewellery

Indeed, there are 2 "alias" references to "snd-seq-oss" so that would imply twice "insmod"/"modprobe" and hence explain the error message?!

Also, I have now even set Sound Core support to "M" in the kernel.

I've got the same thing happening here, I wouldn't worry about it though, it doesn't have any effect on sound performance. It's just to do with the sequence the modules are loaded in. You could try playing around with the /etc/modules.d/alsa file, although I think the problem may lie in the alsasound script. Like I said, it is probably not set up to work 100% with 2.6 kernels yet, so don't expect it to be perfect. As long as it works ... (and correctly saves/restores your mixer settings ... that's the most important thing for me)._________________Jingle Jangle Jewellery

Thanks Helena
Excelent guide. Got my sound working in no time.
The alsa guide is really meant for 2.4 kernels and I don't there is no alsasound file when you go with 2.6.0 kernel and no need to search for it in the portage tree.

I've chosen a kernel support for my ALSA except OSS and PCI which I compiled as modules and added to
/etc/modules.autoload.d/kernel-2.6
trident
snd-pcm-oss (for /dev/dsp support)

and voila sound is working.
I used alsamixer to setup the sound to my liking and
alsactl store
To restore the the sound levels during the boot I added a line to
/etc/conf.d/local.start
alsactl restore

to the shutdown script in /etc/conf.d/local.stop. After trying agent_jdh's method for a while, I have now returned to my first method. It seems to me that built-in methods should always be preferred, and it also saves some time & effort when recompiling the kernel.

I too compiled alsa into the kernel, so I needed a way to restore the alsa settings.
I did not like the idea of writing alsactl into local.start/stop so I wrote a very simple script that will restore the settings at boot and store them at shutdown.