-
Notifications
You must be signed in to change notification settings - Fork 127
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
Simplify BYT/CHT/BDW card names when used with sof #2021
Simplify BYT/CHT/BDW card names when used with sof #2021
Conversation
looks good except for the one blip |
dd2018e
to
55b793e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plbossart This feels a bit strange to have nothing about the platform in the card name. E.g. if you have a non-Intel device using SOF and e.g. rt5640 codec, the same UCM file would probably not apply.
Hmm, of course, with limited space, maybe first-come-first-served applies here and in the case another SOF card with rt5650 comes, they will just have to pick another name. I guess this is the intention?
total budget is 16 chars: that leaves 2 chars worst case for the platform definition, so to remain consistent I omitted it. I felt it was better to avoid truncating the codec name than add something specific about Intel. makes sense? |
The question is, if the driver name should contain those details like codec and platform. The driver name might be like "sof" and you can put details to the standard card name. The conditions in ucm2 can handle the rest (we may even add lazy load to optimize config loading later). |
@perexg what do you mean by the standard card name? we set the name once in the snd_soc_card structure, we don't have another mechanism, do we? Wondering if you are talking about extending the ASoC framework here? |
Answering my own question, we do...
That said why would the name become the driver_name.... |
Yes, you can set different name via snd_soc_card->driver_name. Appearently, this field is NULL in your case, thus snd_soc_bind_card() will use the snd_soc_card->name field for the driver name. |
Just to get the character limitation right, would this mapping be correct?
|
@perexg I did the suggested fixes so now things look better:
The ID still looks horrible, if it's build automatically from the name, we need to require that the name be unique enough for the first 15 chars. |
ID is an alias to the card number which may be set via the module parameters (another missing part in ASoC). This string is expected to be user configurable (to address the cards in the system more nicely). Unfortunately, because you use '-' instead space for the card name, the mechanism which picks the last word from the card name does not work like for other drivers. |
I can add a space for the codec name, that's no issue. I don't think anyone was aware of that space requirement :-) But I must admit I am lost here. Earlier you wrote "For the filename lookup, only the driver and longname strings are used (longname as first)." so in this case, I have a longname which will never have any UCM match, so we will fallback to the driver name which has become too generic. It's unmanageable if we need to deal with all baytrail/cherrytrail configurations in a single directory? |
@perexg adding a space is magical :-)
so now my only concern is how the UCM file is found (order between long card name, short card name, driver name). |
I would create SOF/SOF.conf and conditionaly include verb configs from there. You can add one directory level. Ideally based on the string with the components (codec IDs) like we settled for soundwire.
or use the card name:
We have similar situation for USB / legacy HDA where the driver name is common for all variants (codecs, devices) and we need to do the split based on other information than driver name / long name (DMI name for ASoC). |
55b793e
to
1316ab8
Compare
@perexg I hit a snag with the UCM include files.
in other words, load the legacy config - which would be tested to see if its used in legacy mode or not. This fails because there are hard-coded paths in alsa-ucm. isn't there a way to specify a local path? |
1316ab8
to
2913223
Compare
The matching UCM configurations are here: alsa-project/alsa-ucm-conf#20 |
Blindly adding an sof- prefix to the card name is not user friendly and causes UCM issues with a driver name truncated to 16 characters. Simplify to use "sof-bytcht <codec_name>" pattern for all byt* machine drivers. The sof- prefix is added by the core. A generic "SOF" driver name is used, and UCMv2 will detect the configuration for this driver by testing the card name. Legacy uses are unmodified. Suggested-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Blindly adding an sof- prefix to the card name is not user friendly and causes UCM issues with a driver name truncated to 16 characters. Simplify to use "sof-bytcht <codec_name>" pattern for all cht* machine drivers. The sof- prefix is added by the core. A generic "SOF" driver name is used, and UCMv2 will detect the configuration for this driver by testing the card name. Legacy uses are unmodified. Suggested-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Blindly adding an sof- prefix to the card name is not user friendly and causes UCM issues with a driver name truncated to 16 characters. Simplify to use "sof-bdw <codec_name>" pattern for all Broadwell machine drivers. The sof- prefix is added by the core. A generic "SOF" driver name is used, and UCMv2 will detect the configuration for this driver by testing the card name. Legacy uses are unmodified. Suggested-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2913223
to
384ceaf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks
Ack @plbossart , looks good to go. |
Follow-up on @perexg 's suggestion to use simpler names. I removed the byt/cht mention since it's confusing to have a 'byt' card on a 'cht' machine and it adds no value to the user.
I hope it doesn't break all the CI tests...