[linux] [chromeOS] Recording with BufferSize < 1024 leads to bad audio
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- rust
- Domain
- audio-video-rtc
Research direction
Start by tracing how cpal reports the minimum buffer size for Linux audio devices, then inspect the backend path used by ChromeOS’s Linux subsystem. The report points to buffers below 1024 being truncated, but does not identify the responsible layer or a file or test. Done means reporting a minimum size of 1024 where that limit applies and verifying that requested buffers do not lose audio data.
Written by the indexing model from the issue text.
Description
On ChromeOS, using the Linux subsystem the cpal library seems to work correctly and records audio. However if I request buffer size smaller than 1024 (I used 480 and 960 for single-channel, 48 kHz 10 ms or 20 ms chunks) I receive buffers of the requested size that result in incorrect audio when played back (the audio is shorter than expected, higher pitched and has artifacts). After much investigation it seems like those are 1024-buffers truncated to the requested size and the truncated data is lost (instead of being passed in the next callback invocation). Requesting buffers of size 480 leads to ~0.5x audio length, and 960 is almost okay (with just some artifacts), which led me to the 1024 bytes conclusion. If requested BufferSize is >= 1024 then all the audio data is received correctly.
In such cases it would be nice for cpal to report the minimal buffer size as 1024, as opposed to 1.
This is not reproducible on my other Linux machines, and I have no clue which layer of the stack is responsible for truncation.
- Dominant language
- Rust
- Stars
- 4k
- Forks
- 554
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 1
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from RustAudio/cpal
-
API design
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
correctness
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
aaudio: dynamic buffer tuning never grows the buffer (set_buffer_size_in_frames reports Err on success)Possibly taken @dannyward630 claimed this 39 days ago. Openhost - aaudio platform - android
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
-
WebAudio wasm build fails with wasm-bindgen panic=unwind closuresPossibly taken @bogusyogi claimed this 48 days ago. Openhost - webaudio platform - web
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
PipeWire: dropping callback captures on the realtime worker can terminate the process with SIGXCPUOpenhost - pipewire platform - linux
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
ci: migrate pinned macos-15 runners to macos-26 and macos-26-intelPossibly taken @hawkingrei claimed this today. Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
nowledge-co/hawdb#2224 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
eclipse-score/coverage_tool#95 ·
Maintainers usually reply within 2 days
-
bug nvim
Difficulty 2/5 1-3 hours Newbie friendliness 74/100