[PIPEWIRE+JACK] Frequent Xruns with specific block size settings (beep example)

Open
#709 0 comments 1 reaction 0 assignees View on GitHub

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

Research direction

Start with the beep example and reproduce the reported Xruns using PIPEWIRE_LATENCY="128/44100" cargo run --features jack --example beep -- --jack on PipeWire's JACK compatibility layer. Compare behavior at block size 512 and with a USB sound card, as the report describes. Done means identifying why the example Xruns under the reported settings and providing a fix or explanation; the issue names no test.

Written by the indexing model from the issue text.

Description

host - pipewire platform - linux

Hi,

I've run into a lot of Xruns recently when using a specific blocksize/samplerate setting ... it was driving me crazy until I found that the "beep" example provided in the cpal repo has the same problem.

To reproduce, start the beep example with

PIPEWIRE_LATENCY="128/44100" cargo run --features jack --example beep -- --jack

At least on my machine, with the internal sound card, there's a very regular occurrence of Xruns, about one per second.

What I don't understand so far is, in a different project of mine I use cpal in more or less exactly the same manner on the same setup, and I can go down to blocksizes of 64 without problems, even though the audio callback is way heavier.

So I'm really confused why a simple example like the beep example create such a problem.

Some more symptoms/hints:

  • with a blocksize of 512 the problem doesn't occur
  • with another app (i.e. firefox) playing audio in the background, the problem disappears
  • sometimes the problem doesn't occur at all, but most of the time it does
  • with a USB soundcard the problem doesn't occur

About my setup:

  • Arch Linux with kernel: Linux ___ 5.19.13-arch1-1 #1 SMP PREEMPT_DYNAMIC Tue, 04 Oct 2022 14:36:58 +0000 x86_64 GNU/Linux
  • Pipewire with all the drop-in replacements for jack, pulseaudio, etc (that is, no actual JACK server is running)

Any hints on why this happens or how to fix it ?

Dominant language
Rust
Stars
4k
Forks
554
Avg merge
1d 3h
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from RustAudio/cpal

All issues in RustAudio/cpal

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.