test audio/alsa_record_playback_automated passes on a desktop with no external speaker and no microphone

Bug #1461859 reported by Pierre Equoy
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Checkbox Provider - Canonical Certification Client
Invalid
Medium
Unassigned

Bug Description

When running audio/alsa_record_playback_automated, the test passes although there is no microphone listed in the Output section of the Sound window, and although no sound can be heard from the desktop itself (there are no internal nor external speakers connected).

$ cat /etc/buildstamp
monaco-suzuka-trusty-amd64-20150527-3

$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: Generic [HD-Audio Generic], device 0: ALC662 rev3 Analog [ALC662 rev3 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Generic [HD-Audio Generic], device 2: ALC662 rev3 Alt Analog [ALC662 rev3 Alt Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

u@u:/tmp$ pactl list sources short
0 alsa_output.pci-0000_00_14.2.analog-stereo.monitor module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
1 alsa_input.pci-0000_00_14.2.analog-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
u@u-Veriton-M200-A780:/tmp$ pactl list sinks short
0 alsa_output.pci-0000_00_14.2.analog-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
u@u-Veriton-M200-A780:/tmp$ python3 audio_test

u@u:/usr/lib/2013.com.canonical.certification:checkbox/bin$ python3 audio_test -a /tmp/audio.wav -u /tmp/spectrum.csv -d
DEBUG:root:autoaudiosrc
        ! queue
        ! level message=true
        ! audioconvert
        ! audio/x-raw, channels=1, rate=(int)44100
        ! audioresample
        ! spectrum interval=100000000 bands = 256
        ! wavenc
        ! filesink location=/tmp/audio.wav
DEBUG:root:audiotestsrc wave=sine freq=5035 ! audioconvert ! audioresample ! autoaudiosink
INFO:root:Using PulseAudio identifier 1 (alsa_input.pci-0000_00_14.2.analog-stereo) for input
INFO:root:Using PulseAudio identifier 0 (alsa_output.pci-0000_00_14.2.analog-stereo) for output
DEBUG:root:Registering message handler: <bound method GStreamerMessageHandler.bus_message_handler of <__main__.GStreamerMessageHandler object at 0x7f3e5c1416d8>>
INFO:root:Player: Starting
INFO:root:Recorder: Starting
DEBUG:root:Peak level: -350.00, volume: 0%, Volume change: 5.000000%
DEBUG:root:Sampling, recorded 0 samples
DEBUG:root:Peak level: -78.27, volume: 5%, Volume change: 5.000000%
DEBUG:root:Sampling, recorded 1 samples
DEBUG:root:Peak level: -62.35, volume: 10%, Volume change: 5.000000%
DEBUG:root:Sampling, recorded 2 samples
DEBUG:root:Peak level: -51.93, volume: 15%, Volume change: 5.000000%
DEBUG:root:Sampling, recorded 3 samples
DEBUG:root:Peak level: -44.55, volume: 20%, Volume change: 5.000000%
DEBUG:root:Sampling, recorded 4 samples
DEBUG:root:Peak level: -39.21, volume: 25%, Volume change: 5.000000%
DEBUG:root:Sampling, recorded 5 samples
DEBUG:root:Peak level: -34.98, volume: 30%, Volume change: 5.000000%
DEBUG:root:Sampling, recorded 6 samples
DEBUG:root:Peak level: -31.25, volume: 35%, Volume change: 5.000000%
DEBUG:root:Sampling, recorded 7 samples
DEBUG:root:Peak level: -28.05, volume: 40%, Volume change: 5.000000%
DEBUG:root:Sampling, recorded 8 samples
DEBUG:root:Peak level: -25.27, volume: 45%, Volume change: 5.000000%
DEBUG:root:Sampling, recorded 9 samples
DEBUG:root:Peak level: -22.37, volume: 50%, Volume change: 5.000000%
DEBUG:root:Sampling, recorded 10 samples
DEBUG:root:Peak level: -20.14, volume: 55%, Volume change: 5.000000%
DEBUG:root:Sampling, recorded 11 samples
DEBUG:root:Peak level: -17.88, volume: 60%, Volume change: 5.000000%
DEBUG:root:Sampling, recorded 12 samples
DEBUG:root:Peak level: -15.63, volume: 65%, Volume change: 5.000000%
DEBUG:root:Sampling, recorded 13 samples
DEBUG:root:Peak level: -13.72, volume: 70%, Volume change: 5.000000%
DEBUG:root:Sampling, recorded 14 samples
DEBUG:root:Peak level: -11.87, volume: 75%, Volume change: 5.000000%
DEBUG:root:Sampling, recorded 15 samples
DEBUG:root:Peak level: -10.42, volume: 80%, Volume change: 5.000000%
DEBUG:root:Sampling, recorded 16 samples
DEBUG:root:Peak level: -8.65, volume: 85%, Volume change: 5.000000%
DEBUG:root:Sampling, recorded 17 samples
DEBUG:root:Peak level: -7.38, volume: 90%, Volume change: 4.474995%
DEBUG:root:Sampling, recorded 18 samples
DEBUG:root:Peak level: -5.97, volume: 94%, Volume change: 3.479861%
DEBUG:root:Sampling, recorded 19 samples
DEBUG:root:Peak level: -5.14, volume: 97%, Volume change: 2.960921%
DEBUG:root:Sampling, recorded 20 samples
DEBUG:root:Peak level: -5.13, volume: 97%, Volume change: 3.034649%
DEBUG:root:Sampling, recorded 21 samples
DEBUG:root:Peak level: -5.11, volume: 97%, Volume change: 3.028206%
DEBUG:root:Sampling, recorded 22 samples
DEBUG:root:Peak level: -5.17, volume: 97%, Volume change: 3.076460%
DEBUG:root:Sampling, recorded 23 samples
DEBUG:root:Peak level: -5.16, volume: 97%, Volume change: 3.066471%
DEBUG:root:Sampling, recorded 24 samples
DEBUG:root:Peak level: -5.16, volume: 97%, Volume change: 3.074053%
DEBUG:root:Sampling, recorded 25 samples
DEBUG:root:Peak level: -5.13, volume: 97%, Volume change: 3.046838%
DEBUG:root:Sampling, recorded 26 samples
DEBUG:root:Peak level: -5.16, volume: 97%, Volume change: 3.080573%
DEBUG:root:Sampling, recorded 27 samples
DEBUG:root:Peak level: -5.19, volume: 97%, Volume change: 3.101950%
DEBUG:root:Sampling, recorded 28 samples
DEBUG:root:Peak level: -5.15, volume: 97%, Volume change: 3.074722%
DEBUG:root:Sampling, recorded 29 samples
DEBUG:root:Peak level: -5.16, volume: 97%, Volume change: 3.087871%
DEBUG:root:Sampling, recorded 30 samples
DEBUG:root:Peak level: -5.17, volume: 97%, Volume change: 3.094063%
DEBUG:root:Sampling, recorded 31 samples
DEBUG:root:Peak level: -5.18, volume: 97%, Volume change: 3.111002%
DEBUG:root:Sampling, recorded 32 samples
DEBUG:root:Peak level: -5.18, volume: 97%, Volume change: 3.113177%
DEBUG:root:Sampling, recorded 33 samples
DEBUG:root:Peak level: -5.18, volume: 97%, Volume change: 3.110868%
DEBUG:root:Sampling, recorded 34 samples
DEBUG:root:Peak level: -5.14, volume: 97%, Volume change: 3.082040%
DEBUG:root:Sampling, recorded 35 samples
DEBUG:root:Peak level: -5.20, volume: 97%, Volume change: 3.136209%
DEBUG:root:Sampling, recorded 36 samples
DEBUG:root:Peak level: -5.18, volume: 97%, Volume change: 3.123124%
DEBUG:root:Sampling, recorded 37 samples
DEBUG:root:Peak level: -5.17, volume: 97%, Volume change: 3.116434%
DEBUG:root:Sampling, recorded 38 samples
DEBUG:root:Peak level: -5.19, volume: 97%, Volume change: 3.138728%
DEBUG:root:Sampling, recorded 39 samples
DEBUG:root:Peak level: -5.16, volume: 97%, Volume change: 3.111973%
DEBUG:root:Sampling, recorded 40 samples
DEBUG:root:Peak level: -5.19, volume: 97%, Volume change: 3.145166%
DEBUG:root:Sampling, recorded 41 samples
DEBUG:root:Peak level: -5.18, volume: 97%, Volume change: 3.134241%
DEBUG:root:Sampling, recorded 42 samples
DEBUG:root:Peak level: -5.18, volume: 97%, Volume change: 3.139149%
DEBUG:root:Sampling, recorded 43 samples
DEBUG:root:Peak level: -5.03, volume: 97%, Volume change: 3.024605%
DEBUG:root:Sampling, recorded 44 samples
DEBUG:root:Peak level: -5.16, volume: 97%, Volume change: 3.143449%
DEBUG:root:Sampling, recorded 45 samples
DEBUG:root:Peak level: -1.57, volume: 97%, Volume change: 0.264478%
DEBUG:root:Sampling, recorded 46 samples
DEBUG:root:Peak level: -5.15, volume: 98%, Volume change: 3.489871%
DEBUG:root:Sampling, recorded 47 samples
DEBUG:root:Peak level: -5.13, volume: 98%, Volume change: 3.115836%
DEBUG:root:Sampling, recorded 48 samples
DEBUG:root:Peak level: -5.13, volume: 98%, Volume change: 3.118296%
DEBUG:root:Sampling, recorded 49 samples
INFO:root:Sampling complete, ending process
INFO:root:Player: Stopping
INFO:root:Recorder: Stopping
DEBUG:root:Band (4995.70,5081.84) contains a magnitude peak
INFO:root:PASS: Test frequency of 5035 in band (4995.70, 5081.84) which contains a magnitude peak
INFO:root:Saving spectrum data for plotting as /tmp/spectrum.csv

Revision history for this message
Pierre Equoy (pieq) wrote :
Revision history for this message
Daniel Manrique (roadmr) wrote :

Hi Pierre!

Did you listen to the audio.wav file? You can clearly hear the control tone in that one, and the .csv can be plotted with quickplot and you'll also see the frequency peak at the expected frequency.

One thing that looks suspicious though is that it didn't capture any background noise (everything else in the graph is completely flat). So maybe audio is being routed internally by the OS which is what causes this.

The other explanation would be for the system to have a hidden microphone somewhere :) but that's unlikely, particularly since you (the human) didn't report hearing anything really.

Could you please attach output of pactl list sinks and pactl list sources (long output please)? The short output doesn't show anything suspicious so at this point I don';t know :)

