[alsa-devel] Pls don't require exclusive Alsa audio device access, use snd_pcm_dmix_open ()

thomas schorpp thomas.schorpp at googlemail.com
Wed Nov 28 10:06:18 CET 2007


thomas schorpp wrote:
> thomas schorpp wrote:
>> since dmix is enabled by libasound2 by default for cards not 
>> supporting h/w mixing.
>>
>> skype can access the audio device using snd_pcm_dmix_open () if other 
>> app has already opened it, ekiga throws error msgboxes.

skype      5089   skype  mem    CHR 116,24       7792 /dev/snd/pcmC0D0c
skype      5089   skype  mem    CHR 116,16       7784 /dev/snd/pcmC0D0p
kio_file   5422 schorpp    0r   CHR    1,3        956 /dev/null
kio_uiser  6025 schorpp    0r   CHR    1,3        956 /dev/null
iceape-bi 30161 schorpp  mem    CHR 116,16       7784 /dev/snd/pcmC0D0p
iceape-bi 30161 schorpp    0r   CHR    1,3        956 /dev/null
iceape-bi 30161 schorpp   66r   CHR 116,33       7473 /dev/snd/timer
iceape-bi 30161 schorpp   67u   CHR 116,16       7784 /dev/snd/pcmC0D0p

>>
>> y
>> tom
>>
> 
> hmm. takeback. future removal warning in alsa lib doc. well for 
> experiments (in ptlib plugin):
> 
> Index: sound_alsa.cxx
> ===================================================================
> --- sound_alsa.cxx      (Revision 18763)
> +++ sound_alsa.cxx      (Arbeitskopie)
> @@ -344,13 +344,15 @@
>     }
>   }
> 
> -  if (snd_pcm_open (&os_handle, real_device_name, stream, 
> SND_PCM_NONBLOCK) < 0) {
> +  if (snd_pcm_open (&os_handle, real_device_name, stream, 
> SND_PCM_NONBLOCK) < 0)
> 
> -    PTRACE (1, "ALSA\tOpen Failed");
> -    return FALSE;
> -  }
> -  else
> -    snd_pcm_nonblock (os_handle, 0);
> +    if (_snd_pcm_dmix_open (&os_handle, real_device_name, snd_config_t* 
> root, snd_config_t* sconf, stream, SND_PCM_NONBLOCK) < 0) {
> +
> +      PTRACE (1, "ALSA\tOpen Failed");
> +      return FALSE;
> +    }
> +    else
> +      snd_pcm_nonblock (os_handle, 0);
> 
>   /* save internal parameters */
>   device = real_device_name;
> 
> i cant find any sample code for the missing params, google is full of 
> alsa user issues ;)
> 
> y
> tom
> 

@alsa devs
any hints?



More information about the Alsa-devel mailing list