sof icon indicating copy to clipboard operation
sof copied to clipboard

[FEATURE] tplg build should catch too long control names

Open kv2019i opened this issue 1 year ago • 12 comments

Is your feature request related to a problem? Please describe. Currently SOF topologies can be created with too long control names and these will fail upn Linux kernel loading the topologies.

Describe the solution you'd like It should be possible to constraint length of "string" data and capture invalid entries at topology build time.

Describe alternatives you've considered

Additional context Filed as result of https://github.com/thesofproject/sof/pull/9008

kv2019i avatar Apr 09 '24 10:04 kv2019i

@ranj063 @jsarha @singalsu lets include this fix in our topology Q2 work. Thanks

lgirdwood avatar Apr 16 '24 12:04 lgirdwood

I can take this. Thou I guess this is not a top prioroty.

jsarha avatar May 28 '24 20:05 jsarha

Not a priority item, pushing to next.

kv2019i avatar Sep 05 '24 11:09 kv2019i

Feature cutoff for v2.12, moving this to v2.13.

kv2019i avatar Dec 13 '24 11:12 kv2019i

@jsarha any update? two weeks for v2.13 feature cutoff.

kv2019i avatar Apr 23 '25 13:04 kv2019i

@kv2019i there has constantly been higher priority jobs assigned to me, so this has not gotten any cycles.

jsarha avatar Apr 25 '25 07:04 jsarha

Ack @jsarha . Let me move to TBD milestone and we'll reschedule this later.

kv2019i avatar Apr 28 '25 14:04 kv2019i

@kv2019i I tried approaching this my modifying tplg_parser/control.c ,is there a better way you would suggest or any pointers to fix this issue ,I am quite new to Sof :/

Image

Biancaa-R avatar Nov 10 '25 22:11 Biancaa-R

Adding @ranj063 @Biancaa-R the topology compiler (in ALSA utils) does all the topology building from topology source to binary. This code parses the input before outputing to binary structures in file and would also need a similar size check. Fwiw, I am not sure if the front end parser knows the target size when parsing, I would probably add any checks to the back end of the compiler where the target object size is known.

lgirdwood avatar Nov 11 '25 15:11 lgirdwood

Adding @ranj063 @Biancaa-R the topology compiler (in ALSA utils) does all the topology building from topology source to binary. This code parses the input before outputing to binary structures in file and would also need a similar size check. Fwiw, I am not sure if the front end parser knows the target size when parsing, I would probably add any checks to the back end of the compiler where the target object size is known.

Thanks a lot for your input Ill change it accordingly.

Biancaa-R avatar Nov 11 '25 17:11 Biancaa-R

Thank you for the contribution @Biancaa-R ! I don't actually know where exactly this check for errors should be made, but I think the tplg_parser is not the right place as that is not run during the build process for topologies. I'm suspecting the correct place is in the conf2tplg compiler in ( https://github.com/alsa-project/alsa-utils/commits/master/topology ). Did you @jsarha took a look at all where this could be done?

For background, we want to avoid errors like was fixed here https://github.com/thesofproject/sof/pull/9008 Sorry @Biancaa-R , this may not be the easiest issue to start in SOF.

kv2019i avatar Nov 12 '25 19:11 kv2019i

@kv2019i , The correct place would of course be the alsa-utils topology compiler, but I have not taken on the task since there has all the time been higher priority tasks in my queue, and respinning a topology compiler work will always take some time. An adhock solution of writing a python checker for our topologies on top of already existing parser, would be faster, but not as elegant solution.

jsarha avatar Nov 14 '25 12:11 jsarha