Hi,
On 4/6/20 11:34 AM, Jaroslav Kysela wrote:
Dne 05. 04. 20 v 20:34 Hans de Goede napsal(a):
Fix HiFi-stereo-dmic2 conf not loading because of references to
non existing devices in the ConflictingDevices sections.
Stop playing Rename + Remove tricks with the output (Speaker2) and
input (DMIC1) devices which we do not want to be part of this config,
this does not work now that we only allow devices which are actually
part of our config in the ConflictingDevices sections.
The Remove and Rename operations should also manage (remove and rename) devices in ConflictingDevices/SupportedDevices sections. What's the exact error you hit?
If I simulate this via ucm-validator I get this device structure:
Verb: "HiFi"
File: HiFi-stereo-dmic2.conf
Device: "Headphones"
ConflictingDevices.0 = Speaker
Value.PlaybackPriority = 300
Value.PlaybackPCM = 'hw:${CardId}'
Value.JackControl = 'Headphone Jack'
Device: "Headset"
ConflictingDevices.0 = Mic
Value.CapturePriority = 300
Value.CapturePCM = 'hw:${CardId}'
Value.JackControl = 'Headset Mic Jack'
Device: "Speaker"
ConflictingDevices.0 = Headphones
Value.PlaybackPriority = 200
Value.PlaybackPCM = 'hw:${CardId}'
Device: "Mic"
ConflictingDevices.0 = Headset
Value.CapturePriority = 200
Value.CapturePCM = 'hw:${CardId}'
It appears like an issue in alsa-lib.
Ok so I found the following weird:
RemoveDevice."Speaker2" "Speaker2"
At a hunch I removed the extra "Speaker2", now I get:
[hans@localhost ~]$ alsaucm -c cht-bsw-rt5672 set _verb HiFi set _enadev Speaker
ALSA lib parser.c:1138:(verb_dev_list_add) error: unable to find device 'Mic1'
...
Notice the error changed from being about Speaker2 to Mic1, so this looks good,
but then I did the same with the:
RemoveDevice."Mic1" "Mic1"
Line, dropping the extra "Mic1" I get:
[hans@localhost ~]$ alsaucm -c cht-bsw-rt5672 set _verb HiFi set _enadev Speaker
ALSA lib parser.c:1183:(verb_device_management) error: cannot remove device 'Mic'
...
Which is weird...
Even weirder I was thinking that the Rename + Remove lines should be after the last
include, so that they also get applied to the Conflicting devices of e.g . the
Headphones Section Device, but if I move the Rename + Remove lines for the Mic
to the end of the HiFi-stereo-dmic2.conf file I get:
[hans@localhost ~]$ alsaucm -c cht-bsw-rt5672 set _verb HiFi set _enadev Speaker
ALSA lib conf.c:1928:(_snd_config_load_with_include) _toplevel_:23:0:Unexpected end of file
ALSA lib utils.c:285:(uc_mgr_config_load) could not load configuration file /usr/share/alsa/ucm2/cht-bsw-rt5672/HiFi-stereo-dmic2.conf
ALSA lib parser.c:1349:(parse_verb_file) error: failed to open verb file /usr/share/alsa/ucm2/cht-bsw-rt5672/HiFi-stereo-dmic2.conf : 0
ALSA lib main.c:962:(snd_use_case_mgr_open) error: failed to import cht-bsw-rt5672 use case configuration -22
alsaucm: error failed to open sound card cht-bsw-rt5672: Invalid argument
Regards,
Hans