Skip to contentSkip to conversation

How do I make -D hw:0,1 default?

DISCUSSION Mark Knecht 4 participants 9 messages Jun 3, 2003

lore
Share & tools
lore
#0 lore raw

Hi,
Yesterday evening I found that I could use aplay -D hw:0,1 and get sound
out of Alsa. This was cool, but I don't normally do anything with aplay. Other apps that use sound are still locking up hard.

I thought the .asoundrc file was supposed to make this happen
automatically, but apparently the one on the sound card page at the Alsa site does not do this for me. Can someone tell me how to make this the default?

.asoundrc from Alsa site:

        pcm.via82xx {
           type hw
           card 0
        }

        ctl.via82xx {
           type hw
           card 0
        }

Maybe I need to include the ',1' interface somehow? How would I do that?

Thanks,
Mark

-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5

#1 lore raw
Quoted 22 lines · Mark Knecht

Hi,
Yesterday evening I found that I could use aplay -D hw:0,1 and get sound
out of Alsa. This was cool, but I don't normally do anything with aplay. Other apps that use sound are still locking up hard.

I thought the .asoundrc file was supposed to make this happen
automatically, but apparently the one on the sound card page at the Alsa site does not do this for me. Can someone tell me how to make this the default?

.asoundrc from Alsa site:

        pcm.via82xx {
           type hw
           card 0
        }

        ctl.via82xx {
           type hw
           card 0
        }
Quoted 1 line

Maybe I need to include the ',1' interface somehow? How would I do that?

Add 'device 1' to {} section.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs

-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5

#2 lore raw
Quoted 12 lines
Quoted 12 lines

.asoundrc from Alsa site:

        pcm.via82xx {
           type hw
           card 0
        }

        ctl.via82xx {
           type hw
           card 0
        }
Quoted 5 lines
Quoted 1 line

Maybe I need to include the ',1' interface somehow? How would I do that?

Add 'device 1' to {} section.

Jaroslav

Thanks Jaroslav!

Will this make device 1 default for all applications that require sound but do not ask for anything specific in terms of interfaces?

Also, please ignore the email I just sent to alsa-devel 10 seconds before your answer arrived at my desk.

Cheers,
Mark

-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5

#3 lore raw
Quoted 14 lines · Mark Knecht
Quoted 14 lines
Quoted 13 lines

.asoundrc from Alsa site:

        pcm.via82xx {
           type hw
           card 0
        }

        ctl.via82xx {
           type hw
           card 0
        }

Maybe I need to include the ',1' interface somehow? How would I do that?

Quoted 8 lines
Quoted 3 lines

Add 'device 1' to {} section.

Jaroslav

Thanks Jaroslav!

Will this make device 1 default for all applications that require sound but do not ask for anything specific in terms of interfaces?

The applications should use 'default' device name in that case. You can override it, of course:

pcm.!default {
... put your configuration here ...
}

You will propably copy pcm.via82xx configuration.

Or you can redirect the default device to some another pcm:

pcm.!default pcm.via82xx

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs

-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5

#4 lore raw
Quoted 11 lines · Jaroslav Kysela
Quoted 3 lines

Will this make device 1 default for all applications that require sound but do not ask for anything specific in terms of interfaces?

The applications should use 'default' device name in that case. You can override it, of course:

pcm.!default {
... put your configuration here ...
}

Quoted 7 lines

You will propably copy pcm.via82xx configuration.

Or you can redirect the default device to some another pcm:

pcm.!default pcm.via82xx

Jaroslav

Our messages are crossing in the ether! ;-)

OK, using pcm.!default worked great for the aplay example, but the game frozen-bubble still freezes up. Possibly it's a different problem?

Starting it from a terminal yields:

bash-2.05b$ frozen-bubble

        [[ Frozen-Bubble-1.0.0 ]]

<SNIP>

[SDL Init] [Graphics...] [Levels] [Sound Init]
Ready.

<SNIP - At this point I try to start playing the game, but the game is hung and the following message appears...>

ALSA lib pcm_hw.c:467:(snd_pcm_hw_prepare) SNDRV_PCM_IOCTL_PREPARE
failed: Device or resource busy
Killed
bash-2.05b$ !aplay
aplay -D hw:0,1 data/wave/seque~10.wav
Playing WAVE 'data/wave/seque~10.wav' : Signed 16 bit Little Endian, Rate 44100
Hz, Mono
bash-2.05b$

Looking at frozen-bubble's --help listing, I do not see a way to direct that game's sound to anything special, nor do I think I should have to, should I?

Thanks,
Mark

-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5

#5 lore raw
In reply to Mark Knecht
Quoted 7 lines · Mark Knecht
Quoted 4 lines

Add 'device 1' to {} section.

Jaroslav

Thanks Jaroslav!

Quoted 8 lines

