Re: [PR] apps: add Auracast USB sample with LC3 codec [mynewt-nimble]

2024-04-15 Thread via GitHub


KKopyscinski merged PR #1659:
URL: https://github.com/apache/mynewt-nimble/pull/1659


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] apps: add Auracast USB sample with LC3 codec [mynewt-nimble]

2024-03-15 Thread via GitHub


KKopyscinski commented on PR #1659:
URL: https://github.com/apache/mynewt-nimble/pull/1659#issuecomment-1999271408

   This needs libsamplerate patch to work properly: 
https://github.com/libsndfile/libsamplerate/pull/210


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] apps: add Auracast USB sample with LC3 codec [mynewt-nimble]

2024-02-27 Thread via GitHub


KKopyscinski commented on code in PR #1659:
URL: https://github.com/apache/mynewt-nimble/pull/1659#discussion_r1503972543


##
apps/auracast_usb/src/main.c:
##
@@ -0,0 +1,349 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "console/console.h"
+#include "config/config.h"
+
+#include "nimble/ble.h"
+#include "host/ble_hs.h"
+#include "host/util/util.h"
+
+#include "services/auracast/ble_svc_auracast.h"
+
+#include "hal/hal_gpio.h"
+#include "bsp/bsp.h"
+#include "app_priv.h"
+
+#define BROADCAST_SID   1
+#define BROADCAST_SDU_INTVL MYNEWT_VAL(LC3_FRAME_DURATION)
+#define BROADCAST_SAMPLE_RATE   BLE_AUDIO_SAMPLING_RATE_48000_HZ

Review Comment:
   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



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] apps: add Auracast USB sample with LC3 codec [mynewt-nimble]

2024-02-27 Thread via GitHub


KKopyscinski commented on code in PR #1659:
URL: https://github.com/apache/mynewt-nimble/pull/1659#discussion_r1503968835


