ALSA backend with pipwire-alsa buffer length mismatch causing xruns
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- rust
- Lĩnh vực
- audio-video-rtc
Hướng nghiên cứu
Start with the linked reproduction repository’s README and the CPAL ALSA backend’s buffer size handling; reproduce the reported xrun with the beep example and PipeWire quantum set to 2048. Compare default and explicit buffer sizes against the observations in the issue. Done when the backend avoids the reported underruns in the described setup or documents a clear supported workaround.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Repro repo with a detailed README: https://github.com/karolinepauls/cpal-alsa-buffer-repro
Problem: The existing "beep" example can produce a choppy sound when run over pipewire-alsa, and so can any other code that leaves the buffer size setting default. I've reproduced it with kira (which uses CPAL with ALSA) as well as my private sound engine using CPAL's ALSA backend. In all those cases, I've had constant underruns producing audio glitches.
I believe this is ultimately a pipewire-alsa problem. Still CPAL needs to help users avoid it. Could we
A) somehow read the actual buffer size used by the device and use that?
B) or at least suggest against using BufferSize::Default and set it to e.g.:
let buffer_size = if let &SupportedBufferSize::Range { min, max } = default_config.buffer_size()
{
2048.clamp(min, max)
} else {
2048
};
Abbreviated repro
-
Start
pw-topin background to monitor the quanta. -
Lock device quantum, as if another running application caused the quantum to be set (e.g. Firefox playing a video).
pw-metadata -n settings 0 clock.force-quantum 2048
- Run, requesting default buffer size:
cargo run
Result: running with a buffer size of 512, choppy sound.
- Run, requesting an explicit buffer size of 512:
cargo run -- --buffer-size 512
Same effect.
- Run, requesting a buffer size of at least 1024:
cargo run -- --buffer-size 1024
Result: clean sine.
- Run with a buffer size of 512 but also ensure that pipewire runs with it.
pw-metadata -n settings 0 clock.force-quantum 512
cargo run -- --buffer-size 512
Result: clean sine.
Observations
For some reason an app buffer size of 512 doesn't work with a device buffer size of 2048. At least with pipewire-alsa.
| app | device | result |
|---|---|---|
| 512 | 512 | ok |
| default | 2048 | xrun |
| 512 | 2048 | xrun |
| 1024 | 2048 | ok |
| 2048 | 2048 | ok |
Versions
pipewire:
Compiled with libpipewire 1.6.2
Linked with libpipewire 1.6.2
Kubuntu 26.04.1 LTS
CPAL: git 79275c2313da30e9f8b1ad8168385d091a2c9ada (current master).
- Ngôn ngữ chính
- Rust
- Star
- 4k
- Fork
- 554
- Merge trung bình
- 2 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của RustAudio/cpal
-
aaudio: dynamic buffer tuning never grows the buffer (set_buffer_size_in_frames reports Err on success)Có thể đã có người làm @dannyward630 đã nhận 2 ngày trước. Đang mởhost - aaudio platform - android
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
Maintainer thường phản hồi trong vòng 1 ngày
-
WebAudio wasm build fails with wasm-bindgen panic=unwind closuresCó thể đã có người làm @bogusyogi đã nhận 11 ngày trước. Đang mởhost - webaudio platform - web
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
RustAudio/cpal#1394 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
New WASAPI implementationĐang mởcode quality dependencies host - wasapi platform - windows
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
RustAudio/cpal#1416 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
host - pipewire platform - linux
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 52/100
RustAudio/cpal#1405 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
WASAPI: default-device activation fails with RPC_E_CHANGED_MODE after endpoint-notification callbacks put thread-pool threads into an STACó thể đã có người làm @dannyward630 đã nhận 3 ngày trước. Đang mởcorrectness host - wasapi platform - windows
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 20/100
RustAudio/cpal#1402 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của RustAudio/cpal
Issue tương tự
-
desktop documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
vfarcic/dot-agent-deck#2008 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
pbakaus/impeccable#1210 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: ci priority: P4 ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
shep-pm/shep#1249 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
L: javascript
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
dependabot/dependabot-core#16744 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
nautechsystems/nautilus_trader#5486 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày