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

[SKIP CI] Test-case: Test if acoustic capture of ambient is normal #972

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

singalsu
Copy link
Contributor

Capture sound clip from microphone endpoint and automatically analyze if recording has normal characteristic. Detected issues are only PCM zero code or DC constant DC values, large offset, duplicated channels, saturated PCM code values, or abnormal FFT spectrum.

Signed-off-by: Seppo Ingalsuo seppo.ingalsuo@linux.intel.com

Capture sound clip from microphone endpoint and automatically
analyze if recording has normal characteristic. Detected issues
are only PCM zero code or DC constant DC values, large offset,
duplicated channels, saturated PCM code values, or abnormal
FFT spectrum.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
@singalsu
Copy link
Contributor Author

@marc-hb Here's a draft version of ambient noise based mic capture test for try at some lab. Fan noise, speech, music etc. in background should pass while several kinds of problems should be detected.

@@ -0,0 +1,23 @@
#!/bin/bash
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shell script is useful for testing the octave script in isolation but for "real" tests it's probably not needed, existing test-case/*capture*.sh tests should probably be modified instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that makes sense. Also would need a way to launch this only in devices with plugged in headset and/or analog or digital microphone available. Something like /etc/defaults/has_headset, etc?

@marc-hb marc-hb requested a review from fredoh9 October 20, 2022 00:04
rm -f "$WAV"
arecord -D${DEV} $FMT -d 2 "$WAV"
octave --silent --no-gui --eval "$OCTAVE_SCRIPT"
status=$?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will always be zero because of set -e

check_device_format "hw:1,6" "-c 2 -r 48000 -f S16_LE"
check_device_format "hw:1,6" "-c 2 -r 48000 -f S32_LE"
check_device_format "hw:1,7" "-c 2 -r 16000 -f S16_LE"
check_device_format "hw:1,7" "-c 2 -r 16000 -f S32_LE"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@singalsu
Copy link
Contributor Author

@singalsu reminder to myself to proceed with this after vacation

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