Quick fix for audio glitches in streaming. TODO fix latency.

This commit is contained in:
pober
2026-01-12 15:34:05 +01:00
committed by pstruebi
parent 2bc97c26af
commit 921dd93c64
3 changed files with 6 additions and 7 deletions
+3 -3
View File
@@ -88,7 +88,7 @@ class ModSoundDeviceAudioInput(audio_io.SoundDeviceAudioInput):
self.counter=0
self.max_avail=0
self.logfile_name="available_samples.txt"
self.blocksize = 120
self.blocksize = 240
if os.path.exists(self.logfile_name):
os.remove(self.logfile_name)
@@ -99,7 +99,7 @@ class ModSoundDeviceAudioInput(audio_io.SoundDeviceAudioInput):
channels=self._pcm_format.channels,
dtype='int16',
blocksize=self.blocksize,
latency=0.004,
latency=0.020,
)
self._stream.start()
@@ -114,7 +114,7 @@ class ModSoundDeviceAudioInput(audio_io.SoundDeviceAudioInput):
"""Read PCM samples from the stream."""
#if self.counter % 50 == 0:
frame_size = frame_size + 1 # consume samples a little faster to avoid latency akkumulation
# frame_size = frame_size + 1 # consume samples a little faster to avoid latency akkumulation
pcm_buffer, overflowed = self._stream.read(frame_size)
if overflowed:
+1 -2
View File
@@ -385,8 +385,7 @@ async def init_radio(transport: str, conf: auracast_config.AuracastConfigGroup,
if input_device_name in dante_channels:
conf.auracast_sampling_rate_hz = 48000
# Also update octets per frame for 48000 Hz
if conf.octets_per_frame == 60: # 24000 Hz setting
conf.octets_per_frame = 120 # 48000 Hz setting
conf.octets_per_frame = 120 # 48000 Hz setting
conf.qos_config.max_transport_latency_ms = int(conf.qos_config.number_of_retransmissions) * 10 + 3
+2 -2
View File
@@ -49,8 +49,8 @@ pcm.dante_asrc_shared6 {
rate 48000
format S16_LE
period_size 256
buffer_size 1024
period_size 240
buffer_size 960
}
hint { show on ; description "DEP RX (via ASRC) shared 6ch (loopback+dsnoop)" }