alsa: use the pcm name to populate the node.nick

This avoids using device.nick, which is the card name, on all nodes
of a card. Useful on UCM, where analog, hdmi, etc are all exposed
as nodes on a single profile.
This commit is contained in:
George Kiagiadakis 2022-03-01 11:35:55 +02:00
parent afbc0ce57a
commit 4e5af26382

View file

@ -135,9 +135,9 @@ function createNode(parent, id, type, factory, properties)
-- and a nick
local nick = properties["node.nick"]
or properties["api.alsa.pcm.name"]
or properties["alsa.name"]
or dev_props["device.nick"]
or dev_props["api.alsa.card.name"]
or dev_props["alsa.card_name"]
-- also sanitize nick, replace ':' with ' '
properties["node.nick"] = nick:gsub("(:)", " ")
@ -230,7 +230,8 @@ function prepareDevice(parent, id, type, factory, properties)
-- ensure the device has a nick
properties["device.nick"] =
properties["device.nick"] or
properties["api.alsa.card.name"]
properties["api.alsa.card.name"] or
properties["alsa.card_name"]
-- set the icon name
if not properties["device.icon-name"] then