Will this make device 1 default for all applications that require sound but do not ask for anything specific in terms of interfaces?

Also, please ignore the email I just sent to alsa-devel 10 seconds before your answer arrived at my desk.

Cheers,
Mark

Jaroslav,
This did not work for me. I made the edits to the .asoundrc file,
tried aplay with and without the -D, then tried restarting alsa and tried aplay again. It didn't work.

I did read some time ago that someone had trouble getting the
.asoundrc file to link up with the Alsa driver due to the exact name used in the .asoundrc file. Could something like that be happening here?

Thanks,
Mark

bash-2.05b$ aplay data/wave/seque~10.wav
Playing WAVE 'data/wave/seque~10.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
aplay: pcm_write:1025: write error: Input/output error

bash-2.05b$ aplay -D hw:0,1 data/wave/seque~10.wav Playing WAVE 'data/wave/seque~10.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono

bash-2.05b$ more .asoundrc
pcm.via82xx {
type hw
card 0
device 1
}

ctl.via82xx {
type hw
card 0
device 1
}
bash-2.05b$

Wizard root # /etc/init.d/alsasound restart
* Shutting down ALSA
modules.... [ ok ]
* Initialising
ALSA.... [ ok ]
* Starting sound driver: snd-via82xx
Wizard root # lsmod
Module Size Used by Not tainted

snd-via82xx            11692   0 
snd-ac97-codec         34624   0  [snd-via82xx]
snd-mpu401-uart         3456   0  [snd-via82xx]
snd-rawmidi            14432   0  [snd-mpu401-uart]
snd-seq-device          4192   0  [snd-rawmidi]
snd-pcm                60928   0  [snd-via82xx]
snd-timer              15240   0  [snd-pcm]
snd                    30852   0  [snd-via82xx snd-ac97-codec
snd-mpu401-uart snd-rawmidi snd-seq-device snd-pcm snd-timer]
ide-cd                 27048   0  (autoclean)
snd-page-alloc          4908   0  [snd-via82xx snd-pcm]

Wizard root #

Wizard root # exit
logout
bash-2.05b$ aplay data/wave/seque~10.wav
Playing WAVE 'data/wave/seque~10.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
aplay: pcm_write:1025: write error: Input/output error bash-2.05b$

-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5

#6 lore raw
Quoted 4 lines · On 03 Jun 2003 12:06:18 -0700 Mark Knecht <[email protected]> wrote:

Jaroslav,
This did not work for me. I made the edits to the .asoundrc file,
tried aplay with and without the -D, then tried restarting alsa and tried aplay again. It didn't work.

hi.. maybe i can add something.. here's a snippet from my .asoundrc

pcm.!default {
type hw
card 0
}

ctl.!default {
type hw
card 0
}

this creates a "default" pcm device which can point to any kind of pcm device.. here it refers to card 0 which is a hw device. maybe you cann add a "device 1" or "subdevice 1" to make it use the right pcm..

Signature · 8 lines
horrible sound clips - http://www.arted.biz/mista.tapas
buggy software - http://rythmaidgui.sourceforge.net


-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
#7 lore raw
Quoted 13 lines · Florian Schmidt

hi.. maybe i can add something.. here's a snippet from my .asoundrc

pcm.!default {
type hw
card 0
}

ctl.!default {
type hw
card 0
}

Quoted 3 lines

this creates a "default" pcm device which can point to any kind of pcm device.. here it refers to card 0 which is a hw device. maybe you cann add a "device 1" or "subdevice 1" to make it use the right pcm..

Florian,
Yes. Thanks. This is something Jaroslav pointed out later in the
morning. With this strategy I got at least a simple alsa application to play sounds cleanly, so this was helpful.

Can you shed any light on getting a game like frozen-bubble to use
Alsa? When I try to start this app it lock up with error messages about resources being busy.

Am I correct in guessing that an app like frozen-bubble is using the
OSS portion of Alsa? Is there some setup that I can do to point OSS sound requests to this default device?

Thanks much,
Mark

-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com.

#8 lore raw
In reply to Mark Knecht
Quoted 12 lines

.asoundrc from Alsa site:

        pcm.via82xx {
           type hw
           card 0
        }

        ctl.via82xx {
           type hw
           card 0
        }
Quoted 4 lines

Maybe I need to include the ',1' interface somehow? How would I do that?

Thanks,
Mark

Would this be correct?
(Info taken from
http://alsa.opensrc.org/index.php?page=.asoundrc
)

         pcm.via82xx {
            type hw
            card 0
            device 0
            subdevice 1
         }

         ctl.via82xx {
            type hw
            card 0
            device 0
            subdevice 1
         }

Or do I need to give it a different name and call it specifically for every application that needs sound? This is the part I cannot seem to find info on....

Thanks,
Mark

-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5