Skip to content

Commit 816a488

Browse files
committed
fix: add debug log when drain is skipped due to non-Running PCM state
1 parent b112f80 commit 816a488

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

playback/src/audio_backend/alsa.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,11 @@ impl Sink for AlsaSink {
447447
// on a Prepared-state USB PCM can deadlock the kernel driver
448448
// (confirmed on Raspberry Pi 3 with the dwc_otg USB controller).
449449
// In that case, dropping the PCM is sufficient to release resources.
450-
if pcm.state() == State::Running {
450+
let state = pcm.state();
451+
if state == State::Running {
451452
pcm.drain().map_err(AlsaError::DrainFailure)?;
453+
} else {
454+
debug!("PCM not in Running state ({state:?}), skipping drain and dropping PCM");
452455
}
453456
}
454457

0 commit comments

Comments
 (0)