##
apps/auracast_usb/src/audio_usb.c:
##
@@ -0,0 +1,187 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include "host/ble_gap.h"
+
+#include "app_priv.h"
+
+static uint8_t g_usb_enabled;
+
+static void usb_data_func(struct os_event *ev);
+
+struct chan chans[AUDIO_CHANNELS];
+
+static struct os_event usb_data_ev = {
+.ev_cb = usb_data_func,
+};
+
+static uint32_t frame_bytes_lc3;
+static uint16_t big_sdu;
+
+static int16_t samples[96000 / 100 * 2 * 2];
+static uint8_t samples_out[96000 / 100 * 2];
+static int samples_idx = 0;
+
+static uint32_t pkt_counter = 0;
+
+static void
+usb_data_func(struct os_event *ev)
+{
+int ch_idx;
+unsigned int num_bytes;
+unsigned int num_samples;
+unsigned int num_frames;
+unsigned int frames_count;
+int read;
+int skip;
+
+if (!g_usb_enabled) {
+tud_audio_clear_ep_out_ff();
+return;
+}
+
+while ((num_bytes = tud_audio_available()) > 0) {
+num_samples = num_bytes / AUDIO_SAMPLE_SIZE;
+num_frames = num_samples / MYNEWT_VAL(AURACAST_CHAN_NUM);
+num_bytes = num_frames * AUDIO_SAMPLE_SIZE * 
MYNEWT_VAL(AURACAST_CHAN_NUM);
+
+assert(samples_idx + num_samples < ARRAY_SIZE(samples));
+
+read = tud_audio_read(&samples[samples_idx], num_bytes);
+
+assert(read == num_bytes);
+assert(samples[ARRAY_SIZE(samples) - 1] = 0x);
+
+samples_idx += num_samples;
+assert((samples_idx & 0x8000) == 0);
+frames_count = samples_idx / MYNEWT_VAL(AURACAST_CHAN_NUM);
+
+if (frames_count >= LC3_FPDT) {
+pkt_counter++;
+skip = 0;
+
+for (ch_idx = 0; ch_idx < MYNEWT_VAL(AURACAST_CHAN_NUM); ch_idx++) 
{
+if (chans[ch_idx].handle == 0) {
+skip = 1;
+continue;
+}
+}
+
+if (!skip) {
+memset(samples_out, 0, sizeof(samples_out));
+lc3_encode(chans[0].encoder, LC3_PCM_FORMAT_S16,
+   samples + 0, AUDIO_CHANNELS,
+   (int)frame_bytes_lc3, samples_out);
+
+if (AUDIO_CHANNELS == 2) {
+ble_iso_tx(chans[0].handle, samples_out, big_sdu);
+
+memset(samples_out, 0, sizeof(samples_out));
+lc3_encode(chans[1].encoder, LC3_PCM_FORMAT_S16,
+   samples + 1, AUDIO_CHANNELS,
+   (int)frame_bytes_lc3, samples_out);
+ble_iso_tx(chans[1].handle, samples_out, big_sdu);
+} else {
+ble_iso_tx(chans[0].handle, samples_out, big_sdu);
+if (BIG_NUM_BIS == 1) {
+memset(samples_out, 0, sizeof(samples_out));
+lc3_encode(chans[1].encoder, LC3_PCM_FORMAT_S16,
+   samples + 1, AUDIO_CHANNELS,
+   (int)frame_bytes_lc3, samples_out);
+}
+ble_iso_tx(chans[0].handle, samples_out, big_sdu);
+}
+
+}
+
+if (frames_count > LC3_FPDT) {
+int old_samples_idx = samples_idx;
+samples_idx -= LC3_FPDT * AUDIO_CHANNELS;
+memmove(samples, &samples[old_samples_idx],
+(old_samples_idx - samples_idx) * AUDIO_SAMPLE_SIZE);

Review Comment:
   fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] apps: add Auracast USB sample with LC3 codec [mynewt-nimble]

2024-02-27 Thread via GitHub


KKopyscinski commented on code in PR #1659:
URL: https://github.com/apache/mynewt-nimble/pull/1659#discussion_r1503967922


##
apps/auracast_usb/src/audio_usb.c:
##
@@ -0,0 +1,187 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include "host/ble_gap.h"
+
+#include "app_priv.h"
+
+static uint8_t g_usb_enabled;
+
+static void usb_data_func(struct os_event *ev);
+
+struct chan chans[AUDIO_CHANNELS];
+
+static struct os_event usb_data_ev = {
+.ev_cb = usb_data_func,
+};
+
+static uint32_t frame_bytes_lc3;
+static uint16_t big_sdu;
+
+static int16_t samples[96000 / 100 * 2 * 2];
+static uint8_t samples_out[96000 / 100 * 2];
+static int samples_idx = 0;
+
+static uint32_t pkt_counter = 0;
+
+static void
+usb_data_func(struct os_event *ev)
+{
+int ch_idx;
+unsigned int num_bytes;
+unsigned int num_samples;
+unsigned int num_frames;
+unsigned int frames_count;
+int read;
+int skip;
+
+if (!g_usb_enabled) {
+tud_audio_clear_ep_out_ff();
+return;
+}
+
+while ((num_bytes = tud_audio_available()) > 0) {
+num_samples = num_bytes / AUDIO_SAMPLE_SIZE;
+num_frames = num_samples / MYNEWT_VAL(AURACAST_CHAN_NUM);
+num_bytes = num_frames * AUDIO_SAMPLE_SIZE * 
MYNEWT_VAL(AURACAST_CHAN_NUM);
+
+assert(samples_idx + num_samples < ARRAY_SIZE(samples));
+
+read = tud_audio_read(&samples[samples_idx], num_bytes);
+
+assert(read == num_bytes);
+assert(samples[ARRAY_SIZE(samples) - 1] = 0x);
+
+samples_idx += num_samples;
+assert((samples_idx & 0x8000) == 0);
+frames_count = samples_idx / MYNEWT_VAL(AURACAST_CHAN_NUM);
+
+if (frames_count >= LC3_FPDT) {
+pkt_counter++;
+skip = 0;
+
+for (ch_idx = 0; ch_idx < MYNEWT_VAL(AURACAST_CHAN_NUM); ch_idx++) 
{
+if (chans[ch_idx].handle == 0) {
+skip = 1;
+continue;
+}
+}
+
+if (!skip) {
+memset(samples_out, 0, sizeof(samples_out));
+lc3_encode(chans[0].encoder, LC3_PCM_FORMAT_S16,
+   samples + 0, AUDIO_CHANNELS,
+   (int)frame_bytes_lc3, samples_out);
+
+if (AUDIO_CHANNELS == 2) {
+ble_iso_tx(chans[0].handle, samples_out, big_sdu);
+
+memset(samples_out, 0, sizeof(samples_out));
+lc3_encode(chans[1].encoder, LC3_PCM_FORMAT_S16,
+   samples + 1, AUDIO_CHANNELS,
+   (int)frame_bytes_lc3, samples_out);
+ble_iso_tx(chans[1].handle, samples_out, big_sdu);
+} else {
+ble_iso_tx(chans[0].handle, samples_out, big_sdu);
+if (BIG_NUM_BIS == 1) {
+memset(samples_out, 0, sizeof(samples_out));
+lc3_encode(chans[1].encoder, LC3_PCM_FORMAT_S16,
+   samples + 1, AUDIO_CHANNELS,
+   (int)frame_bytes_lc3, samples_out);
+}
+ble_iso_tx(chans[0].handle, samples_out, big_sdu);
+}
+
+}
+
+if (frames_count > LC3_FPDT) {
+int old_samples_idx = samples_idx;
+samples_idx -= LC3_FPDT * AUDIO_CHANNELS;
+memmove(samples, &samples[old_samples_idx],
+(old_samples_idx - samples_idx) * AUDIO_SAMPLE_SIZE);
+} else {
+samples_idx = 0;
+}
+}
+}
+
+}
+
+bool
+tud_audio_rx_done_post_read_cb(uint8_t rhport, uint16_t n_bytes_received,
+   uint8_t func_id, uint8_t ep_out,
+   uint8_t cur_alt_setting)
+{
+(void)rhport;
+(void)n_bytes_received;
+(void)func_id;
+(void)ep_out;
+(void)cur_alt_setting;
+
+if (!usb_data_ev.ev_queued) {
+os_eventq_put(os_eventq_dflt_get(), &usb_data_ev);
+  

Re: [PR] apps: add Auracast USB sample with LC3 codec [mynewt-nimble]

2024-02-27 Thread via GitHub


KKopyscinski commented on code in PR #1659:
URL: https://github.com/apache/mynewt-nimble/pull/1659#discussion_r1503966036


##
apps/auracast_usb/syscfg.yml:
##
@@ -0,0 +1,115 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+syscfg.defs:
+AURACAST_CHAN_NUM: 2
+
+BROADCAST_ID:
+description: Broadcast ID value, will use random number if 0
+value: 0x00
+BROADCAST_NAME:
+description: Broadcast name
+value: '"NimBLE Auracast"'
+BROADCAST_CODE:
+description: Broadcast code used for encrpytion
+value: '"listen2nimble"'
+
+LC3_FRAME_DURATION:
+description: LC3 frame duration
+value: 1
+LC3_SAMPLING_FREQ:
+description: LC3 sampling frequency
+value: 48000
+LC3_BITRATE:
+description: LC3 bitrate
+value: 96000
+
+BIG_PHY:
+description:
+value: 3
+BIG_NUM_BIS:
+description: Max number of BISes used
+value: 2
+BIG_RTN:
+description: BIG RTN (number of retransmissions)
+value: 0
+BIG_PACKING:
+description: Arrangement of BIS subevents (0 = sequential, 1 = 
interleaved)
+value: 0
+BIG_FRAMING:
+description:
+value: 0
+BIG_ENCRYPTION:
+description: BIS encryption
+value: 1
+
+syscfg.vals:
+CONSOLE_IMPLEMENTATION: full
+LOG_IMPLEMENTATION: full
+STATS_IMPLEMENTATION: full
+
+# Disable not used GAP roles (we only do non-connectable
+# advertising here)
+BLE_ROLE_BROADCASTER: 1
+BLE_ROLE_CENTRAL: 0
+BLE_ROLE_OBSERVER: 0
+BLE_ROLE_PERIPHERAL: 0
+
+# Enable Extended Advertising
+BLE_EXT_ADV: 1
+
+# Enable Periodic Advertising
+BLE_PERIODIC_ADV: 1
+
+# Max advertising data size
+BLE_EXT_ADV_MAX_SIZE: 261
+
+# Number of multi-advertising instances. Note that due
+# to historical reasonds total number of advertising
+# instances is BLE_MULTI_ADV_INSTANCES + 1 as instance
+# 0 is always available
+BLE_MULTI_ADV_INSTANCES: 1
+
+# Controller uses msys pool for storing advertising data and scan 
responses.
+# Since we advertise a lot of data (~6k in total) at the same time we need
+# to increase block count.
+MSYS_1_BLOCK_COUNT: 32
+
+BLE_PHY_2M: 1
+
+BLE_VERSION: 54
+BLE_ISO: 1
+BLE_ISO_BROADCASTER: 1
+BLE_MAX_BIG: 1
+BLE_MAX_BIS: 2
+
+BLE_PHY_NRF52_HEADERMASK_WORKAROUND: 1

Review Comment:
   moved under `syscfg.vals.BSP_NRF52:`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] apps: add Auracast USB sample with LC3 codec [mynewt-nimble]

2024-02-22 Thread via GitHub


KKopyscinski commented on code in PR #1659:
URL: https://github.com/apache/mynewt-nimble/pull/1659#discussion_r1500259278


##
apps/auracast_usb/src/main.c:
##
@@ -0,0 +1,349 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "console/console.h"
+#include "config/config.h"
+
+#include "nimble/ble.h"
+#include "host/ble_hs.h"
+#include "host/util/util.h"
+
+#include "services/auracast/ble_svc_auracast.h"
+
+#include "hal/hal_gpio.h"
+#include "bsp/bsp.h"
+#include "app_priv.h"
+
+#define BROADCAST_SID   1
+#define BROADCAST_SDU_INTVL MYNEWT_VAL(LC3_FRAME_DURATION)
+#define BROADCAST_SAMPLE_RATE   BLE_AUDIO_SAMPLING_RATE_48000_HZ
+#define BROADCAST_MAX_SDU   (BROADCAST_SDU_INTVL * \
+ MYNEWT_VAL(LC3_BITRATE) / \
+ (1000 * 1000 * 8))
+
+#define BROADCASTER_INTERRUPT_TASK_PRIO  4
+#define BROADCASTER_INTERRUPT_TASK_STACK_SZ512
+
+static uint8_t id_addr_type;
+
+static struct ble_audio_base auracast_base;
+static struct ble_audio_big_subgroup big_subgroup;
+
+static os_membuf_t bis_mem[
+OS_MEMPOOL_SIZE(MYNEWT_VAL(BIG_NUM_BIS),
+sizeof(struct ble_audio_bis))
+];
+static struct os_mempool bis_pool;
+
+static os_membuf_t codec_spec_mem[
+OS_MEMPOOL_SIZE(MYNEWT_VAL(BIG_NUM_BIS) * 2, 19)
+];
+static struct os_mempool codec_spec_pool;
+
+static struct os_task auracast_interrupt_task_str;
+static struct os_eventq auracast_interrupt_eventq;
+static os_stack_t 
auracast_interrupt_task_stack[BROADCASTER_INTERRUPT_TASK_STACK_SZ];
+
+static uint8_t auracast_adv_instance;
+
+static void
+auracast_interrupt_task(void *arg)
+{
+while (1) {
+os_eventq_run(&auracast_interrupt_eventq);
+}
+}
+
+static void
+broadcast_stop_ev_cb(struct os_event *ev)
+{
+ble_svc_auracast_stop(auracast_adv_instance);
+ble_svc_auracast_terminate(auracast_adv_instance);

Review Comment:
   Good catch, I'll just remove it. Audio is not sent either way, if not 
arriving on input



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] apps: add Auracast USB sample with LC3 codec [mynewt-nimble]

2024-02-22 Thread via GitHub


andrzej-kaczmarek commented on code in PR #1659:
URL: https://github.com/apache/mynewt-nimble/pull/1659#discussion_r1423649726


##
apps/auracast_usb/include/usb_audio.h:
##
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_USB_AUDIO_
+#define H_USB_AUDIO_
+
+#include 
+
+typedef void (* usb_audio_sample_rate_cb_t)(uint32_t);
+
+/* Set default sample rate, should only be used before USB is initialized */
+void usb_desc_sample_rate_set(uint32_t sample_rate);
+
+/* Set callback to receive sample rate set by USB host */
+void usb_audio_sample_rate_cb_set(usb_audio_sample_rate_cb_t cb);
+
+/* Get current sample rate */
+uint32_t usb_audio_sample_rate_get(void);

Review Comment:
   we don't need those if we set USB to support 1 sample rate only



##
apps/auracast_usb/syscfg.yml:
##
@@ -0,0 +1,115 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+syscfg.defs:
+AURACAST_CHAN_NUM: 2
+
+BROADCAST_ID:
+description: Broadcast ID value, will use random number if 0
+value: 0x00
+BROADCAST_NAME:
+description: Broadcast name
+value: '"NimBLE Auracast"'
+BROADCAST_CODE:
+description: Broadcast code used for encrpytion
+value: '"listen2nimble"'
+
+LC3_FRAME_DURATION:
+description: LC3 frame duration
+value: 1
+LC3_SAMPLING_FREQ:
+description: LC3 sampling frequency
+value: 48000
+LC3_BITRATE:
+description: LC3 bitrate
+value: 96000
+
+BIG_PHY:
+description:
+value: 3
+BIG_NUM_BIS:
+description: Max number of BISes used
+value: 2
+BIG_RTN:
+description: BIG RTN (number of retransmissions)
+value: 0
+BIG_PACKING:
+description: Arrangement of BIS subevents (0 = sequential, 1 = 
interleaved)
+value: 0
+BIG_FRAMING:
+description:
+value: 0
+BIG_ENCRYPTION:
+description: BIS encryption
+value: 1
+
+syscfg.vals:
+CONSOLE_IMPLEMENTATION: full
+LOG_IMPLEMENTATION: full
+STATS_IMPLEMENTATION: full
+
+# Disable not used GAP roles (we only do non-connectable
+# advertising here)
+BLE_ROLE_BROADCASTER: 1
+BLE_ROLE_CENTRAL: 0
+BLE_ROLE_OBSERVER: 0
+BLE_ROLE_PERIPHERAL: 0
+
+# Enable Extended Advertising
+BLE_EXT_ADV: 1
+
+# Enable Periodic Advertising
+BLE_PERIODIC_ADV: 1
+
+# Max advertising data size
+BLE_EXT_ADV_MAX_SIZE: 261
+
+# Number of multi-advertising instances. Note that due
+# to historical reasonds total number of advertising
+# instances is BLE_MULTI_ADV_INSTANCES + 1 as instance
+# 0 is always available
+BLE_MULTI_ADV_INSTANCES: 1
+
+# Controller uses msys pool for storing advertising data and scan 
responses.
+# Since we advertise a lot of data (~6k in total) at the same time we need
+# to increase block count.
+MSYS_1_BLOCK_COUNT: 32
+
+BLE_PHY_2M: 1
+
+BLE_VERSION: 54
+BLE_ISO: 1
+BLE_ISO_BROADCASTER: 1
+BLE_MAX_BIG: 1
+BLE_MAX_BIS: 2
+
+BLE_PHY_NRF52_HEADERMASK_WORKAROUND: 1

Review Comment:
   this is only valid for nrf52



##
apps/auracast_usb/src/audio_usb.c:
##
@@ -0,0 +1,236 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional informatio

Re: [PR] apps: add Auracast USB sample with LC3 codec [mynewt-nimble]

2024-01-08 Thread via GitHub


KKopyscinski commented on PR #1659:
URL: https://github.com/apache/mynewt-nimble/pull/1659#issuecomment-1880953691

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] apps: add Auracast USB sample with LC3 codec [mynewt-nimble]

2024-01-08 Thread via GitHub


KKopyscinski commented on PR #1659:
URL: https://github.com/apache/mynewt-nimble/pull/1659#issuecomment-1880700604

   @sjanc https://github.com/apache/mynewt-core/pull/3121 patch was merged and 
this builds now, can I merge this PR?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] apps: add Auracast USB sample with LC3 codec [mynewt-nimble]

2023-12-11 Thread via GitHub


KKopyscinski commented on code in PR #1659:
URL: https://github.com/apache/mynewt-nimble/pull/1659#discussion_r1422105166


##
apps/auracast_usb/syscfg.usb.yml:
##
@@ -0,0 +1,169 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+syscfg.defs.TINYUSB:
+USBD_STRING_DESCRIPTOR_MAX_LENGTH:
+description: Maximum length of string descriptor in characters
+value: 31
+USBD_EP0_SIZE:
+description: >
+Endpoint 0 size
+value: 64
+USBD_VID:
+description: Vendor ID
+value:
+restrictions:
+- $notnull
+USBD_PID:
+description: Product ID
+value:
+restrictions:
+- $notnull
+USBD_PRODUCT_RELEASE_NUMBER:
+description: Product release number needed for USB descriptor
+value: 0x100
+USBD_CONFIGURATION_MAX_POWER:
+description: >
+Maximum power consumption of the USB device from the bus in this 
specific
+configuration when the device is fully operational. Expressed in 2 
mA units
+(i.e., 50 = 100 mA).
+value: 100
+USBD_LANGID:
+description: Language ID as specified by usb.org
+value: 0x0409
+USBD_VENDOR_STRING:
+description: Manufacturer identification string
+value: '"Codecoup"'
+USBD_PRODUCT_STRING:
+description: Device friendly name
+value: '"DK 22050"'

Review Comment:
   NimBLE Auracast



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] apps: add Auracast USB sample with LC3 codec [mynewt-nimble]

