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

Also search for ucm2/conf.d/[${CardDriver}|${KernelDriver}]/${CardName}.conf #374

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Daniel-Abrecht
Copy link

The CardLongName may be derived from various DMI properties of the system, that have little to do with the card itself. Sometimes, that may be a good thing, but sometimes, it may contain the completely generic "Unknown-UnknownProduct-", see https://gitlab.com/postmarketOS/pmaports/-/issues/1498#note_1716959721 for example. At least for devices using device tree and simple-card, the name of the card (CardName), which then comes from the device tree, which can be provided by the kernel too, may be a lot more relevant, and does actually identify the device.

…e}.conf

The CardLongName may be derived from various DMI properties of the system, that have little to do with the card itself.
Sometimes, that may be a good thing, but sometimes, it may contain the completely generic "Unknown-UnknownProduct-",
see https://gitlab.com/postmarketOS/pmaports/-/issues/1498#note_1716959721 for example. At least for devices using
device tree and simple-card, the name of the card (CardName), which then comes from the device tree, which can be provided
by the kernel too, may be a lot more relevant, and does actually identify the device.

Signed-off-by: Daniel Abrecht <[email protected]>
@perexg
Copy link
Member

perexg commented Jan 9, 2024

Why the simple-card driver does not set the CardLongName (GUI string) from DT, too? The DMI fallback for card's long name is there just for ASoC laziness.

EDIT: Also, UCM has other way to fetch the DMI info (${sys:SYSFS_PATH} substitution).

@Daniel-Abrecht
Copy link
Author

I don't think the simple-card driver can set the CardLongName from the DT right now. It would have to set long_name in struct snd_soc_card, but I couldn't find any reference to long_name in sound/soc/generic/simple-card.c. I think that would have to be added to the simple_parse_of function in that file, it seams name is set there.

Shall I send a patch for that?

@perexg
Copy link
Member

perexg commented Jan 15, 2024

If you look to conf.d/simple-card there is rockchip,es8316-codec.conf link. No idea, how this does work. It seems like that the long name is used for this match or things are really wrong. The simple-card driver should allow to modify the long name, too.

Another option is to create conf.d/simple-card/simple-card.conf and use UCM configuration for the more precise matching (${CardName} substitution and condition). Look to conf.d/USB-Audio/USB-Audio.conf for an example or conf.d/acp5x/Valve-Jupiter-1.conf (DMI matching) etc.

@Daniel-Abrecht
Copy link
Author

I think rockchip,es8316-codec.conf is used by the pinebook-pro. In it's dtb, on line 133 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts#n133 it says simple-audio-card,name = "rockchip,es8316-codec";. That only sets the name, not the long name, though.

So, the circumstances in which this works are probably going to be about the same as for the pinephone-pro. For distros where the kernel is loaded directly by uboot without EFI, there will be no DMI, and the long_name is going to fall back to name, here: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/sound/soc/soc-core.c?id=052d534373b7ed33712a63d5e17b2b6cdbce84fd#n2268 (line 2268).

It seams there is also a blacklist of invalid DMI names in the kernel, I'll add Unknown and Unknown Product to that list.

I will also look into doing the matching in conf.d/simple-card/simple-card.conf, and will update this pull request later once I've figured that out.

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.

2 participants