stereo seems to work, NEEDS RADIO FIRMWARE WITH 2 TX BUFFERS.

This commit is contained in:
Pbopbo
2026-04-07 14:36:15 +02:00
parent a126613739
commit 291d75b137
2 changed files with 7 additions and 1 deletions

View File

@@ -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:

View File

@@ -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':