2023-12-11 Thread via GitHub


KKopyscinski commented on code in PR #1659:
URL: https://github.com/apache/mynewt-nimble/pull/1659#discussion_r1422104953


##
apps/auracast_usb/syscfg.usb.yml:
##
@@ -0,0 +1,169 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+syscfg.defs.TINYUSB:
+USBD_STRING_DESCRIPTOR_MAX_LENGTH:
+description: Maximum length of string descriptor in characters
+value: 31
+USBD_EP0_SIZE:
+description: >
+Endpoint 0 size
+value: 64
+USBD_VID:
+description: Vendor ID
+value:
+restrictions:
+- $notnull
+USBD_PID:
+description: Product ID
+value:
+restrictions:
+- $notnull
+USBD_PRODUCT_RELEASE_NUMBER:
+description: Product release number needed for USB descriptor
+value: 0x100
+USBD_CONFIGURATION_MAX_POWER:
+description: >
+Maximum power consumption of the USB device from the bus in this 
specific
+configuration when the device is fully operational. Expressed in 2 
mA units
+(i.e., 50 = 100 mA).
+value: 100
+USBD_LANGID:
+description: Language ID as specified by usb.org
+value: 0x0409
+USBD_VENDOR_STRING:
+description: Manufacturer identification string
+value: '"Codecoup"'

