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

apps: add Auracast USB sample with LC3 codec #1659

Merged
merged 4 commits into from
Apr 15, 2024

Conversation

KKopyscinski
Copy link
Contributor

This adds sample that acts as USB sound device. Audio signal is coded using LC3 and broadacasted using Auracast package.

@KKopyscinski
Copy link
Contributor Author

This depends on #1658 and #1619

@KKopyscinski KKopyscinski marked this pull request as ready for review December 4, 2023 08:29
@KKopyscinski KKopyscinski force-pushed the auracast-usb branch 4 times, most recently from 0a75ddf to 9c91f10 Compare December 5, 2023 06:38
@KKopyscinski
Copy link
Contributor Author

@sjanc apache/mynewt-core#3121 patch was merged and this builds now, can I merge this PR?

@KKopyscinski
Copy link
Contributor Author

@andrzej-kaczmarek removed unused and debug code, added serial ID config

BLE_MAX_BIG: 1
BLE_MAX_BIS: 2

BLE_PHY_NRF52_HEADERMASK_WORKAROUND: 1
Copy link
Contributor

Choose a reason for hiding this comment

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

this is only valid for nrf52

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved under syscfg.vals.BSP_NRF52:

apps/auracast_usb/src/main.c Outdated Show resolved Hide resolved
apps/auracast_usb/include/usb_audio.h Outdated Show resolved Hide resolved
apps/auracast_usb/src/audio_usb.c Outdated Show resolved Hide resolved
apps/auracast_usb/src/audio_usb.c Outdated Show resolved Hide resolved

#define BROADCAST_SID 1
#define BROADCAST_SDU_INTVL MYNEWT_VAL(LC3_FRAME_DURATION)
#define BROADCAST_SAMPLE_RATE BLE_AUDIO_SAMPLING_RATE_48000_HZ
Copy link
Contributor

Choose a reason for hiding this comment

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

this should depend on lc3 configuration

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added separate defines for BLE_AUDIO_SAMPLING_RATE_24000_HZ, BLE_AUDIO_SAMPLING_RATE_48000_HZ and BLE_AUDIO_SAMPLING_RATE_96000_HZ. I feel like we should have some kind of macro that translates sampling rate from number value to the spec, but this can be done in separate PR

apps/auracast_usb/src/main.c Outdated Show resolved Hide resolved
apps/auracast_usb/src/main.c Outdated Show resolved Hide resolved
apps/auracast_usb/src/audio_usb.c Outdated Show resolved Hide resolved
This adds sample that acts as USB sound device. Audio signal is coded
using LC3 and broadacasted using Auracast package.
Adds build target for auracast_usb application.
Cortex M-33 FPU doesn't support double precision arithmetic. Use float
instead of double so the performance can be improved. This allows to use
better interpolator in resampler.
Compile using floats instead of doubles, so the FPUs that don't support
double-precision arithmetic can be used.
@KKopyscinski
Copy link
Contributor Author

This needs libsamplerate patch to work properly: libsndfile/libsamplerate#210

@KKopyscinski KKopyscinski merged commit 61021c1 into apache:master Apr 15, 2024
16 of 17 checks passed
@KKopyscinski KKopyscinski deleted the auracast-usb branch April 15, 2024 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants