alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: GitHub issues - opened <github@alsa-project.org>
To: alsa-devel@alsa-project.org
Subject: SplitPCMDevice macro broken with two or more channels
Date: Fri, 21 Nov 2025 00:49:13 +0100 (CET)	[thread overview]
Message-ID: <1879dbef7fb81800-webhooks-bot@alsa-project.org> (raw)
In-Reply-To: <1879dbef7ed4ea00-webhooks-bot@alsa-project.org>

alsa-project/alsa-ucm-conf issue #646 was opened from karcsesz:

I have a Behringer XR18 that I am currently trying to write a custom UCM profile for that splits its 18x18 audio interface into separate mono and stereo virtual devices.

I am able to create mono devices using the `SplitPCM` and `SplitPCMDevice` macros, however only when none of the channels higher than Channel0 are defined, as the created Capture/PlaybackPCM configuration values have the channel IDs duplicated:

```
$ alsaucm -c3 dump text
[snip]
Verb."18x18 Stereo" {
	Comment "9x9 Stereo Duplex"
	Device."Ch1 In" {
		Comment "Ch1 from"
		Values {
			CaptureCTL "_ucm0001.hw:XR18"
			CaptureChannels 2
			CapturePCM "_ucm0001.behringer_xr18_stereo_in:XR18,0,0,1,1"
			PlaybackCTL "_ucm0001.hw:XR18"
		}
	}
	Device."Ch2 In" {
		Comment "Ch2 from"
		Values {
			CaptureCTL "_ucm0001.hw:XR18"
			CaptureChannels 2
			CapturePCM "_ucm0001.behringer_xr18_stereo_in:XR18,0,2,3,3"
			PlaybackCTL "_ucm0001.hw:XR18"
		}
	}
[snip]
```

`spa-acp-tool` also fails to find the PCM devices due to this issue
```
$ spa-acp-tool -vvv -c3
[snip]
I       alsa-ucm.c:2567      Probing profile 18x18 Stereo
I       alsa-ucm.c:2571      Set ucm verb to 18x18 Stereo
D      alsa-util.c:714         Trying _ucm0001.behringer_xr18_stereo_in:XR18,0,16,17,17 with SND_PCM_NO_AUTO_FORMAT ...
I           conf.c:5541      Unknown parameter 4
I           conf.c:5712      Parse arguments error: No such file or directory
I            pcm.c:2722      Unknown PCM behringer_xr18_stereo_in:XR18,0,16,17,17
I      alsa-util.c:721       Error opening PCM device _ucm0001.behringer_xr18_stereo_in:XR18,0,16,17,17: No such file or directory
I       alsa-ucm.c:2611      Profile '18x18 Stereo' mapping '18x18 Stereo: Ch9 In: source': input PCM open failed
I       alsa-ucm.c:2621      Profile 18x18 Stereo not supported
```
Appropriate snippet from the verb configuration:
```
Include.pcm_split.File "/common/pcm/split.conf"

Macro [
[snip]
	{
		SplitPCM {
			Name "behringer_xr18_stereo_in"
			Direction Capture
			Format S24_3LE
			Channels 2
			HWChannels 18
			HWChannelPos0 FL
			HWChannelPos1 FR
			HWChannelPos2 FL
			HWChannelPos3 FR
			HWChannelPos4 FL
			HWChannelPos5 FR
			HWChannelPos6 FL
			HWChannelPos7 FR
			HWChannelPos8 FL
			HWChannelPos9 FR
			HWChannelPos10 FL
			HWChannelPos11 FR
			HWChannelPos12 FL
			HWChannelPos13 FR
			HWChannelPos14 FL
			HWChannelPos15 FR
			HWChannelPos16 FL
			HWChannelPos17 FR
		}
	}
[snip]
]
[snip]
SectionDevice."Ch1 In" {
	Comment "Ch1 from"
	Macro.pcm_split.SplitPCMDevice {
		Name "behringer_xr18_stereo_in"
		Direction Capture
		HwChannels 18
		Channels 2
		Channel0 0
		Channel1 1
		ChannelPos0 FL
		ChannelPos1 FR
	}
}

SectionDevice."Ch2 In" {
	Comment "Ch2 from"
	Macro.pcm_split.SplitPCMDevice {
		Name "behringer_xr18_stereo_in"
		Direction Capture
		HwChannels 18
		Channels 2
		Channel0 2
		Channel1 3
		ChannelPos0 FL
		ChannelPos1 FR
	}
}
[snip]
```

My current hunch is the append within the `SplitPCMDevice_addchn` macro somehow getting called twice (maybe due to [evaluation restart](https://www.alsa-project.org/alsa-doc/alsa-lib/group__ucm__conf.html#autotoc_md18)?)

[alsa-info.txt](https://github.com/user-attachments/files/23665421/alsa-info.txt)

Issue URL     : https://github.com/alsa-project/alsa-ucm-conf/issues/646
Repository URL: https://github.com/alsa-project/alsa-ucm-conf

           reply	other threads:[~2025-11-20 23:50 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1879dbef7ed4ea00-webhooks-bot@alsa-project.org>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1879dbef7fb81800-webhooks-bot@alsa-project.org \
    --to=github@alsa-project.org \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).