plugin: shell
name: audio/list_devices
estimated_duration: 1.0
requires:
 device.category == 'AUDIO'
 package.name == 'alsa-base'
command: cat /proc/asound/cards
_description: Test to detect audio devices

plugin: user-interact-verify
name: audio/playback_auto
estimated_duration: 5.0
depends: audio/list_devices
requires:
 device.category == 'AUDIO'
 package.name == 'alsa-base'
 package.name == 'gir1.2-gst-plugins-base-0.10' or package.name == 'gir1.2-gst-plugins-base-1.0'
 package.name == 'pulseaudio-utils'
command: audio_settings store --file=$CHECKBOX_DATA/pulseaudio_settings; audio_settings set --device=pci --volume=50; gst_pipeline_test -t 2 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink'; EXIT_CODE=$?; audio_settings restore --file=$CHECKBOX_DATA/pulseaudio_settings; exit $EXIT_CODE
_description:
 PURPOSE:
     This test will check that internal speakers work correctly
 STEPS:
     1. Make sure that no external speakers or headphones are connected
        If testing a desktop, external speakers are allowed
     2. Click the Test button to play a brief tone on your audio device
 VERIFICATION:
     Did you hear a tone?

plugin: user-interact-verify
name: audio/playback_hdmi
estimated_duration: 30.0
requires:
 device.category == 'AUDIO'
 package.name == 'alsa-base'
 package.name == 'gir1.2-gst-plugins-base-0.10' or package.name == 'gir1.2-gst-plugins-base-1.0'
 package.name == 'pulseaudio-utils'
command:
 audio_settings store --verbose --file=$CHECKBOX_DATA/pulseaudio_settings; audio_settings set --verbose --device=hdmi --volume=50; gst_pipeline_test -t 2 --device hdmi 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink'; EXIT_CODE=$?; audio_settings restore --verbose --file=$CHECKBOX_DATA/pulseaudio_settings; exit $EXIT_CODE
_description:
 PURPOSE:
     HDMI audio interface verification
 STEPS:
     1. Plug an external HDMI device with sound (Use only one HDMI/DisplayPort interface at a time for this test)
     2. Click the Test button
 VERIFICATION:
     Did you hear the sound from the HDMI device?

plugin: user-interact-verify
name: audio/playback_displayport
estimated_duration: 30.0
requires:
 device.category == 'AUDIO'
 package.name == 'alsa-base'
 package.name == 'gir1.2-gst-plugins-base-0.10' or package.name == 'gir1.2-gst-plugins-base-1.0'
 package.name == 'pulseaudio-utils'
command:
 audio_settings store --verbose --file=$CHECKBOX_DATA/pulseaudio_settings; audio_settings set --verbose --device=hdmi --volume=50; gst_pipeline_test -t 2 --device hdmi 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink'; EXIT_CODE=$?; audio_settings restore --verbose --file=$CHECKBOX_DATA/pulseaudio_settings; exit $EXIT_CODE
_description:
 PURPOSE:
     DisplayPort audio interface verification
 STEPS:
     1. Plug an external DisplayPort device with sound (Use only one HDMI/DisplayPort interface at a time for this test)
     2. Click the Test button
 VERIFICATION:
     Did you hear the sound from the DisplayPort device?

plugin: user-interact-verify
name: audio/playback_headphones
estimated_duration: 20.0
depends: audio/list_devices
requires:
 device.category == 'AUDIO'
 package.name == 'alsa-base'
 package.name == 'gir1.2-gst-plugins-base-0.10' or package.name == 'gir1.2-gst-plugins-base-1.0'
 package.name == 'pulseaudio-utils'
command: audio_settings store --file=$CHECKBOX_DATA/pulseaudio_settings; audio_settings set --device=pci --volume=50; gst_pipeline_test -t 2 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink'; EXIT_CODE=$?; audio_settings restore --file=$CHECKBOX_DATA/pulseaudio_settings; exit $EXIT_CODE
_description:
 PURPOSE:
     This test will check that headphones connector works correctly
 STEPS:
     1. Connect a pair of headphones to your audio device
     2. Click the Test button to play a sound to your audio device
 VERIFICATION:
     Did you hear a sound through the headphones and did the sound play without any distortion, clicks or other strange noises from your headphones?

