[alsa-devel] Alsa Application using the "default" plugin

Hauke Krüger public-hk at ind.rwth-aachen.de
Sun Aug 7 18:29:54 CEST 2016


Hi everyone,

I have created an ALSA audio application which works fine for any kind 
of hardware device (all devices addressed by "hw:n,m").

Today, I planned to implement the functionality to also address plugins. 
My test case is the "default" plugin.
When using this, I see significant differences:

1) Function "snd_pcm_hw_params_any" returns a value of 1. For hardware 
devices it returns 0. There is no documentation of the return type from 
that function. What does the 1 say?
2) I want to simultaneously capture and playback. Therefore I call 
"snd_pcm_link". This function fails with the error saying that this 
function is not implemented. Is that the intended behavior and how would 
I synchronize input and output? What I do to fix this is to start input 
and output ("snd_pcm_start") independently if "snd_pcm_link" fails.
3) The program stops working on the second call to "snd_pcm_writei": The 
function call simply never returns. I guess that the pcm output 
interface does not run at this moment and the output buffer has been 
completely filled before.

All other functions calls work as expected but the described behavior 
prevents the application from working properly. And - to repeat - the 
same code works for all hardware soundcards "hw:n,m" which I tested.

What is the recommended way to address the "default" plugin pcm device?

Best regards

Hauke


More information about the Alsa-devel mailing list