[alsa-devel] Period size setting is ignored when dmix is used

Andrea Narciso - ART S.p.A. andrea.narciso at artgroup-spa.com
Wed Oct 2 15:56:34 CEST 2019


I would like to set different period size (or time) values for different ALSA applications, in order to optimize latency and processor load based on specific application needs.
For example, a telephony application will use a shorter period size/time than a media player application, so that low latency does not affect the quality of the call. 
I found out that if dmix plugin is used in the ALSA path, period size/time settings are completely ignored and forced to default values (supposedly read from the ALSA driver of the HW card).

For example, not using dmix, period size value is correctly accepted (but of course I cannot play audio from multiple applications at the same time): 
aplay -vv --period-size=4096 -D plug:hw <WAV file name>
Plug PCM: Hardware PCM card 0 'HDA Intel' device 0 subdevice 0
...
  period_size  : 4096
...

Adding dmix instead, I can play audio from multiple applications at the same time, but period size is ignored and I cannot therefore set different latencies for different applications:
aplay -vv --period-size=4096 -D plug:dmix <WAV file name>
Plug PCM: Hardware PCM card 0 'HDA Intel' device 0 subdevice 0
...
  period_size  : 1024
...

Am I missing something? Is there a way to implement mixing + different latency settings in ALSA applications, without using an audio server? 

Thanks
Andrea


More information about the Alsa-devel mailing list