Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

applications: nrf5340_audio: Enable bidirectional CIS #8915

Merged
merged 1 commit into from Oct 14, 2022

Conversation

alexsven
Copy link
Contributor

@alexsven alexsven commented Oct 5, 2022

Implement a microphone return stream from
left headset to gateway

Signed-off-by: Erik Robstad erik.robstad@nordicsemi.no

@github-actions github-actions bot added the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Oct 5, 2022
@alexsven alexsven force-pushed the OCT-2068-enable-bidirectionality branch 4 times, most recently from a0e582a to 4468f96 Compare October 6, 2022 10:54
@alexsven alexsven marked this pull request as ready for review October 6, 2022 10:54
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Oct 6, 2022

Integration test specification

Test Module File based changes Manually selected West overwrite
test-sdk-audio X

Detailed information of selected test modules

Note: This message is automatically posted and updated by the CI

@NordicBuilder
Copy link
Contributor

You can find the documentation preview for this PR at this link. It will be updated about 10 minutes after the documentation build succeeds.

Note: This comment is automatically posted by the Documentation Publishing GitHub Action.

Copy link
Contributor

@erikrobstad erikrobstad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general it feels overly hardcoded, at least on the gateway. But I guess it has to be this way because of the current limitations.

Also, remember documentation change

@alexsven alexsven force-pushed the OCT-2068-enable-bidirectionality branch from 4468f96 to d2ea0c9 Compare October 7, 2022 14:02
@github-actions github-actions bot added the doc-required PR must not be merged without tech writer approval. label Oct 7, 2022
applications/nrf5340_audio/src/audio/Kconfig Outdated Show resolved Hide resolved
applications/nrf5340_audio/src/audio/Kconfig Outdated Show resolved Hide resolved
@@ -91,10 +86,12 @@ Connected Isochronous Stream (CIS)
In this configuration, you can use the nRF5340 Audio development kit in the role of the gateway, the left headset, or the right headset.

.. note::
In the current version of the nRF5340 Audio application, the CIS mode offers only monodirectional communication.
In the current version of the nRF5340 Audio application, the CIS mode offers both unidirectional and bidirectional communication.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to add a section under Configuration -- "Selecting the CIS bidirectional communication" -- and describe there how to enable the bidirectional stream.

Also, we need to mention that Testing covers the unidirectional mode.

@erikrobstad , does this PR require changes in the figures? I gave a cursory look, but I'm unable to verify.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@greg-fer It does not look like we need to change the figures

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexsven It does not look like you have added that (CIS) Testing covers the unidirectional mode.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing as in the CI-system? The tests for bidirectional are done, just waiting for this PR to be merged

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the documentation Testing section it must be mentioned that this is for the unidirectional mode.

@alexsven alexsven force-pushed the OCT-2068-enable-bidirectionality branch 2 times, most recently from cd72a49 to 869fe3d Compare October 10, 2022 12:33
applications/nrf5340_audio/README.rst Outdated Show resolved Hide resolved
applications/nrf5340_audio/README.rst Outdated Show resolved Hide resolved
applications/nrf5340_audio/README.rst Outdated Show resolved Hide resolved
@greg-fer
Copy link
Contributor

Also, I would suggest adding a changelog entry, but it is your call :)

@alexsven alexsven force-pushed the OCT-2068-enable-bidirectionality branch from 869fe3d to d5c9098 Compare October 11, 2022 10:16
@github-actions github-actions bot removed the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Oct 11, 2022
Copy link
Contributor

@greg-fer greg-fer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, but please add those periods. Period.

applications/nrf5340_audio/README.rst Outdated Show resolved Hide resolved
doc/nrf/releases/release-notes-changelog.rst Outdated Show resolved Hide resolved
@alexsven alexsven force-pushed the OCT-2068-enable-bidirectionality branch from d5c9098 to 81a3efc Compare October 12, 2022 06:37
Copy link
Contributor

@rick1082 rick1082 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the discussion, understood that this is the first step for bidirection feature. And will keep improve for supporting TWS in the later.

@alexsven alexsven force-pushed the OCT-2068-enable-bidirectionality branch from 81a3efc to 4427168 Compare October 13, 2022 07:22
@alexsven alexsven force-pushed the OCT-2068-enable-bidirectionality branch from 4427168 to 0087d15 Compare October 13, 2022 08:17
@alexsven alexsven force-pushed the OCT-2068-enable-bidirectionality branch from 0087d15 to b1656e2 Compare October 13, 2022 10:54
applications/nrf5340_audio/README.rst Show resolved Hide resolved
applications/nrf5340_audio/README.rst Show resolved Hide resolved
@@ -91,10 +86,12 @@ Connected Isochronous Stream (CIS)
In this configuration, you can use the nRF5340 Audio development kit in the role of the gateway, the left headset, or the right headset.