Changed in plainbox-provider-canonical-certification:
status: Confirmed → Incomplete
Revision history for this message
Pierre Equoy (pieq) wrote :
Revision history for this message
Pierre Equoy (pieq) wrote :

Hey Daniel,

yes I heard that, it' s very strange because I couldn't hear anything and as you mention there are no ambient noise, so I think, as you say, it must be internally routed...

I attached the pactl logs. As you can see headphones and microphones are "not available" (this is because it's 3.5mm jack plugs and nothing is plugged into those).

Pierre Equoy (pieq)
Changed in plainbox-provider-canonical-certification:
milestone: none → 0.23
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

I marked bug 1548160 as a duplicate of this one, here are some tests that I made on the affected system of that bug:

1. Test it with "python3 audio_test -a /tmp/audio.wav"
* High pitch beep can be heard from the recorded wav file.

2. Test it with "python3 audio_test -a /tmp/audio.wav" and with a How_fast.ogg video playing on that system.
* High pitch beep and the audio from that video clip can be heard in the recorded wav file, this confirms that it'll somehow record audio internally (a little bit faint)

3. Test it with "python3 audio_test -a /tmp/audio.wav" and with a music played on another system.
* High pitch beep can be heard from the recorded wav file. But not the music, this confirms that there is no hidden microphone on it.

4. Test it with "python3 audio_test -a /tmp/audio.wav" and with one end of a 3.5mm earphone loop back cable connected (the system provides only a headset jack seat), this make sure no sound will be played through any devices.
* High pitch beep and the audio from that video clip can be heard in the recorded wav file, this double confirmed the result in the second case.

Po-Hsu Lin (cypressyew)
Changed in plainbox-provider-canonical-certification:
status: Incomplete → Confirmed
Pierre Equoy (pieq)
Changed in plainbox-provider-canonical-certification:
status: Confirmed → Fix Released
Changed in plainbox-provider-canonical-certification:
milestone: 0.23 → 0.24
status: Fix Released → Confirmed
Pierre Equoy (pieq)
Changed in plainbox-provider-canonical-certification:
milestone: 0.26 → 0.27
Pierre Equoy (pieq)
Changed in plainbox-provider-canonical-certification:
milestone: 0.27 → 0.28
affects: plainbox-provider-canonical-certification → plainbox-provider-certification-client
Changed in plainbox-provider-certification-client:
milestone: 0.28 → none
Changed in plainbox-provider-certification-client:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.