Compare commits

..

31 Commits

Author SHA1 Message Date
Rudis Muiznieks f0bf978454
custom key mappings 2024-06-03 11:55:53 -05:00
Ben V. Brown f64468868c Fix ability to build anc_assist 2024-05-13 19:12:26 +10:00
Ben V. Brown 850cb666c4 Notes 2024-05-13 18:43:15 +10:00
Ben V. Brown 833de0f666 Make LED toggle part of config 2024-05-12 20:25:04 +10:00
Ben V. Brown 7365d8e6b8 Merge branch 'main' into anc-testing 2024-05-12 19:14:16 +10:00
Ben V. Brown 0751b1cf75
Merge pull request #101 from nicka101/main
Functional UART logging both inside and outside dev container
2024-05-12 18:57:33 +10:00
Nick Anstee b61712a01c Functional UART logging both inside and outside dev container
Adds minicom and sudo to the docker image
Switches the shebang line to bash to fix a bug in uart_log.sh when
 inside the container (-n option to read requires bash)
2024-05-10 18:05:30 +02:00
Ben V. Brown d8be791cad
Merge pull request #100 from nicka101/main
Enable LDAC in the build
2024-05-10 13:22:05 +10:00
nicka101 839d513367 Enable LDAC in the build
Permit LDAC to be enabled independenly of LHDC
Fix a bug/oversight in bt_sbc_player which caused system frequencies above 52M to be ignored
2024-05-10 04:22:21 +02:00
Ben V. Brown 61f736b66b
Merge pull request #99 from nicka101/patch-1
Update uart_log.sh for easier debugging
2024-05-10 08:47:37 +10:00
Nick Anstee 3e95c41c0d
Update uart_log.sh
Pick the serial device by ID, allowing us to safely predict the paths to find the left and right bud at
Also improve the script so it asks which bud we'd like to debug
Specify necessary minicom options, so it opens even if the default configuration is invalid
2024-05-09 19:00:34 +02:00
Ben V. Brown ea0d5b067a Update target.mk 2024-02-07 12:04:14 +11:00
Haxk20 851fb95dcb anc: Fix enable/disable from slave bud
Switching ANC on or off from master bud has always worked
since we could just straight up enable it and no command had to be
sent.

When switching from slave bud we had to send the command to enable
or disable it via app_anc_key. Issue is the handling of this request
is from app_anc_cmd_receive_process which is not called without
APP_ANC being defined.

This commit cleans up the way ANC is enabled and also fixes slave
bud ANC switching by implementing the actual code path :)
2024-02-07 12:04:14 +11:00
Ben V. Brown bc68d1628e Turn off resample for now (to avoid 56k profile) 2024-02-07 12:03:38 +11:00
Ben V. Brown 9f5d2d6956 Port fb tuning values 2024-02-07 12:03:38 +11:00
Ben V. Brown c76a31e13a Update decoder 2024-02-07 12:03:38 +11:00
Ben V. Brown 5bc29ea41e Port some rough anc numbers from firmware dump 2024-02-07 12:03:38 +11:00
Ben V. Brown b540007bcc Scratching debug tool for anc poking 2024-02-07 12:03:38 +11:00
Ben V. Brown 802822fbb6 Note WNR is off 2024-02-07 12:03:38 +11:00
Ben V. Brown fd2c9386c7 Try higher gain for anc 2024-02-07 12:03:38 +11:00
Ben V. Brown 725dcc4421 Update target.mk 2024-02-07 12:03:38 +11:00
Ben V. Brown c1dd03c127 Update target.mk 2024-02-07 12:03:38 +11:00
Ben V. Brown 68c0f2e047 Update analog_best2300p.c 2024-02-07 12:03:38 +11:00
Ben V. Brown b63b1b3a39 Add logging to anc init 2024-02-07 12:03:38 +11:00
Ben V. Brown 9f525debd0 Cant do inline comments on makefile target config 2024-02-07 12:03:38 +11:00
Ben V. Brown fb1dd221d5 Make warning on no anc VMIC 2024-02-07 12:03:38 +11:00
Ben V. Brown 7b21c7bcb5 Edit config for mics 2024-02-07 12:03:38 +11:00
Ben V. Brown eb232e87ed Annotate config options 2024-02-07 12:03:38 +11:00
Ben Brown 124f0545f8 Creating Multi Arch Container 2024-01-26 09:47:47 +11:00
Ben V. Brown 42451f7f7d
Merge pull request #85 from pine64/dependabot/github_actions/actions/upload-artifact-4
chore(ci): bump actions/upload-artifact from 3 to 4
2023-12-18 12:46:25 +11:00
dependabot[bot] 2cb04b7925
chore(ci): bump actions/upload-artifact from 3 to 4
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-18 01:21:21 +00:00
11 changed files with 59 additions and 23 deletions

