alsa device name of 2nd sound card

If you've had any problems with Nexuiz, or would like to report bugs, post here.

Moderators: Nexuiz Moderators, Moderators

alsa device name of 2nd sound card

Postby sharkcow » Thu Jan 31, 2008 4:09 pm

Hi all,

I would like to use my 2nd sound card under linux with nexuiz. I would not like to change the alsa default but specify which card to use at the nexuiz command line. On the darkplaces engine homepage I found a list of command line options which specifies "-sndpcm devicename" for this purpose. However, I don't know what to use for the device name. When I enter "hw1,0" as e.g. in mplayer, nexuiz still uses the first sound card. Any hints?

thanks,

sharkcow
sharkcow
Newbie
 
Posts: 4
Joined: Thu Jan 31, 2008 3:58 pm

Postby oz » Thu Jan 31, 2008 7:54 pm

This is just a guess and I don't know if it works, so I suggest making proper backups now.

Change your /etc/asound.conf (or create it):
Code: Select all
pcm.!default {
        type hw
        card 1
}


I don't know, if you have to restart, reload modules or whatever...
oz
 

Postby sharkcow » Fri Feb 01, 2008 3:33 pm

well that would be making the card the alsa default, which is what I didn't want to do. I would just like to know what the syntax is for the command line option -snpcm.

thx anyways

sharkcow
sharkcow
Newbie
 
Posts: 4
Joined: Thu Jan 31, 2008 3:58 pm

Postby oz » Fri Feb 01, 2008 4:25 pm

What about that:

/etc/asound.conf
Code: Select all
pcm.foobar {
        type hw
        card 1
}


Command line
Code: Select all
$ nexuiz -sndpcm foobar


PS: I do not know where to obtain the names of the cards. I looked in /proc/asound/card*/id , but it's all upper case in there. That seemed somehow wrong. I looked in the darkplaces and the ALSA source files, but I couldn't find a hint. You know I really liked the oldschool OSS. It just worked and was easy to handle. ALSA sux. Word.
oz
 

Postby sharkcow » Sat Feb 02, 2008 3:25 pm

thanks for the tip. Doesn't seem to work, however. I've tried various combinations including an exclamation mark at the beginning of the alternative name (as it seems to be required for default) and specifying both a default and an additional card in the .asoundrc file. What makes me wonder is that I always get sound through the first soundcard no matter what I specify on the command line, unless I set another card to the default in .asoundrc. So it seems to me like the command line argument is never even looked at...!

sharkcow
sharkcow
Newbie
 
Posts: 4
Joined: Thu Jan 31, 2008 3:58 pm

Postby oz » Sat Feb 02, 2008 4:48 pm

The "!" is only used for "!default", because it is somehow special.

If audio is put out through SDL (which I did not see in the source), have a look at the SDL audio environment variables: http://docs.huihoo.com/sdl/1.2/sdlenvvars.html

That's how I think it works:
Code: Select all
export SDL_AUDIODRIVER=alsa   # making sure ALSA is used
export AUDIODEV=foobar   # setting "foobar" to be the sound output for SDL
nexuiz

It's worth one last try.
oz
 

Postby sharkcow » Sat Feb 02, 2008 5:04 pm

Great! This works!
So that means that I have successfully created an alias for my 2nd sound card but apparently can't convince the option -sndpcm to use it. I don't get it but this is a useful workaround.

thanks a million!

sharkcow
sharkcow
Newbie
 
Posts: 4
Joined: Thu Jan 31, 2008 3:58 pm


Return to Nexuiz - Support / Bugs

Who is online

Users browsing this forum: No registered users and 1 guest

cron