Review Comment:
   Apache Software Foundation



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] apps: add Auracast USB sample with LC3 codec [mynewt-nimble]

2023-12-11 Thread via GitHub


sjanc commented on code in PR #1659:
URL: https://github.com/apache/mynewt-nimble/pull/1659#discussion_r1422097779


##
apps/auracast_usb/syscfg.usb.yml:
##
@@ -0,0 +1,169 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+syscfg.defs.TINYUSB:
+USBD_STRING_DESCRIPTOR_MAX_LENGTH:
+description: Maximum length of string descriptor in characters
+value: 31
+USBD_EP0_SIZE:
+description: >
+Endpoint 0 size
+value: 64
+USBD_VID:
+description: Vendor ID
+value:
+restrictions:
+- $notnull
+USBD_PID:
+description: Product ID
+value:
+restrictions:
+- $notnull
+USBD_PRODUCT_RELEASE_NUMBER:
+description: Product release number needed for USB descriptor
+value: 0x100
+USBD_CONFIGURATION_MAX_POWER:
+description: >
+Maximum power consumption of the USB device from the bus in this 
specific
+configuration when the device is fully operational. Expressed in 2 
mA units
+(i.e., 50 = 100 mA).
+value: 100
+USBD_LANGID:
+description: Language ID as specified by usb.org
+value: 0x0409
+USBD_VENDOR_STRING:
+description: Manufacturer identification string
+value: '"Codecoup"'

Review Comment:
   should probably be ASF



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] apps: add Auracast USB sample with LC3 codec [mynewt-nimble]

2023-12-01 Thread via GitHub


KKopyscinski commented on PR #1659:
URL: https://github.com/apache/mynewt-nimble/pull/1659#issuecomment-1836082245

   This depends on https://github.com/apache/mynewt-nimble/pull/1658 and 
https://github.com/apache/mynewt-nimble/pull/1619


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org