zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.34k stars 6.33k forks source link

LE Audio: Controller: Config settings with 44.1 kHz and 48 kHz are rejected at LE Create BIG #67050

Closed mkasenberg closed 6 months ago

mkasenberg commented 7 months ago

Describe the bug Not high prio, posting just for the record:

Zephyr controller rejects the LE Create BIG if the fallowing config settings are used:

When the Zephyr controller is built with CONFIG_BT_CTLR_CONN_ISO_LOW_LATENCY_POLICY=n the LE Create BIG succeed, but only for the 441_1 setting. Even then the PTS device is not able to synchronize to the broadcast.

To Reproduce With the AutoPTS and nRF5340 board.

Expected behavior Zephyr controller accepts each of the mentioned config settings.

Impact Affected PTS test cases: BAP/BSRC/STR/BV-09-C BAP/BSRC/STR/BV-10-C BAP/BSRC/STR/BV-26-C BAP/BSRC/STR/BV-27-C BAP/BSRC/STR/BV-28-C BAP/BSRC/STR/BV-29-C BAP/BSRC/STR/BV-30-C BAP/BSRC/STR/BV-31-C BAP/BSRC/STR/BV-32-C BAP/BSRC/STR/BV-33-C

Logs and console output

Environment

Additional context @cvinayak

henrikbrixandersen commented 7 months ago

Please use our bug template when reporting bugs. You need to edit this issue to include the information requested in https://github.com/zephyrproject-rtos/zephyr/blob/main/.github/ISSUE_TEMPLATE/001_bug_report.md

Thalley commented 7 months ago

We should add broadcast testing to the existing GMAP and CAP AC tests, which currently only covers unicast.

cvinayak commented 7 months ago

@mkasenberg is there any pointer to be on "getting started" to be able to reproduce the failures reported?

To Reproduce With the AutoPTS and nRF5340 board.

Assuming a new resource working on this issue, what are the needed steps to reproduce the issue?

Thalley commented 7 months ago

@mkasenberg is there any pointer to be on "getting started" to be able to reproduce the failures reported?

To Reproduce With the AutoPTS and nRF5340 board.

Assuming a new resource working on this issue, what are the needed steps to reproduce the issue?

I'll create a PR to add the CAP and GMAP broadcast audio configurations for BSIM

mkasenberg commented 7 months ago

AutoPTS instruction can be found at: https://docs.zephyrproject.org/latest/connectivity/bluetooth/autopts/autopts-win10.html https://docs.zephyrproject.org/latest/connectivity/bluetooth/autopts/autopts-linux.html

Steps to reproduce:

  1. Have nRF5340 board (revision 2.0.0 in my case)

  2. Have 1 PTS dongle (the LE Only one)

  3. Have installed the PTS 8.5.3.4

  4. Have installed the AutoPTS

I use Windows as host, because the PTS starts faster than when I used Linux host + Windows virtual machine. But it should not matter. I have installed Python 3.11.6..

  1. Last Zephyr SHA that I tested and the issue still persisted is c3e8b731eff5beb5b28aef248bbc8ed20a2c7419, so git-checkout on that:

    git checkout c3e8b73
    west update
  2. Go to the zephyrproject/zephyr/samples/bluetooth/hci_ipc directory, then build and flash the app for the netcore:

    west build -b nrf5340dk_nrf5340_cpunet -- -DOVERLAY_CONFIG='nrf5340_cpunet_iso-bt_ll_sw_split.conf;../../../tests/bluetooth/tester/nrf5340_hci_ipc_cpunet.conf'
    west flash
  3. Go to the zephyrproject/zephyr/tests/bluetooth/tester directory, then build and flash the app for the appcore:

    west build -b nrf5340dk_nrf5340_cpuapp -- -DOVERLAY_CONFIG='nrf5340_hci_ipc.conf;overlay-le-audio.conf'
    west flash
  4. Close the PTS, if it is opened.

  5. Go to the auto-pts directory and start the autopts server:

    python autoptsserver.py

The autopts server will start the PTS in automation mode. Wait until the autoptsserver prints OK:

$ python autoptsserver.py
(2366879466768) Starting PTS 65000 ...
Local IP address: ('192.168.107.1', 'fe80::f87b:c093:ad28:dae8') DNS None
Local IP address: ('192.168.9.117', 'fe80::a694:4949:87af:e0b1') DNS None
Local IP address: ('192.168.58.1', 'fe80::f0b7:3be5:cc53:1889') DNS None
Serving on port 65000 ...
(2366879466768) OK
  1. Find the jlink uart port name of the app core. There are usually two ports visible for nrf53. Find the one that prints these 5 bytes after board reset: 00 80 ff 00 00

It is the BTP ready event. You can use the PuTTY or the below python script to check the port output:

import serial
com = 'COM4'
ser = serial.Serial(com, 115200, timeout=5)
ser.flushInput()
ser.flushOutput()
input('Reset board and press enter')
print(ser.read(9999))
ser.close()

There should be no other bytes in the output except those of the BTP Ready event.

  1. Start the autopts client: (You may have to adjust the port name and the IPs here)

Don't hesitate to ask questions under AutoPTS issues or you can reach me on discord, as the first launch can be troublesome.

Thalley commented 7 months ago

@cvinayak https://github.com/zephyrproject-rtos/zephyr/pull/67210 adds testing of all audio configurations and low latency presets from the BAP spec. Quite a lot of them are not passing (see the commented out tests).

This does not include the high reliability tests (yet).

cvinayak commented 7 months ago

@cvinayak #67210 adds testing of all audio configurations and low latency presets from the BAP spec. Quite a lot of them are not passing (see the commented out tests).

This does not include the high reliability tests (yet).

Work in progress addressing failures in #67210 is here: https://github.com/zephyrproject-rtos/zephyr/pull/67392

cvinayak commented 7 months ago

@mkasenberg Thank you for your instructions, I will switch to reproducing the issues once I get to fix controller for the test in #67210

cvinayak commented 7 months ago

@mkasenberg is it possible to run the failing PTS tests on a controller on this branch (before I get to setup my PTS)? https://github.com/zephyrproject-rtos/zephyr/pull/67392

mkasenberg commented 7 months ago

Yes, let's try if autopts bot is still operative.

cvinayak commented 7 months ago

@mkasenberg Looks like PR run has failed, is the failures same as original failures or any improvements seen in the controller fro the PR?

mkasenberg commented 7 months ago

I saw the bot logs and the patch works great, controller has successfully accepted the config settings. The autopts cron has reported fails, because an MMI handler in autopts has a bug and does not send anything, the fix is not merged yet https://github.com/auto-pts/auto-pts/pull/1067/commits/f1453575017757489ef8250dc57a3ca0c95b5181#diff-fc44e218eeb03508ffb17b3eda2ca77928b173334fe43d2c55ff23df09b09e46R315-R323

cvinayak commented 7 months ago

thank you, added fixes comment for this gh issue in the Pr #67392 .... we can re-open this issue if there are problem when fixes are merged into main.