Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add profile for Behringer UMC204HD #128

Closed
wants to merge 8 commits into from
Closed

Conversation

brndd
Copy link
Contributor

@brndd brndd commented Dec 12, 2021

Adds a profile for the Behringer UMC204HD to split a 4-channel output into two outputs, and a 2-channel input into two inputs, as per the physical layout of the device. I have very little idea what I'm doing, so let me know if something looks incorrect (there's one thing that looks incorrect even to me which I shall point out in a comment below). The config does at least work, though.

alsa-info.txt


UMC204HD_P0BK0_Front_XL
UMC204HD_P0BK0_Rear_XL

@brndd
Copy link
Contributor Author

brndd commented Dec 12, 2021

Also, it seems when using this profile the auto-configured profiles for the device (eg. "Pro Audio") become unavailable. Is this a feature or a bug?

ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf Outdated Show resolved Hide resolved
ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf Outdated Show resolved Hide resolved
ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf Outdated Show resolved Hide resolved
@brndd
Copy link
Contributor Author

brndd commented Dec 13, 2021

If I change the inputs as you suggested, the configuration breaks; spa-acp-tool list reports only one available profile and that's the "off" profile, and I get no usable audio streams. I do not know how to get any kind of useful debug information out of the system as to why this breaks the configuration. Any suggestions?

Here's the relevant parts as I modified them:

	pcm.umc204hd_mono_in {
		@args [ CARD CHN0 ]
		@args {
			CARD.type string
			CHN0.type integer
		}
		type dsnoop
		ipc_key 572542
		ipc_perm 0600
		slave {
			pcm {
				type hw
				card $CARD
				device 0
			}
			channels 2
		}
		bindings.0 $CHN0
	}

	pcm.umc204hd_mic1 {
		@args [ CARD ]
		@args.CARD.type string
		type empty
		slave.pcm {
			@func concat
			strings [ "umc204hd_mono_in:" $CARD ",0" ]
		}
	}

	pcm.umc204hd_mic2 {
		@args [ CARD ]
		@args.CARD.type string
		type empty
		slave.pcm {
			@func concat
			strings [ "umc204hd_mono_in:" $CARD ",1" ]
		}
	}

edit: and yeah, that's my alsa-info output. I also attached it in the pull request.

@brndd
Copy link
Contributor Author

brndd commented Dec 13, 2021

I tried adding the volume controls using PlaybackMixerElem and CaptureMixerElem like this, but it doesn't seem to do anything:

SectionDevice."Line1" {
	Comment "Line A"
	Value {
		PlaybackPriority 100
		PlaybackPCM "umc204hd_line1:${CardId}"
		PlaybackMixerElem "Line A"
	}
}

Am I correct in assuming these volume controls would be the ones that show up in alsamixer, and the PlaybackMixerElem should change the name of the control? This is what they look like currently, with labels added for which channels they control:

2021-12-13T01:29:36

@perexg
Copy link
Member

perexg commented Dec 13, 2021

If I change the inputs as you suggested, the configuration breaks; spa-acp-tool list reports only one available profile and that's the "off" profile, and I get no usable audio streams. I do not know how to get any kind of useful debug information out of the system as to why this breaks the configuration. Any suggestions?

You can copy the config in the LibraryConfig to your ~/.asoundrc file and test the PCM using arecord like: arecord -Dumc204hd_mic2:U192k -f dat -c 1 -v a.wav

Am I correct in assuming these volume controls would be the ones that show up in alsamixer, and the PlaybackMixerElem should change the name of the control?

Use amixer -c U192k for example to get control names for MixerElem values.

@brndd
Copy link
Contributor Author

brndd commented Dec 13, 2021

You can copy the config in the LibraryConfig to your ~/.asoundrc file and test the PCM using arecord like: arecord -Dumc204hd_mic2:U192k -f dat -c 1 -v a.wav