.. note::
In the current version of the nRF5340 Audio application, the CIS mode offers only monodirectional communication.
In the current version of the nRF5340 Audio application, the CIS mode offers both unidirectional and bidirectional communication.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@greg-fer It does not look like we need to change the figures

@@ -91,10 +86,12 @@ Connected Isochronous Stream (CIS)
In this configuration, you can use the nRF5340 Audio development kit in the role of the gateway, the left headset, or the right headset.

.. note::
In the current version of the nRF5340 Audio application, the CIS mode offers only monodirectional communication.
In the current version of the nRF5340 Audio application, the CIS mode offers both unidirectional and bidirectional communication.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexsven It does not look like you have added that (CIS) Testing covers the unidirectional mode.

@alexsven alexsven force-pushed the OCT-2068-enable-bidirectionality branch from b1656e2 to 4cb2cd2 Compare October 13, 2022 11:11
Copy link
Contributor

@erikrobstad erikrobstad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember the part in the documentation Testing section, ref. previous comment

@@ -34,6 +34,7 @@ Overview
The application can work as a gateway or a headset.
The gateway receives the audio data from external sources (USB or I2S) and forwards it to one or more headsets.
The headset is a receiver device that plays back the audio it gets from the gateway.
There is also the bidirectional mode where both gateway and headset can receive and send at the same time.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
There is also the bidirectional mode where both gateway and headset can receive and send at the same time.
It is also possible to enable a bidirectional mode where one gateway and one headset can send and receive audio to and from each other at the same time.


Play and pause emulated by disabling and enabling stream, respectively.
- The following limitations apply:

* BAP unicast, one CIG with two CIS.
* Audio input: USB or I2S (Line in or using Pulse Density Modulation).
* Audio output: USB or I2S/Analog headset output.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isnt it a limitation that only one headset can be used for bidirectional stream?

@alexsven alexsven force-pushed the OCT-2068-enable-bidirectionality branch from 4cb2cd2 to fdb05bf Compare October 13, 2022 12:11
@@ -196,10 +196,11 @@ config BUF_BLE_RX_PACKET_NUM
gaps due to BLE retransmits.

config STREAM_BIDIRECTIONAL
bool "Enable bi-directional stream - Currently not supported"
depends on TRANSPORT_CIS
bool "Enable bidirectional stream"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove enable as per guide lines:
https://docs.zephyrproject.org/latest/build/kconfig/tips.html#prompt-strings

For a Kconfig symbol that enables a driver/subsystem FOO, consider having just “Foo” as the prompt, instead of “Enable Foo support” or the like.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -143,8 +142,13 @@ config BT_AUDIO_UNICAST_CLIENT
bool
default y

config BT_ISO_TX_BUF_COUNT
int
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is just changing the default then there is no need for the int type.

Suggested change
int

https://docs.zephyrproject.org/latest/build/kconfig/tips.html#common-kconfig-shorthands

For a symbol defined in multiple locations (e.g., in a Kconfig.defconfig file in Zephyr), it is best to only give the symbol type for the “base” definition of the symbol

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, I removed all int, bool, string etc from this file. But the rest of the Kconfig.default files we should do as a separate PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the rest of the Kconfig.default files we should do as a separate PR

agreed.

config BT_ISO_TX_BUF_COUNT
int
default 2

config BT_MAX_CONN
int
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is existing code, but when update the default then please remove the int type.

Suggested change
int

default 2

config BT_AUDIO_UNICAST_CLIENT_ASE_SRC_COUNT
int
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
int

int
default 1 if STREAM_BIDIRECTIONAL
default 0

config BT_VCS_CLIENT
bool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bool

@@ -159,6 +163,16 @@ config BT_AUDIO_UNICAST_CLIENT_GROUP_STREAM_COUNT
int
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
int

Implement a microphone return stream from
left headset to gateway

Signed-off-by: Erik Robstad <erik.robstad@nordicsemi.no>
Signed-off-by: Alexander Svensen <alexander.svensen@nordicsemi.no>
@alexsven alexsven force-pushed the OCT-2068-enable-bidirectionality branch from fdb05bf to d016088 Compare October 14, 2022 10:47
Copy link
Contributor

@tejlmand tejlmand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@tejlmand tejlmand merged commit f543395 into nrfconnect:main Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-required PR must not be merged without tech writer approval.
Projects
None yet
6 participants