bluez-avrcp-volume manual

medium

Image Types:
basesdk-amd64 / hmi-armhf / hmi-amd64 / sdk-amd64
Image Deployment:
APT, OSTree
Type:
functional

Description

Test the AVRCP volume up and down commands.


Resources

  • A Bluetooth adapter
  • An A2DP Source and AVRCP capable phone (https://www.apertis.org/reference_hardware/extras/)
  • Note that you do not need to play any music on the phone; nor do you need to have headphones or a speaker plugged into the Apertis device.

Pre Conditions

  1. From a PC, download and unpack the test data tarball from the gitlab test repository:
  2. $ wget https://gitlab.apertis.org/tests/bluez-phone/-/archive/apertis/v2024dev0/bluez-phone.tar.gz
    $ tar -xvf bluez-phone.tar.gz
  3. Copy the bluez-phone-* folder to the target device:
  4. $ DUT_IP=<device-ip>
    $ scp -r bluez-phone-* user@$DUT_IP:
  5. Log into the target device:
  6. $ ssh user@$DUT_IP
  7. After log into the DUT, enter the test directory
  8. $ cd bluez-phone-*
  9. Note that the tarball may change depending on the release/branch being tested, please make sure to download the correct tarball for the release in question.
  10. If running the test on an SDK image, kill the blueman-applet process, as it prevents the test from installing its own pairing agent.
  11. Please note that connman disables bluetooth by default on a fresh image.
  12. Enable device:
  13. $ connmanctl enable bluetooth

Execution Steps

  1. The phone must be in discoverable mode for starting this test. Look for the phone in this list, and save the BT address. It will be used while running the test.
  2. Ensure the audio manager is activated:
  3. $ pactl stat
  4. Run btmon before any connection happens:
  5. $ sudo btmon  | grep -A4 'AV/C: Control'
  6. Execute the test suite in another terminal:
  7. $ ./bluez-avrcp-volume.sh
  8. There are some options:
  9. -a select which device you want to pair with (specify the address)

    -s skip pairing because the device is already paired. -a must be present when using this.

    -x enables test debugging (only useful if a test fails)

  10. Once the test begins, after Apertis finishes pairing with the phone, you must initiate pairing from the phone and do the pairing again as part of the test. You may need to unpair Apertis from within the phone first.

Expected

If success, the following output should be generated by btmon:

AV/C: Control: address 0x48 opcode 0x7c

Subunit: Panel

Opcode: Passthrough

Operation: 0x42 (VOLUME DOWN Pressed)

Length: 0x00

--

AV/C: Control: address 0x48 opcode 0x7c

  Subunit: Panel

  Opcode: Passthrough

  Operation: 0xc2 (VOLUME DOWN Released)

  Length: 0x00

--

AV/C: Control: address 0x48 opcode 0x7c

Subunit: Panel

Opcode: Passthrough

Operation: 0x41 (VOLUME UP Pressed)

Length: 0x00

--

AV/C: Control: address 0x48 opcode 0x7c

  Subunit: Panel

  Opcode: Passthrough

  Operation: 0xc1 (VOLUME UP Released)

  Length: 0x00

Notes

  • Errors most frequently occurs at pairing. This can be used to circumvent pairing problems, though this does not mean the test is a full pass, as the pairing is part of the test:
  • cd ~/bluez-avrcp-volume

    armhf/bin/pair_two hci0 <bt address of the phone>

    ./bluez-avrcp-volume.sh -a <address of the phone> -s