Skip to content

Commit b796c20

Browse files
authored
Merge pull request #407 from HEnquist/patch301
Patch301
2 parents baf6a44 + 31bc887 commit b796c20

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## v3.0.1
2+
Bugfixes:
3+
- Make sure that Alsa playback device resumes after pause.
4+
15
## v3.0.0
26
New features:
37
- Optional multithreaded filter processing.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "CamillaDSP"
3-
version = "3.0.0"
3+
version = "3.0.1"
44
authors = ["Henrik Enquist <[email protected]>"]
55
edition = "2021"
66
description = "A flexible tool for processing audio"

src/alsadevice.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ fn play_buffer(
118118
// This sleep applies for the first chunk and in combination with the threshold=1 (i.e. start at first write)
119119
// and the next chunk generates the initial target delay.
120120
buf_manager.sleep_for_target_delay(millis_per_frame);
121+
} else if playback_state == alsa_sys::SND_PCM_STATE_PAUSED as i32 {
122+
debug!("PB: Device is in paused state, unpausing.");
123+
if let Err(err) = pcmdevice.pause(false) {
124+
warn!("Error unpausing playback device {:?}", err);
125+
}
121126
} else if playback_state != alsa_sys::SND_PCM_STATE_RUNNING as i32 {
122127
warn!(
123128
"PB: device is in an unexpected state: {}",
@@ -645,6 +650,7 @@ fn playback_loop_bytes(
645650
Ok(AudioMessage::Pause) => {
646651
trace!("PB: Pause message received");
647652
if can_pause && !pcm_paused {
653+
debug!("Pausing playback device");
648654
let pause_res = pcmdevice.pause(true);
649655
trace!("pcm_pause result {:?}", pause_res);
650656
if pause_res.is_ok() {

0 commit comments

Comments
 (0)