diff --git a/src/auracast/multicast.py b/src/auracast/multicast.py index e561a6f..75483d3 100644 --- a/src/auracast/multicast.py +++ b/src/auracast/multicast.py @@ -253,6 +253,12 @@ class PyAlsaAudioInput(audio_io.ThreadedAudioInput): self._resampler_buffer, np.zeros(frame_size * self._actual_channels, dtype=np.float32), ]) + except Exception as e: + logging.error("PyALSA: Unexpected error in _read: %s", e, exc_info=True) + self._resampler_buffer = np.concatenate([ + self._resampler_buffer, + np.zeros(frame_size * self._actual_channels, dtype=np.float32), + ]) needed = frame_size * self._actual_channels if len(self._resampler_buffer) < needed: diff --git a/src/auracast/server/multicast_server.py b/src/auracast/server/multicast_server.py index fad7a42..cc3cd89 100644 --- a/src/auracast/server/multicast_server.py +++ b/src/auracast/server/multicast_server.py @@ -391,7 +391,7 @@ async def init_radio(transport: str, conf: auracast_config.AuracastConfigGroup, if is_stereo and sel == 'ch1': # Stereo mode: use ALSA directly to capture both channels from hardware # ch1=left (channel 0), ch2=right (channel 1) - big.audio_source = 'alsa:hw:CARD=i2s,DEV=0' + big.audio_source = 'device:hw:2' big.input_format = f"int16le,{hardware_capture_rate},2" log.info("Configured analog stereo input: using ALSA hw:CARD=i2s,DEV=0 with ch1=left, ch2=right") elif is_stereo and sel == 'ch2':