voice: advertise and qualify standard ULBW sessions

This commit is contained in:
DeFiDude committed 2026-10-01 20:59:25 -06:00
1 parent df9228e744
commit 87dd25958f
5 files changed
+22 -7

No files matched your search

+2 -2
View File
@@ -61,9 +61,9 @@ version consequences must be reviewed before accepting new evidence.
## Live audio and constrained peers
`SendAudioFrames`, `StartAudioStream` and the corresponding receive/stop controls
accept negotiated Opus and native Codec2 1600/3200 profiles. Original Opus
accept negotiated Opus and native Codec2 700C/1600/3200 profiles. Original Opus
controls remain available. Codec2 media emits `Audio*` service events; the
existing Opus event stream is unchanged. 700C is not implemented.
existing Opus event stream is unchanged. Standard ULBW uses ten four-byte 700C frames per 400 ms packet.
`StartAudioStream` binds the exact active Link and optionally shares an
`AudioTransmitGate` with the local input owner. Renew one press serial while
+1 -1
View File
@@ -11,7 +11,7 @@ pub const TALK_LIMIT_MS: u64 = 30_000;
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct ProfileSet(u8);
impl ProfileSet {
pub const CODEC2: Self = Self(0b0000_0110);
pub const CODEC2: Self = Self(0b0000_0111);
pub const OPUS_MEDIUM: Self = Self(0b0000_1000);
pub const fn contains(self, profile: Profile) -> bool {
self.0 & (1 << (profile.wire_value() / 16 - 1)) != 0
+8 -2
View File
@@ -29,6 +29,12 @@ fn stalled_media_drops_old_frames_and_never_crosses_generations() {
#[test]
fn borrowed_native_backend_runs_shared_packet_adapter_without_state_moves() {
for (mode, profile, bytes, samples) in [
(
lxst_codec2::Mode::Rate700C,
Profile::BandwidthUltraLow,
41,
3200,
),
(
lxst_codec2::Mode::Rate1600,
Profile::BandwidthVeryLow,
@@ -41,12 +47,12 @@ fn borrowed_native_backend_runs_shared_packet_adapter_without_state_moves() {
let native = lxst_codec2::Codec::initialise(&mut storage, mode);
let mut codec = Codec2PacketCodec::new(profile, native).unwrap();
let mut output = [0xa5; 90];
let pcm = [0; 2560];
let pcm = [0; 3200];
assert_eq!(
codec.encode_into(&pcm[..samples], &mut output).unwrap(),
bytes
);
let mut decoded = [123; 2568];
let mut decoded = [123; 3208];
assert_eq!(
codec.decode_into(&output[..bytes], &mut decoded).unwrap(),
samples
+3
View File
@@ -7,6 +7,9 @@ use lxst_embedded::{
fn crossed_profile_offers_converge_before_media_without_an_echo_loop() {
for (preferred, offered) in [
(Profile::BandwidthLow, Profile::BandwidthVeryLow),
(Profile::BandwidthLow, Profile::BandwidthUltraLow),
(Profile::BandwidthUltraLow, Profile::BandwidthVeryLow),
(Profile::BandwidthVeryLow, Profile::BandwidthUltraLow),
(Profile::BandwidthVeryLow, Profile::BandwidthLow),
] {
let mut cfg = config();
+8 -2
View File
@@ -3945,7 +3945,11 @@ fn outgoing_teardown_is_atomic_final_endpoint_send() {
#[tokio::test]
async fn native_codec2_duplex_and_input_lease_use_the_real_link() {
use std::sync::Arc;
for profile in [Profile::BandwidthVeryLow, Profile::BandwidthLow] {
for profile in [
Profile::BandwidthUltraLow,
Profile::BandwidthVeryLow,
Profile::BandwidthLow,
] {
let (mut service, remote, link_id, incoming, mut events, mut transport) =
established_outgoing_service_with_transport(profile, 0x95, 32);
let gate = Arc::new(AudioTransmitGate::new());
@@ -3990,7 +3994,9 @@ async fn native_codec2_duplex_and_input_lease_use_the_real_link() {
assert_eq!(packet.frames[0].codec, CodecKind::Codec2);
assert_eq!(
packet.frames[0].payload.len(),
if profile == Profile::BandwidthVeryLow {
if profile == Profile::BandwidthUltraLow {
41
} else if profile == Profile::BandwidthVeryLow {
65
} else {
81