Alright, this is strange. When I do it like that (though I had to replace -f dat with -f S32_LE or else it would complain about an unsupported format), the configuration works fine. It records a .wav file that only has one channel. However, if I do the exact same modifications to the live configuration, sound stops working altogether. Here is the .asoundrc: .asoundrc.txt


Use amixer -c U192k for example to get control names for MixerElem values.

I tried defining them like this, but nothing seemed to change. What should I be looking for to begin with? Also, these volume controls also need to be "split"; the "UMC204HD 192k Output" control has 4 channels (FL FR RL RR) when physically the device has two stereo outputs. Is that possible?

SectionDevice."Line1" {
	Comment "Line A"
	Value {
		PlaybackPriority 100
		PlaybackPCM "umc204hd_line1:${CardId}"
		PlaybackMixer "Line A"
		PlaybackMixerElem "UMC204HD 192k Output"
	}
}

SectionDevice."Line2" {
	Comment "Line B"

	Value {
		PlaybackPriority 200
		PlaybackPCM "umc204hd_line2:${CardId}"
		PlaybackMixer "Line B"
		PlaybackMixerElem "UMC204HD 192k Output"
	}
}

@perexg
Copy link
Member

perexg commented Dec 14, 2021

You can copy the config in the LibraryConfig to your ~/.asoundrc file and test the PCM using arecord like: arecord -Dumc204hd_mic2:U192k -f dat -c 1 -v a.wav

However, if I do the exact same modifications to the live configuration, sound stops working altogether.

We need pipewire logs - it seems that pw does not like S32_LE / mono combination.

I tried defining them like this, but nothing seemed to change.

Remove PlaybackMixer lines. The split may be configured using another alsa-lib's plugin (LibraryConfig):

       ctl.umc204hd {
                @args [ CARD ]
                @args.CARD.type string
                type remap
                child {
                        type hw
                        card $CARD
                }
                map {
                        "name='Line A Playback Volume'"."name='UMC204HD 192k Output Volume'" {
                               vindex.0 0
                               vindex.1 1
                         },
                        "name='Line A Playback Switch'"."name='UMC204HD 192k Output Switch'" {
                               vindex.0 0
                               vindex.1 1
                         },
                        "name='Line B Playback Volume'"."name='UMC204HD 192k Output Volume'" {
                               vindex.0 2
                               vindex.1 3
                         },
                        "name='Line A Playback Switch'"."name='UMC204HD 192k Output Switch'" {
                               vindex.0 2
                               vindex.1 3
                         }
                }
        }