View File

@ -17,11 +17,17 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install qemu dependency
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Build images
id: build
uses: redhat-actions/buildah-build@v2
with:
image: ${{ github.repository }}
platforms: linux/amd64, linux/arm64
context: /
tags: ${{ contains(github.ref_name, 'main') && 'latest' || github.ref_name }}-sdk
containerfiles: /Dockerfile

View File

@ -12,6 +12,6 @@ jobs:
run: cd /usr/src/ && ./build.sh || cat /usr/src/log.txt
- name: Archive produced firmware
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: /usr/src/out/open_source/open_source.bin

View File

@ -41,6 +41,11 @@ RUN apt-get update \
&& curl \
https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major-$(arch)-linux.tar.bz2 | tar -xj -C /src/
RUN apt-get update \
&& apt-get install -y \
minicom \
sudo
ENV PATH="${PATH}:/src/gcc-arm-none-eabi-9-2019-q4-major/bin"
COPY --from=rust_build /usr/src/bestool/bestool/target/release/bestool /usr/local/bin/bestool
COPY . /usr/src

View File

@ -25,6 +25,7 @@ endif
ifeq ($(ANC_ASSIST_ENABLED),1)
CFLAGS_app_anc.o += -DANC_ASSIST_ENABLED
CFLAGS_anc_assist.o += -DANC_ASSIST_ENABLED
ifeq ($(ANC_ASSIST_WNR_ENABLED),1)
CFLAGS_anc_assist.o += -DANC_ASSIST_WNR_ENABLED

View File