plugin: user-interact-verify
name: audio/alsa_record_playback_internal
estimated_duration: 20.0
depends: audio/playback_auto
requires:
 device.category == 'AUDIO'
 package.name == 'alsa-base'
 package.name == 'pulseaudio-utils'
 package.name == 'gstreamer1.0-plugins-good' or package.name == 'gstreamer0.10-plugins-good'
command: audio_settings store --file=$CHECKBOX_DATA/pulseaudio_settings; audio_settings set --device=pci --volume=50; alsa_record_playback; EXIT_CODE=$?; audio_settings restore --file=$CHECKBOX_DATA/pulseaudio_settings; exit $EXIT_CODE
_description:
 PURPOSE:
     This test will check that recording sound using the onboard microphone works correctly
 STEPS:
     1. Disconnect any external microphones that you have plugged in
     2. Click "Test", then speak into your internal microphone
     3. After a few seconds, your speech will be played back to you.
 VERIFICATION:
     Did you hear your speech played back?

plugin: user-interact-verify
name: audio/alsa_record_playback_external
estimated_duration: 20.0
depends: audio/playback_headphones
requires:
 device.category == 'AUDIO'
 package.name == 'alsa-base'
 package.name == 'pulseaudio-utils'
 package.name == 'gstreamer1.0-plugins-good' or package.name == 'gstreamer0.10-plugins-good'
command: audio_settings store --file=$CHECKBOX_DATA/pulseaudio_settings; audio_settings set --device=pci --volume=50; alsa_record_playback; EXIT_CODE=$?; audio_settings restore --file=$CHECKBOX_DATA/pulseaudio_settings; exit $EXIT_CODE
_description:
 PURPOSE:
     This test will check that recording sound using an external microphone works correctly
 STEPS:
     1. Connect a microphone to your microphone port
     2. Click "Test", then speak into the external microphone
     3. After a few seconds, your speech will be played back to you
 VERIFICATION:
     Did you hear your speech played back?

plugin: user-interact-verify
name: audio/alsa_record_playback_usb
requires:
 device.category == 'AUDIO'
 package.name == 'alsa-base'
 package.name == 'pulseaudio-utils'
 package.name == 'gstreamer1.0-plugins-good' or package.name == 'gstreamer0.10-plugins-good'
command: audio_settings store --file=$CHECKBOX_DATA/pulseaudio_settings; audio_settings set --device=usb --volume=50; alsa_record_playback; EXIT_CODE=$?; audio_settings restore --file=$CHECKBOX_DATA/pulseaudio_settings; exit $EXIT_CODE
_description:
 PURPOSE:
     This test will check that a USB audio device works correctly
 STEPS:
     1. Connect a USB audio device to your system
     2. Click "Test", then speak into the microphone
     3. After a few seconds, your speech will be played back to you
 VERIFICATION:
     Did you hear your speech played back through the USB headphones?

plugin: shell
name: audio/alsa_record_playback_automated
estimated_duration: 10.0
requires:
 package.name == 'python3-gi'
 package.name == 'gir1.2-gstreamer-1.0'
 package.name == 'libgstreamer1.0-0'
 package.name == 'gstreamer1.0-plugins-good'
 package.name == 'gstreamer1.0-pulseaudio'
 package.name == 'alsa-base'
 device.category == 'AUDIO'
command: audio_test
_description:
 Play back a sound on the default output and listen for it on the
 default input.

plugin: shell
name: audio/alsa_info_collect
estimated_duration: 2.0
command: alsa_info --no-dialog --no-upload --output ${CHECKBOX_DATA}/alsa_info.log
_description:
 Collect audio-related system information. This data can be used to
 simulate this computer's audio subsystem and perform more detailed tests
 under a controlled environment.

plugin: attachment
name: audio/alsa_info_attachment
depends: audio/alsa_info_collect
estimated_duration: 1.0
command: [ -e ${CHECKBOX_DATA}/alsa_info.log ] && cat ${CHECKBOX_DATA}/alsa_info.log
_description:
 Attaches the audio hardware data collection log to the results.

plugin: user-interact-verify
name: audio/channels
estimated_duration:  20.0
command: speaker-test -c 2 -l 1 -t wav
_description:
 PURPOSE:
     Check that the various audio channels are working properly
 STEPS:
     1. Click the Test button
 VERIFICATION:
     You should clearly hear a voice from the different audio channels

plugin: shell
name: audio/check_volume
estimated_duration: 1.0
requires:
 package.name == 'pulseaudio-utils'
 device.category == 'AUDIO'
command: volume_test --minvol 1 --maxvol 100
_description:
 This test will verify that the volume levels are at an acceptable level on
 your local system.  The test will validate that the volume is greater than
 or equal to minvol and less than or equal to maxvol for all sources (inputs)
 and sinks (outputs) recognized by PulseAudio.  It will also validate that the
 active source and sink are not muted.  You should not manually adjust the
 volume or mute before running this test.

plugin: manual
name: audio/external-lineout
estimated_duration: 30.0
_description:
 PURPOSE:
      Check that external line out connection works correctly
 STEPS:
      1. Insert cable to speakers (with built-in amplifiers) on the line out port
      2. Open system sound preferences, 'Output' tab, select 'Line-out' on the connector list. Click the Test button
      3. On the system sound preferences, select 'Internal Audio' on the device list and click 'Test Speakers' to check left and right channel
 VERIFICATION:
      1. Do you hear a sound in the speakers? The internal speakers should *not* be muted automatically
      2. Do you hear the sound coming out on the corresponding channel?

plugin: user-interact-verify
name: audio/external-linein
estimated_duration: 120.0
requires:
 device.category == 'AUDIO'
 package.name == 'alsa-base'
 package.name == 'pulseaudio-utils'
 package.name == 'gstreamer1.0-plugins-good' or package.name == 'gstreamer0.10-plugins-good'
command: audio_settings store --file=$CHECKBOX_DATA/pulseaudio_settings; audio_settings set --device=pci --volume=50; alsa_record_playback; EXIT_CODE=$?; audio_settings restore --file=$CHECKBOX_DATA/pulseaudio_settings; exit $EXIT_CODE
_description:
 PURPOSE:
     Check that external line in connection works correctly
 STEPS:
     1. Use a cable to connect the line in port to an external line out source.
     2. Open system sound preferences, 'Input' tab, select 'Line-in' on the connector list. Click the Test button
     3. After a few seconds, your recording will be played back to you.
 VERIFICATION:
     Did you hear your recording?

plugin: user-interact
name: audio/speaker-headphone-plug-detection
estimated_duration: 60.0
requires:
 device.category == 'AUDIO'
 package.name == 'pulseaudio-utils'
command: pulse-active-port-change sinks
_description:
 PURPOSE:
     Check that system detects speakers or headphones being plugged in
 STEPS:
     1. Prepare a pair of headphones or speakers with a standard 3.5mm jack
     2. Locate the speaker / headphone jack on the device under test
     3. Run the test (you have 30 seconds from now on)
     4. Plug headphones or speakers into the appropriate jack
     5. Unplug the device for subsequent tests.
 VERIFICATION:
     Verification is automatic, no action is required.
     The test times out after 30 seconds (and fails in that case).

plugin: user-interact
name: audio/microphone-plug-detection
estimated_duration: 60.0
requires:
 device.category == 'AUDIO'
 package.name == 'pulseaudio-utils'
command: pulse-active-port-change sources
_description:
 PURPOSE:
     Check that system detects a microphone being plugged in
 STEPS:
     1. Prepare a microphone with a standard 3.5mm jack
     2. Locate the microphone jack on the device under test.
        Keep in mind that it may be shared with the headphone jack.
     3. Run the test (you have 30 seconds from now on)
     4. Plug the microphone into the appropriate jack
     5. Unplug the device for subsequent tests.
 VERIFICATION:
     Verification is automatic, no action is required.
     The test times out after 30 seconds (and fails in that case).

plugin: user-interact-verify
name: audio/balance_internal_speaker
estimated_duration: 20.0
depends: audio/playback_auto
requires:
 device.category == 'AUDIO'
 package.name == 'alsa-base'
 package.name == 'gir1.2-gst-plugins-base-0.10' or package.name == 'gir1.2-gst-plugins-base-1.0'
 package.name == 'pulseaudio-utils'
command: audio_settings store --file=$CHECKBOX_DATA/pulseaudio_settings; audio_settings set --device=pci --volume=50; gst_pipeline_test -t 10 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink'; EXIT_CODE=$?; audio_settings restore --file=$CHECKBOX_DATA/pulseaudio_settings; exit $EXIT_CODE
_description:
 PURPOSE:
     Check that balance control works correctly on internal speakers
 STEPS:
     1. Check that moving the balance slider from left to right works smoothly
     2. Click the Test button to play an audio tone for 10 seconds.
     3. Move the balance slider from left to right and back.
     4. Check that actual speaker audio balance follows your setting.
 VERIFICATION:
     Does the slider move smoothly, as well as being followed by the setting by the actual audio output?

plugin: user-interact-verify
name: audio/balance_headphones
depends: audio/playback_headphones
estimated_duration: 30.0
requires:
 device.category == 'AUDIO'
 package.name == 'alsa-base'
 package.name == 'gir1.2-gst-plugins-base-0.10' or package.name == 'gir1.2-gst-plugins-base-1.0'
 package.name == 'pulseaudio-utils'
command: audio_settings store --file=$CHECKBOX_DATA/pulseaudio_settings; audio_settings set --device=pci --volume=50; gst_pipeline_test -t 10 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink'; EXIT_CODE=$?; audio_settings restore --file=$CHECKBOX_DATA/pulseaudio_settings; exit $EXIT_CODE
_description:
 PURPOSE:
     Check that balance control works correctly on external headphone
 STEPS:
     1. Check that moving the balance slider from left to right works smoothly
     2. Click the Test button to play an audio tone for 10 seconds.
     3. Move the balance slider from left to right and back.
     4. Check that actual headphone audio balance follows your setting.
 VERIFICATION:
     Does the slider move smoothly, as well as being followed by the setting by the actual audio output?

plugin: shell
name: audio/list_devices_after_suspend_30_cycles
estimated_duration: 1.0
depends: power-management/suspend_30_cycles
requires:
 device.category == 'AUDIO'
 package.name == 'alsa-base'
command: cat /proc/asound/cards
_description: Test to detect audio devices after suspending 30 times.

plugin: user-interact-verify
name: audio/playback_auto_after_suspend_30_cycles
estimated_duration: 5.0
depends: audio/list_devices power-management/suspend_30_cycles
requires:
 device.category == 'AUDIO'
 package.name == 'alsa-base'
 package.name == 'gir1.2-gst-plugins-base-0.10' or package.name == 'gir1.2-gst-plugins-base-1.0'
 package.name == 'pulseaudio-utils'
command: audio_settings store --file=$CHECKBOX_DATA/pulseaudio_settings; audio_settings set --device=pci --volume=50; gst_pipeline_test -t 2 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink'; EXIT_CODE=$?; audio_settings restore --file=$CHECKBOX_DATA/pulseaudio_settings; exit $EXIT_CODE
_description:
 PURPOSE:
     This test will check that internal speakers work correctly after suspending 30 times.
 STEPS:
     1. Make sure that no external speakers or headphones are connected
        If testing a desktop, external speakers are allowed
     2. Click the Test button to play a brief tone on your audio device
 VERIFICATION:
     Did you hear a tone?

plugin: shell
name: audio/alsa_record_playback_automated_after_suspend_30_cycles
estimated_duration: 10.0
depends: power-management/suspend_30_cycles
requires:
 package.name == 'python3-gi'
 package.name == 'gir1.2-gstreamer-1.0'
 package.name == 'libgstreamer1.0-0'
 package.name == 'gstreamer1.0-plugins-good'
 package.name == 'gstreamer1.0-pulseaudio'
 package.name == 'alsa-base'
 device.category == 'AUDIO'
command: audio_test
_description:
 Play back a sound on the default output and listen for it on the
 default input, after suspending 30 times.

plugin: shell
name: audio/check_volume_after_suspend_30_cycles
estimated_duration: 1.0
depends: power-management/suspend_30_cycles
requires:
 package.name == 'pulseaudio-utils'
 device.category == 'AUDIO'
command: volume_test --minvol 1 --maxvol 100
_description:
 This test will verify that the volume levels are at an acceptable level on
 your local system.  The test will validate that the volume is greater than
 or equal to minvol and less than or equal to maxvol for all sources (inputs)
 and sinks (outputs) recognized by PulseAudio.  It will also validate that the
 active source and sink are not muted.  You should not manually adjust the
 volume or mute before running this test.

plugin: shell
name: audio/audio_after_suspend_30_cycles
estimated_duration: 1.0
depends: power-management/suspend_30_cycles
requires:
 device.category == 'AUDIO'
 package.name == 'alsa-base'
_description: Record mixer settings after suspending 30 times.
command:
 audio_settings store --file=$CHECKBOX_DATA/audio_settings_after_suspend_30_cycles; diff $CHECKBOX_DATA/audio_settings_before_suspend $CHECKBOX_DATA/audio_settings_after_suspend_30_cycles
