]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
SplitPCM: Set buffer parameters for dshare/dsnoop
authorJaroslav Kysela <perex@perex.cz>
Fri, 8 Jul 2022 12:54:58 +0000 (14:54 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 8 Jul 2022 12:56:18 +0000 (14:56 +0200)
Set the period time to 20ms and buffer time to 500ms by default.
For USB devices, use the period time 10ms for the better latency.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/USB-Audio/USB-Audio.conf
ucm2/common/pcm/split.conf

index 689982eec08d4c2c7b0fcdbf88ef97d2acb60212..776e4e71403f665460fc26f953214bd38dff03d4 100644 (file)
@@ -2,6 +2,7 @@ Syntax 6
 
 Define.ProfileName ""
 Define.MixerRemap ""
+Define.SplitPCMPeriodTime 10000                # 10ms
 
 If.linked {
        Condition {
index 95a65b55c0cf7d790f133404f465fdb73f4f60d8..a92a3b21c249bda340eca4b36c79668dbaaaca88 100644 (file)
@@ -23,6 +23,23 @@ DefineMacro.SplitPCM.If.0 {
                Empty "${var:@SplitPCM}"
        }
        True {
+               If.period_time {
+                       Condition {
+                               Type String
+                               Empty "${var:-SplitPCMPeriodTime}"
+                       }
+                       True.Define.__period_time 20000
+                       False.Define.__period_time "${var:SplitPCMPeriodTime}"
+               }
+               If.buffer_time {
+                       Condition {
+                               Type String
+                               Empty "${var:-SplitPCMBufferTime}"
+                       }
+                       True.Define.__buffer_time 500000
+                       False.Define.__buffer_time "${var:SplitPCMBufferTime}"
+               }
+
                LibraryConfig.pcm.SubstiConfig.pcm."${var:__Name}" {
                        @args [ CARD DEV CHN0 ]
                        @args {
@@ -40,6 +57,8 @@ DefineMacro.SplitPCM.If.0 {
                                        chmap [ "${var:__HWChannelPos0}" ]
                                }
                                channels "${evali:$__HWChannels}"
+                               period_time "${evali:$__period_time}"
+                               buffer_time "${evali:$__buffer_time}"
                        }
                        bindings.0 $CHN0
                }