@ -1531,13 +1531,6 @@ void app_anc_key(APP_KEY_STATUS *status, void *param) {
bool flag = app_anc_work_status();
#if defined(IBRT)
ibrt_ctrl_t *p_ibrt_ctrl = app_tws_ibrt_get_bt_ctrl_ctx();
TRACE(2, "[%s] current_role: %d", __func__, p_ibrt_ctrl->current_role);
if (p_ibrt_ctrl->current_role == IBRT_SLAVE) {
app_anc_notify_master_to_exchange_coef(0, 0);
return;
}
app_anc_status_sync(!flag);
#endif
app_anc_status_post(!flag);

View File

@ -118,6 +118,12 @@ void send_prev_track(void) {
uint8_t action[] = {IBRT_ACTION_BACKWARD};
app_ibrt_if_start_user_action(action, sizeof(action));
}
void send_enable_disable_anc(void) {
uint8_t action[] = {IBRT_ACTION_ANC_NOTIRY_MASTER_EXCHANGE_COEF};
app_ibrt_if_start_user_action(action, sizeof(action));
}
void app_key_single_tap(APP_KEY_STATUS *status, void *param) {
TRACE(2, "%s event %d", __func__, status->event);
@ -207,7 +213,7 @@ void app_key_long_press_down(APP_KEY_STATUS *status, void *param) {
//send_prev_track();
} else {
// Bud's are working as a pair
app_anc_key(status, param);
send_enable_disable_anc();
}
}

View File

@ -11,6 +11,10 @@ RTOS ?= 1
NO_PWRKEY = 0
LIBC_ROM ?= 1
# Extas added by Open source community
CONNECTED_BLUE_LIGHT = 1 # if set to 1, the blue light will flash when connected
# end our extras
export USER_SECURE_BOOT ?= 0
# enable:1
# disable:0
@ -54,31 +58,36 @@ export BT_DEBUG_TPORTS ?= 0
TPORTS_KEY_COEXIST ?= 0
export SNIFF_MODE_CHECK ?= 0
# Merge L+R stream down to mono
AUDIO_OUTPUT_MONO ?= 0
AUDIO_OUTPUT_DIFF ?= 0
# Raise mic bias from 2.2V to 3.3V
DIGMIC_HIGH_VOLT ?= 0
#### ANC DEFINE START ######
export ANC_APP ?= 1
# Feed Forward ANC configuration (external mic)
export ANC_FF_ENABLED ?= 1
# Feed Backward ANC configuration (internal mic)
export ANC_FB_ENABLED ?= 1
# Wind noise reduction mode
export ANC_WNR_ENABLED ?= 0
# Music cancel mode. Conflicts with audio resampling
export AUDIO_ANC_FB_MC ?= 0
export AUDIO_SECTION_SUPPT ?= 0
export AUD_SECTION_STRUCT_VERSION ?= 2
# Music cancel hardware?
export AUDIO_ANC_FB_MC_HW ?=1
export AUDIO_ANC_FB_MC_HW ?=0
export APP_ANC_KEY ?= 1
# Feedback check for feedforward mic. Locked on due to blobs
export ANC_FB_CHECK ?= 1
##### ANC DEFINE END ######
# Build in ANC testing app (closed source)
APP_ANC_TEST ?= 0
export ANC_ASSIST_ENABLED ?= 0
##### ANC DEFINE END ######
# Allow test commands via bluetooth
TEST_OVER_THE_AIR ?= 0
@ -236,7 +245,7 @@ A2DP_LHDC_LARC ?= 1
export FLASH_UNIQUE_ID ?= 1
endif
A2DP_LDAC_ON ?= 0
A2DP_LDAC_ON ?= 1
export TX_RX_PCM_MASK ?= 0
@ -351,6 +360,8 @@ export BT_EXT_PA ?=0
ifeq ($(A2DP_LHDC_ON),1)
AUDIO_BUFFER_SIZE := 140*1024
else ifeq ($(A2DP_LDAC_ON),1)
AUDIO_BUFFER_SIZE := 140*1024
else
AUDIO_BUFFER_SIZE := 100*1024
endif

View File

@ -205,7 +205,7 @@ enum AUD_STREAM_ID_T {
AUD_STREAM_ID_0 = 0,
AUD_STREAM_ID_1,
AUD_STREAM_ID_2,
#ifdef __ANC_ASSIST__
#ifdef ANC_ASSIST_ENABLED
AUD_STREAM_ID_3,
#endif
AUD_STREAM_ID_NUM,
@ -230,7 +230,7 @@ enum AUD_IO_PATH_T {
AUD_INPUT_PATH_NTMIC,
AUD_INPUT_PATH_ANC_WNR, // Wind Noise Reduction
AUD_INPUT_PATH_USBAUDIO,
#ifdef __ANC_ASSIST__
#ifdef ANC_ASSIST_ENABLED
AUD_INPUT_PATH_AF_ANC,
#endif
// Output path

View File

@ -279,6 +279,7 @@ void app_ibrt_ui_perform_user_action(uint8_t *p_buff, uint16_t length) {
ibrt_ctrl_t *p_ibrt_ctrl = app_tws_ibrt_get_bt_ctrl_ctx();
#ifdef ANC_APP
//Doesnt actully get used!!!
app_anc_cmd_receive_process(p_buff, length);
#endif
#ifdef ANC_WNR_ENABLED
@ -352,6 +353,9 @@ void app_ibrt_ui_perform_user_action(uint8_t *p_buff, uint16_t length) {
app_bt_volumedown();
app_ibrt_sync_volume_info();
break;
case IBRT_ACTION_ANC_NOTIRY_MASTER_EXCHANGE_COEF:
app_anc_key(NULL, NULL);
break;
default:
TRACE(2, "%s unknown user action %d\n", __func__, p_buff[0]);
break;

View File

@ -3866,7 +3866,9 @@ int bt_sbc_player(enum PLAYER_OPER_T on, enum APP_SYSFREQ_FREQ_T freq) {
}
#endif
#endif
if (freq < APP_SYSFREQ_52M) {
freq = APP_SYSFREQ_52M;
}
app_sysfreq_req(APP_SYSFREQ_USER_BT_A2DP, freq);
TRACE_AUD_STREAM_I("[A2DP_PLAYER] sysfreq %d", freq);
TRACE_AUD_STREAM_I("[A2DP_PLAYER] sysfreq calc : %d\n",
@ -3886,8 +3888,10 @@ int bt_sbc_player(enum PLAYER_OPER_T on, enum APP_SYSFREQ_FREQ_T freq) {
else if (codec_type == BTIF_AVDTP_CODEC_TYPE_NON_A2DP) {
TRACE(1, "current_a2dp_non_type %d", current_a2dp_non_type);
if (0) {
}
#if defined(A2DP_LHDC_ON)
if (current_a2dp_non_type == A2DP_NON_CODEC_TYPE_LHDC) {
else if (current_a2dp_non_type == A2DP_NON_CODEC_TYPE_LHDC) {
app_overlay_select(APP_OVERLAY_A2DP_LHDC);
}
#endif

View File

@ -1,5 +1,11 @@
#!/usr/bin/env sh
#!/usr/bin/env bash
num=$(find /dev -name 'ttyUSB*' | rev | cut -c 1)
echo "$num"
sudo minicom "port$num"
rightbud=/dev/serial/by-id/usb-wch.cn_USB_Dual_Serial_0123456789-if00
leftbud=/dev/serial/by-id/usb-wch.cn_USB_Dual_Serial_0123456789-if02
read -p "Which bud do you want to connect to UART for? L/R (default L): " -n 1 -r
ttydev=$leftbud
if [[ $REPLY =~ ^[Rr]$ ]]; then
ttydev=$rightbud
fi
sudo minicom -D $ttydev -b 2000000