(→Building packages) |
|||
| Line 31: | Line 31: | ||
The build environment must have the following packages installed: | The build environment must have the following packages installed: | ||
| - | ;*libbltscommon-devel | + | ;*[[../BLTS Common Library | libbltscommon-devel]] |
;*kernel-headers | ;*kernel-headers | ||
;*dbus-glib-devel | ;*dbus-glib-devel | ||
| Line 41: | Line 41: | ||
The test environment must have following packages installed: | The test environment must have following packages installed: | ||
| - | ;*libbltscommon1 | + | ;*[[../BLTS Common Library | libbltscommon1]] |
The test package and associated configuration pacakge can be installed in the device with a command: | The test package and associated configuration pacakge can be installed in the device with a command: | ||
Contents |
The Advanced Linux Sound Architecture (ALSA) provides audio and MIDI functionality to the Linux operating system.
blts-alsa-core package uses the interface specified in asound.h to test kernel's sound core and drivers. ALSA's user space library (alsa-lib) is not used. In addition the test asset uses V4L2 API to control FM tuner.
Current BLTS ALSA core test coverage matrix:
Hardware coverage includes audio devices (soundcard, FM radio, etc)
The tests do not currently support verifying the sound passing through the audio path. Instead, the tester needs to listen to the produced audio to determine final results.
Support for various playback and capture parameters is missing, such as unsigned sample formats, and memory mapped non-interleaved access method. See section "Configuration file format" for supported parameters.
Extend coverage, add support for various missing PCM settings.
Recorded PCM data should be stored to a file for external verification, or the data should be verified by the test asset automatically.
The build environment must have the following packages installed:
The source package includes the pack.sh script, which is used for building RPM and Debian packages and source tar packages. To build an RPM package with the script, execute this command in the top level source directory of asset:
./pack.sh -r
To get help about the packaging script, execute
./pack.sh -h
The asset can also be built manually by executing:
./autogen.sh ./configure make
The test environment must have following packages installed:
The test package and associated configuration pacakge can be installed in the device with a command:
rpm -ivh blts-alsa-core-tests-{version}.rpm blts-alsa-core-tests-config-{platform}-{version}.rpm
Configuration package/file is platform dependant, see section "Configuration"
Run as root:
$ blts-alsa-core-tests
This will execute the test cases using default configuration file, which is /etc/blts/blts-alsa-core.cnf
By default the test results are printed to terminal and also to /var/log/tests/blts_alsa_core.txt.
Possible arguments for blts_alsa_core_test;
| General Switch | Function |
|---|---|
| -l | Used log file |
| -e | Execute single or multiple selected tests, for example -e 1,4,5. |
| -en | Execute test by name, for example -en "My test X" |
| -s | Show list of all tests |
| -C | Used configuration file |
| -? | Help message |
| -xml, -axml | Create result XML. -axml appends results to an existing XML file. |
| -auto | Silent logging for test automation. Only the results are printed to stdout. |
| -v | Verbose logging (default) |
| -vv | Even more verbose logging |
| Optional Switch | Function |
|---|---|
| -p | Enables profiling of ioctl calls |
Test case descriptions and execution commands:
The test cases are:
$ blts-alsa-core-tests -en "ALSA presence check"
$ blts-alsa-core-tests -en "Open and close PCM devices"
$ blts-alsa-core-tests -en "Open and close timer"
$ blts-alsa-core-tests -en "Open and close controls"
$ blts-alsa-core-tests -en "Open and close hwdeps"
$ blts-alsa-core-tests -en "Enumerate control elements"
$ blts-alsa-core-tests -en "Power management"
$ blts-alsa-core-tests -en "Enumerate devices with control interface"
$ blts-alsa-core-tests -en "Add and remove control element"
Rest of the test cases are generated from given configuration file, see next section.
Configuration file defines ALSA mixer (control) settings and used playback and recording parameters. These settings depend on platform.
Configuration file example (Intel HDA based soundcard);
[defaults]
[control]
card 0
set "Master Playback Volume" max
set "PCM Playback Volume" max
set "Master Playback Switch" off
set "Headphone Playback Switch" off
set "Front Playback Switch" off
set "Capture Switch" off
set "IEC958 Playback Switch" off
set "IEC958 Default PCM Playback Switch" off
[end_control]
[end_defaults]
[testset]
description "front headphone"
[control]
card 0
set "Master Playback Volume" max
set "PCM Playback Volume" max
set "Master Playback Switch" on
set "Headphone Playback Switch" on
set "Front Playback Switch" on
[end_control]
[playback]
card 0
device 0
rates 44100 96000 192000
formats S16_LE
channels 2
access INTERLEAVED MMAP_INTERLEAVED
hw_resampling 1
async SYNC
duration 5
freq 1000
[end_playback]
[end_testset]
[testset]
description "front mic with max volume"
[control]
card 0
set "Input Source" "Front Mic"
set "Capture Switch" on
set "Capture Volume" max
set "Front Mic Boost" min
[end_control]
[recording]
card 0
device 0
rates 44100 96000 192000
formats S16_LE
channels 2
access INTERLEAVED MMAP_INTERLEAVED
hw_resampling 1
duration 5
[end_recording]
[end_testset]
The above configuration file produces following test cases:
Each [testset] can contain multiple [playback], [recording] and [control] sections. This allows simultaneous recording and playback cases, such as playback to phone's earpiece while recording from the mic. Simplified example;
[testset] description "playback and recording" [control] ... [end_control] [playback] ... [end_playback] [recording] ... [end_recording] [end_testset]
[defaults] section:
Defines default control element settings. These settings are applied before and after each test case. Defaults -section can contain only [control] section(s).
[testset] section:
Defines a set of settings for playback and/or recording tests. A configuration file can contain multiple testset sections, and settings within one section do not interfere with other testset sections. If testset section contains multiple playback/recording sections, the tests from each recording/playback section are executed in parallel.
Possible variables:
[control] section:
Defines mixer (control) settings. The settings are applied in the given order before playback or recording.
Possible variables:
[playback]/[recording] section:
Defines PCM parameters for playback and recording.
Possible variables:
Some of the variables allow multiple values, and the test cases are generated by simply creating all combinations from given values.
[bluetooth] section:
Defines Bluetooth audio settings. If a Bluetooth A2DP device is defined here, it will be connected for the duration of the test. Pairing a device is not supported as yet, and should be done before testing.
Note that just connecting to a device is usually not enough for sound output. In most cases platform-specific mixer settings are needed.
Possible variables:
[tuner] section:
Defines v4l2 tuner settings. Possible variables:
The test module can be compiled to self-sufficient command line program. Both Debian and RPM packaging is also provided.
| alsa-project.org | ALSA website |
| V4L2 Tuner API | V4L2 tuner API |
| Version | Date | Handled By | Status | Comments |
|---|---|---|---|---|
| 0.1 | 14-sep-2010 | Iekku Huttunen | Draft | Page created |