Add config for different qos
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
# Imports
|
||||
# -----------------------------------------------------------------------------
|
||||
from __future__ import annotations
|
||||
|
||||
import pprint
|
||||
import asyncio
|
||||
import contextlib
|
||||
import logging
|
||||
@@ -43,7 +43,7 @@ from bumble.profiles import bass
|
||||
import bumble.device
|
||||
import bumble.transport
|
||||
import bumble.utils
|
||||
from bumble.device import Host
|
||||
from bumble.device import Host, BIGInfoAdvertisement
|
||||
|
||||
import auracast_config
|
||||
|
||||
@@ -184,7 +184,7 @@ async def run_broadcast(
|
||||
)
|
||||
],
|
||||
)
|
||||
logging.info('Setup Advertising')
|
||||
logger.info('Setup Advertising')
|
||||
bigs[f'big{i}']['broadcast_audio_announcement'] = bap.BroadcastAudioAnnouncement(conf.broadcast_id)
|
||||
advertising_set = await device.create_advertising_set(
|
||||
random_address=conf.broadcast_random_address,
|
||||
@@ -224,10 +224,10 @@ async def run_broadcast(
|
||||
bigs[f'big{i}']['advertising_set'] ,
|
||||
parameters=bumble.device.BigParameters(
|
||||
num_bis=1,
|
||||
sdu_interval=global_config.frame_duration_us,
|
||||
sdu_interval=global_config.qos_config.iso_interval_us,
|
||||
max_sdu=global_config.octets_per_frame, # is this octets per frame ?
|
||||
max_transport_latency=65,
|
||||
rtn=4,
|
||||
max_transport_latency=global_config.qos_config.max_transport_latency_ms,
|
||||
rtn=global_config.qos_config.number_of_retransmissions,
|
||||
broadcast_code=(
|
||||
bytes.fromhex(conf.broadcast_code) if conf.broadcast_code else None
|
||||
),
|
||||
@@ -243,6 +243,10 @@ async def run_broadcast(
|
||||
|
||||
bigs[f'big{i}']['frames_iterator'] = itertools.cycle(frames)
|
||||
|
||||
logging.debug(f'big{i} parameters are:')
|
||||
logging.debug('%s', pprint.pformat(vars(big)))
|
||||
logging.debug(f'Finished setup of big{i}.')
|
||||
|
||||
await asyncio.sleep(3) # Wait for advertising to set up
|
||||
|
||||
LOOP_FINITE_PKGS = -1 # set -1 to loop infinitely
|
||||
@@ -293,7 +297,10 @@ def broadcast(global_conf: auracast_config.AuracastGlobalConfig, big_conf: List[
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format='%(module)s.py:%(lineno)d %(levelname)s: %(message)s'
|
||||
)
|
||||
|
||||
global_conf = auracast_config.global_base_config
|
||||
|
||||
@@ -301,8 +308,11 @@ if __name__ == "__main__":
|
||||
|
||||
#global_conf.transport='serial:/dev/serial/by-id/usb-SEGGER_J-Link_001050076061-if02,1000000,rtscts' # transport for nrf53dk
|
||||
|
||||
global_conf.transport='serial:/dev/serial/by-id/usb-SEGGER_J-Link_001057705357-if02,1000000,rtscts' # transport for nrf54l15dk
|
||||
#global_conf.transport='serial:/dev/serial/by-id/usb-SEGGER_J-Link_001057705357-if02,1000000,rtscts' # transport for nrf54l15dk
|
||||
|
||||
global_conf.transport='serial:/dev/ttyACM1,115200,rtscts'
|
||||
|
||||
global_conf.qos_config = auracast_config.qos_config_mono_high_rel # TODO: low rel, actually advertising seems to work again- maybe then the problem is hci->controler
|
||||
|
||||
bigs = [
|
||||
auracast_config.broadcast_de,
|
||||
@@ -315,7 +325,12 @@ if __name__ == "__main__":
|
||||
global_conf.octets_per_frame = 40 # 32kbps@16kHz
|
||||
|
||||
# Note: 24kHz is only working with 2 streams - so this may be a host->controller interface bottleneck
|
||||
# TODO: use thread usage debugger on controller to check actual cpu load
|
||||
# use thread usage debugger on controller to check actual cpu load - not much load
|
||||
|
||||
# TODO; I dont think hci is really the bottleneck. probably limited airtime is the problem. Analyze this somehow.
|
||||
# Advertising is still 1Mbit phy - use 2Mbit
|
||||
# Check is the sdu interval (iso interval?) may really be varied - does not seem to work really
|
||||
# # sdu per frame also needs to be adjusted somehow? is this even compatible with lc3?
|
||||
|
||||
broadcast(
|
||||
global_conf,
|
||||
|
||||
Reference in New Issue
Block a user