From 1bb0739acfc9bbfe61ffaf4707ea9a9d98cdb82b Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 4 Dec 2025 16:26:23 +0100 Subject: [PATCH] USB-Audio: add support for conf.d configurations It may be useful to add new or override specific hardware configurations until they are merged to the main USB-Audio.conf file. Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/654 BugLink: https://github.com/alsa-project/alsa-ucm-conf/issues/609 Signed-off-by: Jaroslav Kysela --- ucm2/USB-Audio/USB-Audio.conf | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ucm2/USB-Audio/USB-Audio.conf b/ucm2/USB-Audio/USB-Audio.conf index fe840fa..7f7d865 100644 --- a/ucm2/USB-Audio/USB-Audio.conf +++ b/ucm2/USB-Audio/USB-Audio.conf @@ -1,8 +1,16 @@ Syntax 8 +# +# Optional configuration can be stored to USB-Audio/conf.d/{VENDOR}-{DEVICE}.conf files +# + Define.ProfileName "" Define.MixerRemap "" Define.SplitPCMPeriodTime 10000 # 10ms +DefineRegex.USBID { + Regex "USB([0-9a-f]{4}):([0-9a-f]{4})" + String "${CardComponents}" +} If.env1 { Condition { @@ -12,6 +20,10 @@ If.env1 { False.Define.SplitPCMPeriodTime "${env:UCM_USB_PERIOD_TIME}" } +# +# device specific configuration block +# + If.linked { Condition { Type RegexMatch @@ -616,6 +628,15 @@ If.beacn-studio { True.Define.ProfileName "Beacn/Beacn-Studio" } +# +# end of device specific configuration block +# + +If.opt.Append.Include.opt { + File "/USB-Audio/conf.d/${var:USBID1}-${var:USBID2}.conf" + Optional true +} + If.mixremap { Condition { Type String -- 2.47.3