alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [alsa-devel] Period size setting is ignored when dmix is used
@ 2019-10-02 13:56 Andrea Narciso - ART S.p.A.
  2019-10-02 14:13 ` Jaroslav Kysela
  0 siblings, 1 reply; 2+ messages in thread
From: Andrea Narciso - ART S.p.A. @ 2019-10-02 13:56 UTC (permalink / raw)
  To: alsa-devel

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
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [alsa-devel] Period size setting is ignored when dmix is used
  2019-10-02 13:56 [alsa-devel] Period size setting is ignored when dmix is used Andrea Narciso - ART S.p.A.
@ 2019-10-02 14:13 ` Jaroslav Kysela
  0 siblings, 0 replies; 2+ messages in thread
From: Jaroslav Kysela @ 2019-10-02 14:13 UTC (permalink / raw)
  To: Andrea Narciso - ART S.p.A., alsa-devel

Dne 02. 10. 19 v 15:56 Andrea Narciso - ART S.p.A. napsal(a):
> 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? 

You must set these parameters in the dmix configuration which is shared by all
clients. You cannot set the buffer settings per application for the shared buffer.

					Jaroslav

-- 
Jaroslav Kysela <perex@perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-02 14:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-02 13:56 [alsa-devel] Period size setting is ignored when dmix is used Andrea Narciso - ART S.p.A.
2019-10-02 14:13 ` Jaroslav Kysela

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).