# Alsa again

## dek

Hi,

i read all the posts about alsa and the the Gentoo Linux Desktop Configuration Guide. But i can't get alsa to work properly with my SBLive.

What i've done so far:

- CONFIG_SOUND compiled into the kernel (nothing sound-related else).

- Emerged all the Alsa packages

- Added snd-emu10k1 to /etc/modules.autoload

- Added the alias stuff to /etc/modules.d

- Added my user to group audio

- Did all the amixer settings

- I skipped the MAKEDEV audio, since i use devfs

- rc-update add alsa default

alsasound gets started on bootup. I can use aplay to play wav files (and yes i can hear them! :Wink: ).

KDE complains about there is no device /dev/dsp. That is correct, i don't have /dev/dsp, nor /dev/sound/dsp. Why aren't they created by devfs ?

I can't hear anything when i try to play mp3s with xmms or freeamp...  :Sad: 

bye

dek

----------

## FINITE

If I didn't do the rc-update add alsa default what problems might that cause. Also acording to this https://forums.gentoo.org/viewtopic.php?t=1997&highlight=alsa+ac97 you do not need to modules.autoload because the new alsa is supposed to take care of loading the modules when it starts. So I skipped this step (for now anyways). My sound does not work though. Even playing wav files does not work. I get an IN OUT error. Not sure what is causing this but hopfully i can resolve it soon, getting tired of messing with ALSA man  :Very Happy: 

----------

## bevancoleman

Got a simular issue here, On my comp I can run alsasound from the cmd line without a prob, but when running from 'boot' it complains about being unable to load snd-card-0, snd-card-1, ...

----------

## dek

 *bevancoleman wrote:*   

> Got a simular issue here, On my comp I can run alsasound from the cmd line without a prob, but when running from 'boot' it complains about being unable to load snd-card-0, snd-card-1, ...

 

Well, that doesn't make any difference to me. It can start alsasound manually or at bootup.

But why is there no /dev/dsp ? Would be nice if someone who had more luck can explain what he did..

bye

dek

----------

## FINITE

bevancoleman:

Make sure that the module you are using for snd-card-1 etc is just snd-modulename. Read: alias snd-card-1 snd-via8233 (obviously replace via8233 with your module).

----------

## justus

The new Alsa 0.9 has a seperate ebuild for OSS (/dev/dsp) support.  You will need to emerge alsa-oss and then add snd-pcm-oss and snd-mixer-oss to modules.autoload.  This will allow programs to find /dev/dsp (as it will be autocreated when the modules are loaded) and also /dev/mixer (I believe.)

On another note, if you are using KDE and Arts is compiled with Alsa support then you can also go into the Control Panel (kcontrol), then into Sound, and then Sound Server.   Under the Sound I/O tab you will see the option to change Sound I/O Method.  This can be set to Alsa and then you will be able to use Alsa without a problem.  

Either way (KDE with Autodetect for Sound and snd-pcm-oss or just compiling Alsa into Arts and then setting Alsa as preferred Sound Method) it can all be set up and working easily  :Smile: 

Hope that helps...

Justin T

----------

## Guest

Yes finally got Alsa working.  :Very Happy: 

Thanks for your help! I had to re-emerge arts. I now have alsa in my USE variable.

Still have to run the amixer settings after bootup though, since it is muted by default. What is a good place to add these settings ? I normally put such settings to /etc/rc.local, but i don't have one. Can i create it.. or is it better to write a service script ?

regards

dek

----------

## Niek

 *Anonymous wrote:*   

> Yes finally got Alsa working. 
> 
> Thanks for your help! I had to re-emerge arts. I now have alsa in my USE variable.
> 
> Still have to run the amixer settings after bootup though, since it is muted by default. What is a good place to add these settings ? I normally put such settings to /etc/rc.local, but i don't have one. Can i create it.. or is it better to write a service script ?
> ...

 You can best write a small runlevel script like this:

```
#!/sbin/runscript

depend() {

        need localmount

}

start() {

        amixer set PCM 22 unmute

        amixer set PC\ Speaker 22 unmute

        amixer set Master 22 unmute

        amixer set Master\ Mono 22 unmute

        amixer set Headphone 22 unmute

        amixer set Phone 22 unmute

        amixer set Aux 22 unmute

        amixer set Video 22 unmute

        amixer set CD 22 unmute

        amixer set Input\ Gain 22 unmute

        amixer set Line 22 unmute

        amixer set MIC 22 unmute

}
```

Save this script as /etc/init.d/audiounmute and type 'rc-update add audiounmute default'.

Bye, Niek.

----------

## dek

Works fine, but i get the same error message many times on bootup. I haven't figured out where my boot messages are logged yet (using metalog). It is something like: "amixer : no such device".

In addition the script is executed all the time i run rc-update. How does it come ?

I solved it by adding "&> /dev/null" after every amixer call. There must be a cleaner way of doing it...

Anyway, thanks alot for your help!  :Wink: 

bye, dek

----------

## b1ind

Something that I though I should mention with respect to the newer Alsa drivers is that the message displayed at the end of the emerge command specifically says NOT to add alsasound to the 'default' runlevel, but rather to add it to the 'boot' runlevel.  This can be verified in the alsa-driver .ebuild.

----------

## FINITE

There is no /dev/dsp because it should be /dev/dsp0, dsp1 etc. etc.. I found this out trying to get XMMS to work cause it was pointed by default to /dev/dsp, changed to dsp0 and it works fine now.

----------

## dek

 *b1ind wrote:*   

> Something that I though I should mention with respect to the newer Alsa drivers is that the message displayed at the end of the emerge command specifically says NOT to add alsasound to the 'default' runlevel, but rather to add it to the 'boot' runlevel.  This can be verified in the alsa-driver .ebuild.

 

I haven't added alsasound to any runlevel. I think it is done by devfs on startup.

----------

