alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* SplitPCMDevice macro broken with two or more channels
       [not found] <1879dbef7ed4ea00-webhooks-bot@alsa-project.org>
@ 2025-11-20 23:49 ` GitHub issues - opened
  0 siblings, 0 replies; only message in thread
From: GitHub issues - opened @ 2025-11-20 23:49 UTC (permalink / raw)
  To: alsa-devel

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-11-20 23:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1879dbef7ed4ea00-webhooks-bot@alsa-project.org>
2025-11-20 23:49 ` SplitPCMDevice macro broken with two or more channels GitHub issues - opened

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).