You are not logged in.

#1 2014-04-02 11:53:13

Juszr
Member
Registered: 2013-03-12
Posts: 87

[SOLVED] multiple programs to play sound at once - ALSA

Hi. I'm having trouble trying to play a video while my Android emulator is opened. Here is some info:

$ lspci | grep -i audio
00:01.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Wrestler HDMI Audio
00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD] FCH Azalia Controller (rev 01)

$ cat /etc/asound.conf 
pcm.!default { 
    type hw 
    card Generic_1 
} 
ctl.!default { 
    type hw 
    card Generic_1 
} 

$ fuser -v /dev/snd/*
                     USER        PID ACCESS COMMAND
/dev/snd/pcmC1D0c:   nt       13235 F...m emulator64-x86
/dev/snd/pcmC1D0p:   nt       13235 F...m emulator64-x86

I'm using snd_hda_intel module with Alsa on a Lenovo G585 laptop. How can i fix this?

Last edited by Juszr (2014-04-02 18:49:40)

Offline

#2 2014-04-02 17:03:59

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED] multiple programs to play sound at once - ALSA

Read the last paragraph.

Offline

#3 2014-04-02 18:17:40

Juszr
Member
Registered: 2013-03-12
Posts: 87

Re: [SOLVED] multiple programs to play sound at once - ALSA

I've wrote the other way and it didn't work:

$ cat /etc/asound.conf

pcm.!default {
    type plug
    slave.pcm {
    @func getenv
    vars [ ALSAPCM ]
        default "hw:Generic_1"
                  }
}

$ speaker-test -c2 -f=cd

speaker-test 1.0.27.2

Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Playback open error: -16,Device or resource busy

Last edited by Juszr (2014-04-02 18:18:36)

Offline

#4 2014-04-02 18:29:41

Gusar
Member
Registered: 2009-08-25
Posts: 3,607

Re: [SOLVED] multiple programs to play sound at once - ALSA

Instead of playing with asound.conf, do this: https://bbs.archlinux.org/viewtopic.php … 3#p1344743

Offline

#5 2014-04-02 18:32:32

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED] multiple programs to play sound at once - ALSA

This is the last paragraph I was refering to:

Alsa_wiki wrote:

Simply setting a type hw as default card is equivalent to addressing hardware directly, which leaves the device unavailable to other applications. This method is only recommended if it is a part of a more sophisticated setup ~/.asoundrc or if user deliberately wants to address sound card directly (digital output through eic958 or dedicated music server for example).

Read the wiki up to this point, then it should be clear. You can use one of the ways stated, using an environment variable is useful if you  want to have the possibility of changing default device on the fly (for a specific application that does not have an option to select audio device). Otherwise in your case just use defaults node.

Offline

#6 2014-04-02 18:37:26

Juszr
Member
Registered: 2013-03-12
Posts: 87

Re: [SOLVED] multiple programs to play sound at once - ALSA

Gusar wrote:

Instead of playing with asound.conf, do this: https://bbs.archlinux.org/viewtopic.php … 3#p1344743

On a modprobe... file? Didn't work.

Last edited by Juszr (2014-04-02 18:38:38)

Offline

#7 2014-04-02 18:40:50

Gusar
Member
Registered: 2009-08-25
Posts: 3,607

Re: [SOLVED] multiple programs to play sound at once - ALSA

Juszr wrote:

On a modprobe... file? Didn't work.

That's not much to go on. Did you remove the asound.conf file? Did the order of audio cards change as it should, making FCH Azalia Controller the default instead of HDMI?

There is another method of changing the default audio card, I'll go search for it, but the one I linked to has never failed to work.

Offline

#8 2014-04-02 18:48:09

Juszr
Member
Registered: 2013-03-12
Posts: 87

Re: [SOLVED] multiple programs to play sound at once - ALSA

I made a mistake (syntax) tongue. It's working, thanks!
-Removing asound.conf and adding that to a new module file (and of course, restarting module).

Last edited by Juszr (2014-04-02 18:48:32)

Offline

Board footer

Powered by FluxBB