LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   SUSE / openSUSE (https://www.linuxquestions.org/questions/suse-opensuse-60/)
-   -   Default ALSA device in SUSE 10.0 (https://www.linuxquestions.org/questions/suse-opensuse-60/default-alsa-device-in-suse-10-0-a-556494/)

Lord_Grave 05-24-2007 07:36 PM

Default ALSA device in SUSE 10.0
 
SUSE 10.0 installs ALSA by default. I updated it with YOU to version 1.0.9-23.2 and I can't seem to configure default device in /etc/asound.conf. All I want is ALSA to use dmix plugin by default so I don't have to specify it separately for each application.

Here's my asound.conf:

pcm.ossmix {
type dmix
ipc_key 1024
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 8192
}
}
pcm.!default {
type plug
slave.pcm "ossmix"
}
pcm.dsp0 {
type plug
slave.pcm "ossmix"
}
ctl.mixer0 {
type hw
card 0
}


Now, when I tell a sound-producing application (aplay, alsaplayer, amaroK, wine, etc) to use dsp0 or ossmix device it works fine and they can all produce sound at the same time. However, if I don't specify a device only one application works although default entry is the same as dsp0. I've also tried to define it with pcm.default or simply to enter "pcm.default pcm.dsp0" line at the end of the file but nothing works.

I've read somewhere that ALSA that comes with SUSE requires default device to be specified with pcm.default (without !) but it seems to be a bad choice because all command line applications report the same ALSA error:

ALSA lib conf.c:1179: (parse_def) default is not a compound
ALSA lib conf.c:1592: (snd_config_load1) _toplevel_:11:13:Invalid argument
ALSA lib conf.c:2837: (snd_config_hook_load) /etc/asound.conf may be old or corrupted: consider to remove or fix it
ALSA lib conf.c:2700: (snd_config_hooks_call) function snd_config_hook_load returned error: Invalid argument
ALSA lib conf.c:3066: (snd_config_update_r) hooks failed, removing configuration


Does anyone know how to configure the default device for ALSA in SUSE 10.0?

tytower 05-25-2007 04:28 PM

I know nothing about the sound really but I see the following in the script
pcm.!default {
type plug
slave.pcm "ossmix"}

the "!" operator usually means "not" but maybe here its a reference to a variable or something.
as I read it it says "if pcm.default is not set" ? or "if pcm is not set to default"
Can someone explain this for me ?

Also Lord Grave where did you find asound.conf and I will have a look at mine in 10.2 ( I see above /etc/alsa.conf but in 10.2 no such file ! )

Lord_Grave 05-25-2007 10:28 PM

I've found the source of my problem. My default device was already defined in .asoundrc in my home folder, but I could swear it wasn't there when I looked for it before. I must have forgotten to check again after updating alsa or installing alsaplayer.

Anyway, tytower, ALSA can use different configuration files for sound devices. You can use /etc/asound.conf for systemwide settings, ~/.asoundrc for all users (this has the same effect as /etc/asound.conf and I have no idea which of the two seems to take precendence). You can also define devices for a single user with .asoundrc in a home directory. It seems that the home directory .asoundrc has the greatest priority, so you can set devices for all users and then define specific settings for specific users. If you are into programming, it's just like defining a class and then another that inherits it but can have some new or redefined properties. :)

Thanks for trying to help.


All times are GMT -5. The time now is 09:27 AM.