fix(client): list only real audio devices and persist the choice by id

The device pickers showed every ALSA PCM plugin (Discard all samples, Rate
Converter, JACK, Open Sound System, surround/dmix aliases). Enumeration now
goes through a pure filter that keeps the system default, the PipeWire and
PulseAudio servers and one entry per hardware endpoint, with technical tails
removed and a stable sort.

Selections are stored by device id instead of list position, so the filter
and hotplug cannot move a saved choice. Indexes saved by older versions are
migrated by device name; a missing device falls back to the default.

The same preferences change records whether the voice mode was chosen by
the person: a profile that only carries the old push-to-talk default now
starts in voice activation, explicit choices are kept.
This commit is contained in:
Loki 2026-10-24 23:59:27 +02:00
parent 82dd9a324d
commit 3b95df9e9c
Signed by: boba
GPG key ID: 253067914055423B
17 changed files with 780 additions and 210 deletions

View file

@ -3,7 +3,7 @@ pub mod devices;
mod pipeline;
mod processing;
pub use devices::{DeviceLabel, DeviceLists};
pub use devices::{DeviceEntry, DeviceLists};
pub use pipeline::JitterConfig;
pub use pipeline::{AudioPipeline, MediaMixer};
pub use processing::{DenoiseState, TransmitGate};
@ -25,8 +25,10 @@ pub struct AudioSync {
#[derive(Debug, Clone)]
pub struct PipelineConfig {
pub channel_key: u64,
pub mic_device_index: usize,
pub output_device_index: usize,
/// Persisted microphone id; empty is the system default.
pub mic_device_id: String,
/// Persisted output device id; empty is the system default.
pub output_device_id: String,
pub voice_bitrate_kbps: f32,
pub packet_interval: usize,
}
@ -34,8 +36,8 @@ pub struct PipelineConfig {
impl PartialEq for PipelineConfig {
fn eq(&self, other: &Self) -> bool {
self.channel_key == other.channel_key
&& self.mic_device_index == other.mic_device_index
&& self.output_device_index == other.output_device_index
&& self.mic_device_id == other.mic_device_id
&& self.output_device_id == other.output_device_id
&& self.packet_interval == other.packet_interval
}
}