Add lines `PlaybackCTL "umc204hd:${CardId}"' to the appropriate devices.

@brndd
Copy link
Contributor Author

brndd commented Dec 15, 2021

OK, I attempted to add the volume controls (the changes are now in the PR), but I think they still aren't working correctly. I'm not observing any actual effect from adding them, but maybe I'm just not looking in the right places. What does describing the volume controls actually do? What can I do to verify that I've configured them correctly?

We need pipewire logs - it seems that pw does not like S32_LE / mono combination.

I tried getting logs out of Pipewire, but it doesn't seem to output anything as to why the config is failing. I'll try asking the Pipewire folks. Asked the Pipewire folks and indeed it seems PW is not trying S32_LE for some reason; spa-acp-tool -vvvv list outputs this (among other things):

Managed to open _ucm0001.umc204hd_mic2:U192k
snd_pcm_hw_params_set_format(Signed 16 bit Little Endian) failed: Invalid argument
snd_pcm_hw_params_set_format(Signed 16 bit Big Endian) failed: Invalid argument
snd_pcm_hw_params_set_format(Float 32 bit Little Endian) failed: Invalid argument
snd_pcm_hw_params_set_format(Float 32 bit Big Endian) failed: Invalid argument
snd_pcm_hw_params_set_channels(2) failed: Invalid argument
Trying _ucm0001.umc204hd_mic2:U192k without SND_PCM_NO_AUTO_FORMAT ...

EDIT: The actual error seems to have been elsewhere in the output: UCM file does not specify 'CaptureChannels' for device Mic1, assuming stereo. After specifying CaptureChannels, the config works with Pipewire 🥳

EDIT2: Oh, about the ip_key value. How should it be selected? Looking at the documentation, it says it needs to be unique but not much else about what goes into it, so I just generated a random number and used that. Should it be more deterministic than that?

@perexg
Copy link
Member

perexg commented Mar 9, 2022

OK, I attempted to add the volume controls (the changes are now in the PR), but I think they still aren't working correctly. I'm not observing any actual effect from adding them, but maybe I'm just not looking in the right places. What does describing the volume controls actually do? What can I do to verify that I've configured them correctly?

Just check, if the stereo control maps correctly to the 'UMC204HD 192k Output Volume' and switch: amixer cget name='UMC204HD 192k Output Volume'. It may be useful to put the config to ~/.asoundrc and test it directly using amixer tool like amixer -Dumc204hd:0, where 0 is the ALSA card number.

After specifying CaptureChannels, the config works with Pipewire

The stereo (value 2) is the default. It should be omitted (the functionality should be equivalent).

Oh, about the ip_key value. How should it be selected?

I don't think that there's a mapping scheme for this key. It should be just unique in the whole system.

@brndd
Copy link
Contributor Author

brndd commented May 3, 2022

Alright, I think the controls should be right on paper now. Putting the config in ~/.asoundrc and running amixer -Dumc204hd:1 contents shows them, and they seem to correctly map to the controls shown in alsamixer.

However, I still can't actually find the remapped controls I have created (eg. Line A Playback Volume) anywhere when I place the configuration in /usr/share/alsa/ucm2/. Running amixer -c U192k controls does not list them, even if I restart PipeWire/Wireplumber or reboot, and they also aren't visible in alsamixer.

$ amixer -c U192k controls
numid=7,iface=CARD,name='UMC204HD 192k Internal Clock Validity'
numid=8,iface=MIXER,name='Mic Capture Switch'
numid=9,iface=MIXER,name='Mic Capture Switch',index=1
numid=10,iface=MIXER,name='Mic Capture Volume'
numid=11,iface=MIXER,name='Mic Capture Volume',index=1
numid=3,iface=MIXER,name='UMC204HD 192k Output Playback Switch'
numid=4,iface=MIXER,name='UMC204HD 192k Output Playback Switch',index=1
numid=5,iface=MIXER,name='UMC204HD 192k Output Playback Volume'
numid=6,iface=MIXER,name='UMC204HD 192k Output Playback Volume',index=1
numid=2,iface=PCM,name='Capture Channel Map'
numid=1,iface=PCM,name='Playback Channel Map'

Could this be a PipeWire-related issue, since amixer is parsing the configuration just fine when it's in ~/.asoundrc?

Thanks for the help :)

@perexg
Copy link
Member

perexg commented May 3, 2022

Thanks for the feedback.

The ' and " switch should not be necessary (otherwise it's an error somewhere).

This config is not exported as the default alsa-lib configuration for now (so amixer do not see it). It's a private configuration for UCM applications only. I'll propose a solution soon.

Pipewire: What does say spa-acp-tool (use -c argument with the right card number)?

@brndd
Copy link
Contributor Author

brndd commented May 3, 2022

The ' and " switch should not be necessary (otherwise it's an error somewhere).

Yeah, this is just something I tried in desperation and didn't undo.

Pipewire: What does say spa-acp-tool (use -c argument with the right card number)?

`spa-acp-tool -c 0 -vvvv info` output (click)
$ spa-acp-tool -c 0 -vvvv info
UCM available for card hw:0
UCM _alibpref=_ucm0001.
Set UCM verb to HiFi
Got CapturePCM for device Mic2: _ucm0001.umc204hd_mic2:U192k
Got PlaybackCTL for device Mic2: _ucm0001.hw:U192k
Got CaptureCTL for device Mic2: _ucm0001.umc204hd:U192k
Got CapturePriority for device Mic2: 100
Got CaptureChannels for device Mic2: 1
No _conflictingdevs for device Mic2
No _supporteddevs for device Mic2
Got CapturePCM for device Mic1: _ucm0001.umc204hd_mic1:U192k
Got PlaybackCTL for device Mic1: _ucm0001.hw:U192k
Got CaptureCTL for device Mic1: _ucm0001.umc204hd:U192k
Got CapturePriority for device Mic1: 200
Got CaptureChannels for device Mic1: 1
No _conflictingdevs for device Mic1
No _supporteddevs for device Mic1
Got PlaybackPCM for device Line2: _ucm0001.umc204hd_line2:U192k
Got PlaybackCTL for device Line2: _ucm0001.umc204hd:U192k
Got PlaybackPriority for device Line2: 100
Got PlaybackChannels for device Line2: 2
Got CaptureCTL for device Line2: _ucm0001.hw:U192k
No _conflictingdevs for device Line2
No _supporteddevs for device Line2
Got PlaybackPCM for device Line1: _ucm0001.umc204hd_line1:U192k
Got PlaybackCTL for device Line1: _ucm0001.umc204hd:U192k
Got PlaybackPriority for device Line1: 200
Got PlaybackChannels for device Line1: 2
Got CaptureCTL for device Line1: _ucm0001.hw:U192k
No _conflictingdevs for device Line1
No _supporteddevs for device Line1
Found UCM profiles
UCM mapping: HiFi: umc204hd_mic2:U192k: source dev Mic2
UCM mapping: HiFi: umc204hd_mic1:U192k: source dev Mic1
UCM mapping: HiFi: umc204hd_line2:U192k: sink dev Line2
UCM mapping: HiFi: umc204hd_line1:U192k: sink dev Line1
Profile HiFi (Default), input=null, output=null priority=8000, supported=yes n_input_mappings=2, n_output_mappings=2
Input HiFi: umc204hd_mic2:U192k: source
Input HiFi: umc204hd_mic1:U192k: source
Output HiFi: umc204hd_line2:U192k: sink
Output HiFi: umc204hd_line1:U192k: sink
Set ucm verb to HiFi
Trying _ucm0001.umc204hd_line2:U192k with SND_PCM_NO_AUTO_FORMAT ...
Managed to open _ucm0001.umc204hd_line2:U192k
Maximum hw buffer size is 375 ms
Set buffer size first (to 4797 samples), period size second (to 1199 samples).
Device umc204hd_stereo_out:U192k,2,3 doesn't support 44100 Hz, changed to 48000 Hz.
Trying _ucm0001.umc204hd_line1:U192k with SND_PCM_NO_AUTO_FORMAT ...
Managed to open _ucm0001.umc204hd_line1:U192k
Maximum hw buffer size is 375 ms
Set buffer size first (to 4797 samples), period size second (to 1199 samples).
Device umc204hd_stereo_out:U192k,0,1 doesn't support 44100 Hz, changed to 48000 Hz.
Trying _ucm0001.umc204hd_mic2:U192k with SND_PCM_NO_AUTO_FORMAT ...
Managed to open _ucm0001.umc204hd_mic2:U192k
snd_pcm_hw_params_set_format(Signed 16 bit Little Endian) failed: Invalid argument
snd_pcm_hw_params_set_format(Signed 16 bit Big Endian) failed: Invalid argument
snd_pcm_hw_params_set_format(Float 32 bit Little Endian) failed: Invalid argument
snd_pcm_hw_params_set_format(Float 32 bit Big Endian) failed: Invalid argument
Maximum hw buffer size is 375 ms
Set buffer size first (to 4797 samples), period size second (to 1199 samples).
Device umc204hd_mono_in:U192k,1 doesn't support 44100 Hz, changed to 48000 Hz.
Device umc204hd_mono_in:U192k,1 doesn't support sample format s16le, changed to s32le.
Trying _ucm0001.umc204hd_mic1:U192k with SND_PCM_NO_AUTO_FORMAT ...
Managed to open _ucm0001.umc204hd_mic1:U192k
snd_pcm_hw_params_set_format(Signed 16 bit Little Endian) failed: Invalid argument
snd_pcm_hw_params_set_format(Signed 16 bit Big Endian) failed: Invalid argument
snd_pcm_hw_params_set_format(Float 32 bit Little Endian) failed: Invalid argument
snd_pcm_hw_params_set_format(Float 32 bit Big Endian) failed: Invalid argument
Maximum hw buffer size is 375 ms
Set buffer size first (to 4797 samples), period size second (to 1199 samples).
Device umc204hd_mono_in:U192k,0 doesn't support 44100 Hz, changed to 48000 Hz.
Device umc204hd_mono_in:U192k,0 doesn't support sample format s16le, changed to s32le.
Profile HiFi supported.
Check device Line2 conformance with 0 other devices
First device in combination, number 1
Add port [Out] Line2: Line B
Port [Out] Line2 direction output, priority 100
Adding profile HiFi to port [Out] Line2.
Check device Line2 conformance with 0 other devices
First device in combination, number 1
Port [Out] Line2 direction output, priority 100
Successfully attached to mixer '_ucm0001.umc204hd:U192k'
ALSA device (null) roles: null
Check device Line1 conformance with 0 other devices
First device in combination, number 1
Add port [Out] Line1: Line A
Port [Out] Line1 direction output, priority 200
Adding profile HiFi to port [Out] Line1.
Check device Line1 conformance with 0 other devices
First device in combination, number 1
Port [Out] Line1 direction output, priority 200
ALSA device (null) roles: null
Check device Mic2 conformance with 0 other devices
First device in combination, number 1
Add port [In] Mic2: Input 2
Port [In] Mic2 direction input, priority 100
Adding profile HiFi to port [In] Mic2.
Check device Mic2 conformance with 0 other devices
First device in combination, number 1
Port [In] Mic2 direction input, priority 100
ALSA device (null) roles: null
Check device Mic1 conformance with 0 other devices
First device in combination, number 1
Add port [In] Mic1: Input 1
Port [In] Mic1 direction input, priority 200
Adding profile HiFi to port [In] Mic1.
Check device Mic1 conformance with 0 other devices
First device in combination, number 1
Port [In] Mic1 direction input, priority 200
ALSA device (null) roles: null
Found 0 jacks.
activate profile: HiFi (1)
Set UCM verb to HiFi
Updating mixer path for HiFi: [Out] Line2
Updating mixer path for HiFi: [Out] Line1
Updating mixer path for HiFi: [In] Mic2
Updating mixer path for HiFi: [In] Mic1
Check device Line2 conformance with 0 other devices
First device in combination, number 1
Port [Out] Line2 direction output, priority 100
Adding profile HiFi to port [Out] Line2.
Device: Line B mapping 'Line B' (HiFi: umc204hd_line2:U192k: sink).
Enable ucm device Line2
Check device Line1 conformance with 0 other devices
First device in combination, number 1
Port [Out] Line1 direction output, priority 200
Adding profile HiFi to port [Out] Line1.
Device: Line A mapping 'Line A' (HiFi: umc204hd_line1:U192k: sink).
Enable ucm device Line1
Check device Mic2 conformance with 0 other devices
First device in combination, number 1
Port [In] Mic2 direction input, priority 100
Adding profile HiFi to port [In] Mic2.
Device: Input 2 mapping 'Input 2' (HiFi: umc204hd_mic2:U192k: source).
Enable ucm device Mic2
Check device Mic1 conformance with 0 other devices
First device in combination, number 1
Port [In] Mic1 direction input, priority 200
Adding profile HiFi to port [In] Mic1.
Device: Input 1 mapping 'Input 1' (HiFi: umc204hd_mic1:U192k: source).
Enable ucm device Mic1
Successfully attached to mixer '_ucm0001.hw:0'
ALSA alias mixers: _ucm0001.hw:0 = _ucm0001.hw:U192k
No ELD device found for port [Out] Line2 (0).
No ELD device found for port [Out] Line1 (0).
No ELD device found for port [In] Mic2 (0).
No ELD device found for port [In] Mic1 (0).
card 0: profiles:2 devices:4 ports:4
    properties: (8)
        use-ucm = "true"
        verbose = "true"
        alsa.card = "0"
        alsa.card_name = "UMC204HD 192k"
        alsa.long_card_name = "BEHRINGER UMC204HD 192k at usb-0000:00:14.0-7.3, high speed"
        alsa.driver_name = "snd_usb_audio"
        device.string = "0"
        device.description = "UMC204HD 192k"

@perexg
Copy link
Member

perexg commented May 4, 2022

Thanks, please, try to replace PlaybackCTL with PlaybackMixer. Ditto for capture (CaptureCTL -> CaptureMixer).

@perexg
Copy link
Member

perexg commented May 4, 2022

Also, PlaybackMixerElem and CaptureMixerElem lines are missing. I've tried to make all corrections for a test:

perexg@bed9728

EDIT:

The second patch should resolve amixer / alsamixer controls visibility:

perexg@9723a9b

perexg pushed a commit to perexg/alsa-ucm-conf that referenced this pull request May 4, 2022
Link: alsa-project#128
Signed-off-by: Peter Wedder <burneddi@gmail.com>
perexg added a commit to perexg/alsa-ucm-conf that referenced this pull request May 4, 2022
Link: alsa-project#128
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
@brndd
Copy link
Contributor Author

brndd commented May 4, 2022

The second patch seems to work! I had to reboot after applying it (systemctl --user restart pipewire{,-pulse} wireplumber didn't seem to be enough), but now the controls appear in alsamixer and amixer, and the desktop volume control applet adjusts them as one would expect:

alsamixer.mp4
amixer -c U192k controls
$ amixer -c U192k controls
numid=15,iface=CARD,name='UMC204HD 192k Internal Clock Validity'
numid=2,iface=MIXER,name='Line A Playback Switch'
numid=1,iface=MIXER,name='Line A Playback Volume'
numid=4,iface=MIXER,name='Line B Playback Switch'
numid=3,iface=MIXER,name='Line B Playback Volume'
numid=16,iface=MIXER,name='Mic Capture Switch'
numid=17,iface=MIXER,name='Mic Capture Switch',index=1
numid=18,iface=MIXER,name='Mic Capture Volume'
numid=19,iface=MIXER,name='Mic Capture Volume',index=1
numid=6,iface=MIXER,name='Input 1 Capture Switch'
numid=5,iface=MIXER,name='Input 1 Capture Volume'
numid=8,iface=MIXER,name='Input 2 Capture Switch'
numid=7,iface=MIXER,name='Input 2 Capture Volume'
numid=11,iface=MIXER,name='UMC204HD 192k Output Playback Switch'
numid=12,iface=MIXER,name='UMC204HD 192k Output Playback Switch',index=1
numid=13,iface=MIXER,name='UMC204HD 192k Output Playback Volume'
numid=14,iface=MIXER,name='UMC204HD 192k Output Playback Volume',index=1
numid=10,iface=PCM,name='Capture Channel Map'
numid=9,iface=PCM,name='Playback Channel Map'

I would never have figured that out on my own, thanks.

@perexg
Copy link
Member

perexg commented May 4, 2022

Thanks, could you verify both patches so I can apply this to the main repo ?

@brndd
Copy link
Contributor Author

brndd commented May 4, 2022

Thanks, could you verify both patches so I can apply this to the main repo ?

I did try both patches, in that I pulled the HEAD of the ucm204 branch. I did also try the first patch on its own, but it did not seem to work by itself; the controls remained invisible in alsamixer/amixer.

@perexg
Copy link
Member

perexg commented May 5, 2022

The first patch should be just a cleanup for your work (merged all changes into one and add missing stuff).

Could you show alsaucm -c hw:U192k dump text for both working configs and ucm204 branch branch?

@brndd
Copy link
Contributor Author

brndd commented May 5, 2022

Alright, I tried the first commit by itself again, this time rebooting after applying it, and it seems to work too; the controls appear in alsamixer like they should. I believe I may have forgotten to reboot after trying it before, and clearly that (or restarting some component which I haven't discovered yet) is necessary for the controls to show up.

In other words, I think the second patch (perexg@9723a9b) is not actually necessary; the controls show up in amixer/alsamixer even without it.

HEAD of ucm204 branch (second patch on top of first patch):

$ alsaucm -c hw:U192k dump text
Verb.HiFi {
        Comment Default
        Device.Line1 {
                Comment "Line A"
                Values {
                        CaptureCTL "_ucm0001.hw:U192k"
                        PlaybackCTL "_ucm0001.hw:U192k"
                        PlaybackChannels 2
                        PlaybackMixer "_ucm0001.default:U192k"
                        PlaybackMixerElem "Line A"
                        PlaybackPCM "_ucm0001.umc204hd_line1:U192k"
                        PlaybackPriority 200
                }
        }
        Device.Line2 {
                Comment "Line B"
                Values {
                        CaptureCTL "_ucm0001.hw:U192k"
                        PlaybackCTL "_ucm0001.hw:U192k"
                        PlaybackChannels 2
                        PlaybackMixer "_ucm0001.default:U192k"
                        PlaybackMixerElem "Line B"
                        PlaybackPCM "_ucm0001.umc204hd_line2:U192k"
                        PlaybackPriority 100
                }
        }
        Device.Mic1 {
                Comment "Input 1"
                Values {
                        CaptureCTL "_ucm0001.hw:U192k"
                        CaptureChannels 1
                        CaptureMixer "_ucm0001.default:U192k"
                        CaptureMixerElem "Input 1"
                        CapturePCM "_ucm0001.umc204hd_mic1:U192k"
                        CapturePriority 200
                        PlaybackCTL "_ucm0001.hw:U192k"
                }
        }
        Device.Mic2 {
                Comment "Input 2"
                Values {
                        CaptureCTL "_ucm0001.hw:U192k"
                        CaptureChannels 1
                        CaptureMixer "_ucm0001.default:U192k"
                        CaptureMixerElem "Input 2"
                        CapturePCM "_ucm0001.umc204hd_mic2:U192k"
                        CapturePriority 100
                        PlaybackCTL "_ucm0001.hw:U192k"
                }
        }
}

The first patch (this commit: perexg@bed9728) by itself:

$ alsaucm -c hw:U192k dump text
Verb.HiFi {
        Comment Default
        Device.Line1 {
                Comment "Line A"
                Values {
                        CaptureCTL "_ucm0001.hw:U192k"
                        PlaybackCTL "_ucm0001.hw:U192k"
                        PlaybackChannels 2
                        PlaybackMixer "_ucm0001.umc204hd:U192k"
                        PlaybackMixerElem "Line A"
                        PlaybackPCM "_ucm0001.umc204hd_line1:U192k"
                        PlaybackPriority 200
                }
        }
        Device.Line2 {
                Comment "Line B"
                Values {
                        CaptureCTL "_ucm0001.hw:U192k"
                        PlaybackCTL "_ucm0001.hw:U192k"
                        PlaybackChannels 2
                        PlaybackMixer "_ucm0001.umc204hd:U192k"
                        PlaybackMixerElem "Line B"
                        PlaybackPCM "_ucm0001.umc204hd_line2:U192k"
                        PlaybackPriority 100
                }
        }
        Device.Mic1 {
                Comment "Input 1"
                Values {
                        CaptureCTL "_ucm0001.hw:U192k"
                        CaptureChannels 1
                        CaptureMixer "_ucm0001.umc204hd:U192k"
                        CaptureMixerElem "Input 1"
                        CapturePCM "_ucm0001.umc204hd_mic1:U192k"
                        CapturePriority 200
                        PlaybackCTL "_ucm0001.hw:U192k"
                }
        }
        Device.Mic2 {
                Comment "Input 2"
                Values {
                        CaptureCTL "_ucm0001.hw:U192k"
                        CaptureChannels 1
                        CaptureMixer "_ucm0001.umc204hd:U192k"
                        CaptureMixerElem "Input 2"
                        CapturePCM "_ucm0001.umc204hd_mic2:U192k"
                        CapturePriority 100
                        PlaybackCTL "_ucm0001.hw:U192k"
                }
        }
}

@perexg
Copy link
Member

perexg commented May 5, 2022

You are seeing the cached values and configs. The full state cleanup:

systemctl stop alsa-restore
systemctl stop alsa-state
rm -rf /var/lib/alsa/*
reboot

You may try to remove any additional changes for the UCM config and test, if you there are no new mixer controls.

Then apply my two patches, reboot and check if there are controls and they are functional (changes the mute / volume).

@brndd
Copy link
Contributor Author

brndd commented May 5, 2022

OK. I cleared the cache as you suggested and applied the two patches, and the controls work fine. Here's the output of alsaucm -c hw:U192k dump text:

Verb.HiFi {
        Comment Default
        Device.Line1 {
                Comment "Line A"
                Values {
                        CaptureCTL "_ucm0001.hw:U192k"
                        PlaybackCTL "_ucm0001.hw:U192k"
                        PlaybackChannels 2
                        PlaybackMixer "_ucm0001.default:U192k"
                        PlaybackMixerElem "Line A"
                        PlaybackPCM "_ucm0001.umc204hd_line1:U192k"
                        PlaybackPriority 200
                }
        }
        Device.Line2 {
                Comment "Line B"
                Values {
                        CaptureCTL "_ucm0001.hw:U192k"
                        PlaybackCTL "_ucm0001.hw:U192k"
                        PlaybackChannels 2
                        PlaybackMixer "_ucm0001.default:U192k"
                        PlaybackMixerElem "Line B"
                        PlaybackPCM "_ucm0001.umc204hd_line2:U192k"
                        PlaybackPriority 100
                }
        }
        Device.Mic1 {
                Comment "Input 1"
                Values {
                        CaptureCTL "_ucm0001.hw:U192k"
                        CaptureChannels 1
                        CaptureMixer "_ucm0001.default:U192k"
                        CaptureMixerElem "Input 1"
                        CapturePCM "_ucm0001.umc204hd_mic1:U192k"
                        CapturePriority 200
                        PlaybackCTL "_ucm0001.hw:U192k"
                }
        }
        Device.Mic2 {
                Comment "Input 2"
                Values {
                        CaptureCTL "_ucm0001.hw:U192k"
                        CaptureChannels 1
                        CaptureMixer "_ucm0001.default:U192k"
                        CaptureMixerElem "Input 2"
                        CapturePCM "_ucm0001.umc204hd_mic2:U192k"
                        CapturePriority 100
                        PlaybackCTL "_ucm0001.hw:U192k"
                }
        }
}

perexg pushed a commit that referenced this pull request May 10, 2022
Link: #128
Signed-off-by: Peter Wedder <burneddi@gmail.com>
perexg added a commit that referenced this pull request May 10, 2022
Link: #128
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
@perexg
Copy link
Member

perexg commented May 10, 2022

Merged (9d16a3b, 701775d).

@perexg perexg closed this May 10, 2022
ninelore pushed a commit to ninelore/alsa-ucm-conf-cros that referenced this pull request Jun 10, 2024
Link: alsa-project#128
Signed-off-by: Peter Wedder <burneddi@gmail.com>
ninelore pushed a commit to ninelore/alsa-ucm-conf-cros that referenced this pull request Jun 10, 2024
Link: alsa-project#128
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants