Implement adaptive frame dropping #10

Merged
pstruebi merged 12 commits from fix/frame_drops into main 2025-11-04 16:16:34 +00:00
Showing only changes of commit f91f177b9a - Show all commits
+3 -2
View File
@@ -198,7 +198,8 @@ class StreamerWorker: # TODO: is wraping in this Worker stricly nececcarry ?
if big.audio_source.startswith('device:'):
big.audio_source = f'device:{device_index}'
devinfo = sd.query_devices(device_index)
capture_rate = int(devinfo.get('default_samplerate') or 48000)
# Force capture at 48 kHz to avoid resampler latency and 44.1 kHz incompatibilities
capture_rate = 48000
max_in = int(devinfo.get('max_input_channels') or 1)
channels = max(1, min(2, max_in))
for big in conf.bigs:
@@ -446,7 +447,7 @@ async def _autostart_from_settings():
):
return
# Check against the cached device lists
usb = [d for _, d in get_usb_pw_inputs()]
usb = [d for _, d in get_alsa_usb_inputs()]
net = [d for _, d in get_network_pw_inputs()]
names = {d.get('name') for d in usb} | {d.get('name') for d in net}
if input_device_name in names: