-
Notifications
You must be signed in to change notification settings - Fork 46
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
Remove sof-test dependency on topology file, use /proc instead #471
Comments
From @plbossart
|
PR #430 has the following code: for pcm in card_info['pcm']:
# There are limited pipeline parameters in the proc file system,
# add some default parameters to make use of sof-test for legacy HDA test
pcm['fmt'] = 'S16_LE'
pcm['fmts'] = 'S16_LE S24_LE S32_LE'
pcm['rate'] = '48000'
pcm['channel'] = '2'
pcm['dev'] = 'hw:{},{}'.format(card_id, pcm['id']) @ranj063 , @plbossart Is this not actually needed for testing? BTW EDIT, somewhat related |
@marc-hb For SOF test, we have to depend on topology. Because we cannot get the information from proc, eg:
|
@marc-hb right, you have found the limitation for the proc info. This is the workaround code to provide a fake PCM capability (hw_params) to the PCMs from proc. In TPLG, we can get those info by parse the binary.
Another gaps we have with proc info is that we could not get the info about the comps in pipeline for the PCM. Some test case is designed for special COMP (eg: MUX, EQ, WOV). So I think we can use proc as a fallback, but we could not relay on the proc info for our test. |
@xiulipan what are we missing for these special comps that we read from topology? |
@aiChaoSONG wov is always the DMIC16k device. For DSM, the speaker PCM device will have the same name for the feedback pipeline and for echoref, the pipeline is simply called echo. What more info do we need from tplg? |
What do we use these for? |
@ranj063 I think below useful information cannot be extracted from proc, either.
|
@ranj063 @aiChaoSONG I think /proc info only is not enough to get similar info as TPLG parser can do. If above steps can work, TPLG reader can still be kept for PCM info validation test and some audio quality test that may need detailed configuration value. |
@xiulipan even for legacy HDaudio it's much better to query the capabilities instead of hard-coding 48kHz as suggested. That said you are not going to do a volume test or PCM/pipeline->PGA mapping for legacy HDaudio, so we probably need to move to a mode where the topology is only used when absolutely needed, instead of being the source of all information. |
@plbossart I think I have made some alignment with @ranj063 @aiChaoSONG to have a feature to read /proc or query from ALSA API to get the correct PCM info. But this will take time to make sure the read out info is trustful and won't break SOF FW before we start the test. reference to get those info by API:
|
some parameter can only be extracted from topology, so a full replacement is impossible, but for platforms use legacy HDA drivers like RKL-S, we can run sof-test on there platforms by reading /proc. close? @marc-hb |
How far from that are we? |
For legacy HDA DUT, we are using /proc but with FAKED rate, channel and format info. I do not think using /proc like this can satisfy our test case requirement. To get fully info, we will need to query the PCM with |
I just made It works by scanning the kernel logs so it does not work until the driver has been loaded. |
@plbossart reported an interesting side effect of this in thesofproject/linux#3645 (comment) When everything goes well, the list of pipelines comes from the $TPLG file. This file obviously does not include any USB device. When the firmware crashes or does not load for some reason, There's probably a bug somewhere. |
@aiChaoSONG It seems to me that the idea of 'legacy HDA' was implemented in one of your patches, 3c6e727 ('sof-dump-status: dump pipeline info from proc for legacy HDA') Can you chime in on what the idea of this 'legacy HDA' feature was? I don't recall ever seeing a test report on snd-hda-intel tested with HDaudio, and it seems like this will select USB audio if the SOF card is not present - major problem IMHO. |
Quoting one of the commit messages in (long)
|
From experience, automated fallbacks are a generous source of "green failures". In thesofproject/linux#3645 (comment), this automated fallback certainly tries to hide an SOF crash. Maybe sof-test should by default test SOF device and nothing else. If someone wants to test non-SOF devices, they can but they should have to ask explicitly. Testing is about finding and reporting as many problems as possible. Fallbacks do the exact opposite. |
@plbossart @marc-hb We do test legacy-hda on RKL device, check report 12889. But looks no one has ever checked it.
|
Agree, if people want to test on HDaudio or USB or whatever, they should use the card name explicitly. That's a great feature to allow sof-test to be used in a generic way. Fallback is evil in this case, we end-up testing the wrong card if by accident the one we want was not registered. Big conceptual fail IMHO. Typical issues will be using the NVidia HDMI card or USB audio, not of which are intended in our CI tests. |
I think it would be best but it would be some coding effort. In the meantime here's a quickfix from @aiChaoSONG that turns off the fallback by default: |
New fw_profile worth noting: |
Maybe reading
So, closing. |
From @ranj063
The text was updated successfully, but these errors were encountered: