ALSA: UCM - no hardware volume control for the private alsa-lib configuration
The ALSA UCM configuration can also offer the mixer devices with the private prefix. Those mixer devices (starting with _ucmXXXX.
) works only in the context where the UCM handle is opened (similarly to the PCM devices). It seems that something is missing in the current code, because the hardware volume cannot be changed using those mixer devices:
Example:
Got PlaybackPCM for device Line2: _ucm0001.umc204hd_stereo_out:U192k,0,2,3
Got PlaybackMixer for device Line2: _ucm0001.default:U192k
spa-acp-tool:
Enable ucm device Line2
Activating path Line B
Path Line B (null), direction=1, priority=0, probed=yes, supported=yes, has_mute=yes, has_volume=yes, has_dB=yes, min_volume=0, max_volume=127, min_dB=-127, max_dB=0
Element 'Line B', direction=1, switch=1, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x6, n_channels=2, override_map=00
Hardware volume ranges from -127.00 dB to 0.00 dB.
Fixing base volume to 0.00 dB
Using hardware volume control. Hardware dB scale supported.
Using hardware mute control.
New hardware volume: min:44649 max:44649
0: 44649
1: 44649
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.
>>>ld
device 0: direction:playback name:"Direct: hw:U192k: sink" prio:1000 flags:00000008 devices: "hw:U192k"
device 1: direction:capture name:"Direct: hw:U192k: source" prio:1000 flags:00000008 devices: "hw:U192k"
* device 2: direction:playback name:"HiFi: umc204hd_stereo_out:U192k,0,2,3: sink" prio:100 flags:0000000f devices: "umc204hd_stereo_out:U192k,0,2,3"
* device 3: direction:playback name:"HiFi: umc204hd_stereo_out:U192k,0,0,1: sink" prio:200 flags:0000000f devices: "umc204hd_stereo_out:U192k,0,0,1"
* device 4: direction:capture name:"HiFi: umc204hd_mono_in:U192k,0,1: source" prio:100 flags:0000000f devices: "umc204hd_mono_in:U192k,0,1"
* device 5: direction:capture name:"HiFi: umc204hd_mono_in:U192k,0,0: source" prio:200 flags:0000000f devices: "umc204hd_mono_in:U192k,0,0"
>>>set-volume 2 0.1
Set hardware volume: min:38326 max:38326
0: 38326
1: 38326
Requested volume: 38326
Got hardware volume: 39794
Calculated software volume: 63118 (accurate-enough=no)
*** volume HiFi: umc204hd_stereo_out:U192k,0,2,3: sink changed to 0.200005