project:cfg:BoardConfig_IPC: Added fastboot BoardConfig file and firmware post-scripts, distinguishing between the BoardConfigs for Luckfox Pico Pro and Luckfox Pico Max. project:app: Added fastboot_client and rk_smart_door for quick boot applications; updated rkipc app to adapt to the latest media library. media:samples: Added more usage examples. media:rockit: Fixed bugs; removed support for retrieving data frames from VPSS. media:isp: Updated rkaiq library and related tools to support connection to RKISP_Tuner. sysdrv:Makefile: Added support for compiling drv_ko on Luckfox Pico Ultra W using Ubuntu; added support for custom root filesystem. sysdrv:tools:board: Updated Buildroot optional mirror sources, updated some software versions, and stored device tree files and configuration files that undergo multiple modifications for U-Boot and kernel separately. sysdrv:source:mcu: Used RISC-V MCU SDK with RT-Thread system, mainly for initializing camera AE during quick boot. sysdrv:source:uboot: Added support for fastboot; added high baud rate DDR bin for serial firmware upgrades. sysdrv:source:kernel: Upgraded to version 5.10.160; increased NPU frequency for RV1106G3; added support for fastboot. Signed-off-by: luckfox-eng29 <eng29@luckfox.com> |
||
|---|---|---|
| .. | ||
| main | ||
| Kconfig | ||
| README.md | ||
| SConscript | ||
| sdkconfig.defaults | ||
RT-Thread A2DP-SOURCE demo
Demo of A2DP audio source role
This is the demo of using Advanced Audio Distribution Profile APIs to transmit audio stream. Application can take advantage of this example to implement portable audio players or microphones to transmit audio stream to A2DP sink devices.
How to use this example
Hardware Required
This example is able to run on any commonly available RK development board. And is supposed to connect to A2DP sink example in RT-Thread example.
Configure the project
scons --menuconfig
Configure the protocol stack and open the a2dp function.
RT-Thread Components --->
Bluetooth --->
[*] Bluedroid Enable --->
[*] Classic Bluetooth (NEW)
[*] A2DP
(2048) A2DP sink (audio stream decoding) task stack size (NEW)
(2048) A2DP source (audio stream encoding) task stack size (NEW)
Open a2dp source example.
RT-Thread Components --->
Bluetooth --->
examples bluetooth --->
Example 'A2DP SOURCE' Config --->
[*] Demo of a2dp audio source role
Example Output
For the first step, this example performs device discovery to search for a target device(A2DP sink) whose device name is "RK_SPEAKER" and whose "Rendering" bit of its Service Class field is set in its Class of Device. If a candidate target is found, the local device will initiate connection with it.
After connection with A2DP sink is established, the example performs the following running loop 1-2-3-4-1:
- audio transmission starts and lasts for a while
- audio transmission stops
- disconnect with target device
- reconnect to target device
The example implements an event loop triggered by a periodic "heart beat" timer and events from Bluetooth protocol stack callback functions.
After the local device discovers the target device and initiates connection, there will be logging message like this:
I (4090) BT_AV: Found a target device, address 24:0a:c4:02:0e:ee, name RK_SPEAKER
I (4090) BT_AV: Cancel device discovery ...
I (4100) BT_AV: Device discovery stopped.
I (4100) BT_AV: a2dp connecting to peer: RK_SPEAKER
If connection is set up successfully, there will be such message:
I (5100) BT_AV: a2dp connected
Start of audio transmission has the following notification message:
I (10880) BT_AV: a2dp media ready checking ...
...
I (10880) BT_AV: a2dp media ready, starting ...
...
I (11400) BT_AV: a2dp media start successfully.
Stop of audio transmission, and disconnection with remote device generate the following notification message:
I (110880) BT_AV: a2dp media stopping...
...
I (110920) BT_AV: a2dp media stopped successfully, disconnecting...
...
I (111040) BT_AV: a2dp disconnected
Troubleshooting
- For current stage, the supported audio codec in A2DP is SBC. SBC audio stream is encoded from PCM data normally formatted as 44.1kHz sampling rate, two-channel 16-bit sample data. Other SBC configurations can be supported but there is a need for additional modifications to the protocol stack.
- The raw PCM media stream in the example is generated by a sequence of random number, so the sound played on the sink side will be piercing noise.
- As a usage limitation, A2DP source can support at most one connection with remote A2DP sink devices. Also, A2DP source cannot be used together with A2DP sink at the same time, but can be used with other profiles such as SPP and HFP.