-
Notifications
You must be signed in to change notification settings - Fork 47
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
Checkbox 691/missing audio device (New) #622
Conversation
461ce24
to
ba58ab8
Compare
34cb5f4
to
6e31f52
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.
The naming of the resource job is a bit unfamiliar to me but the overall functionality seems very nice!
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.
As discussed in a meeting earlier with @diohe0311 , I think it's risky to remove the manifest entries (has_audio_capture
and has_audio_playback
). These entries are manual to allow for the tester to let Checkbox know if this device has, indeed, a sound output and/or a sound input.
If we rely solely on automated jobs, like with the audio_card
resource created here, if, for any reason, the audio device(s) are not detected by Ubuntu (because of a driver issue, because of a kernel issue, because of a UEFI issue, etc.), then Checkbox will assume there are no sound input/output and will proceed with skipping the jobs. This is bad because QA and/or PM may not see that some audio jobs were skipped, and they may deem the device tests as complete whereas there should be bugs raised about the missing sound interfaces...
@kissiel, any opinion about this?
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.
A few more comments inline.
Also, I would recommend that you test your work by calling the jobs and/or the test plans you have modified. In your venv, you can run a job with, for example:
(venv) $ checkbox-cli run com.canonical.certification::audio/detect-playback-devices
(...)
==============[ Running job 2 / 2. Estimated time left: 0:00:00 ]===============
------------[ Check that at least one audio playback device exits ]-------------
ID: com.canonical.certification::audio/detect-playback-devices
Category: com.canonical.plainbox::audio
Job cannot be started because:
- resource expression "audio_card.playback == 'supported'" evaluates to false
Outcome: job cannot be started
If the skip is not enough, let's mark the job with The problem I have right now is that we're extending general manifest questionnaire to cover some extreme corner cases that don't affect 99% of the systems (how many systems don't have any audio dev?). So for systems that are in fact audio-less, it's up to the test plan author to make sure to exclude all the audio jobs so they don't pop up as skipped/failed. |
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.
There's one unnecessary shebang (marked inline).
Agree with @pieqq it's risky to remove the manifest entries (has_audio_capture and has_audio_playback). it usually observed the audio device not detected in develop phase. has_audio_capture & has_audio_playback in the manifest entries would've been for including/excluding the audio jobs. |
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.
After discussing with QA on Mattermost on that topic, it's better to
- leave the manual manifest
- not use
fail-on-resource
flag, otherwise the jobs would be marked as failed if tester specified device has no audio input/output.
Once you've done these changes, please create a snap from your branch and try to run the following jobs (the ones that are impacted by the manual manifest) to make sure they work as expected:
- audio/detect-capture-devices
- audio/detect_sources
- audio/detect_sinks
- audio/detect-playback-devices
- audio/alsa-loopback
- audio/alsa-loopback-automated
- audio/alsa_record_playback_automated
- audio/alsa-playback
Try setting the required manifest to false
, then true
.
To make a snap:
- go to
checkbox-core-snap
- run
./prepare.sh series22
- go to
series22
- run
snapcraft
If you want to create a snap for the Raspberry Pi, you need to build the arm64 version of the snap. To do that, in step 4, run snapcraft remote-build --build-for=arm64 --launchpad-accept-public-upload
.
Once the snap is available, you can install it by running sudo snap install <snap-name>.snap --dangerous
.
Thanks! Pierre, I tested those jobs you list on the snap built from my branch, all passed except for:
|
Codecov Report
@@ Coverage Diff @@
## main #622 +/- ##
======================================
Coverage ? 2.50%
======================================
Files ? 144
Lines ? 15838
Branches ? 2773
======================================
Hits ? 396
Misses ? 15364
Partials ? 78 |
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 :)
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.
+1, this came before the coverage requirement, I think it can be merged
Description
The problem is that the audio device cannot be detected in the RPi4. The root cause is udev_resource.py, which filters out the audio devices without a vendor ID. However, the audio devices in RPi4 do not have any vendor IDs.
After discussing with Maciej, we concluded that udev_resource is too complicated, with too many exception cases. It would be challenging to maintain and understand if we were to add more exceptions to it. Therefore, it's better to allow the audio card to have its own resource script, similar to the graphics card. Additionally, we already have alsa_pcm_info.py, which can gather information about the audio card.
Also add a unittest to testify if audio_card_resource.py can process data from file.
Changes:
Update:
At first, we thought, 'Hey, why not do a better job by (1) extracting audio resources from the udev resources? This way, udev wouldn't become more complicated. And (2) adding automated detection for playback and capture, while also removing them from the manifest, so users don't have to answer it every time.'
After serveral meetings and discussions with Pierre, Hanhsuan, Patrick and Kent, turns out manifest has great usage to QA team and OEM, its convenience and flexibility allow users to adjust the hw info efficiently. So we decide to undo the changes related to manifest and jobs
requires
.Resolved issues
https://warthogs.atlassian.net/browse/CHECKBOX-691
Tests
Check flake8 and unit test
./manage.py test -f
./manage.py test -u
Check RPi4
cd checkbox/providers/
scp -r resource ubuntu@10.102.163.11:/var/tmp/checkbox-providers/
ssh ubuntu@10.102.163.11
cd /var/tmp/checkbox-providers/resource/bin
checkbox.shell
./audio_card_resource.py
Test the following jobs
checkbox-cli run com.canonical.certification::audio/[JOB_NAME]
Test with checkbox remote
failed due to known issue: #655
https://certification.canonical.com/hardware/201911-27506/submission/343677/