Comments on How to debug audio issues with JACK on Linux
Post
How to debug audio issues with JACK on Linux
I am trying to debug an issue with audio playback in MuseScore. During this process, I realised that I had/have no clue about audio playback in Linux (or in general for that matter).
I already learned about the differences between ALSA and Pipewire (or PulseAudio for that matter) and what JACK is supposed to do (I think). However, I am not sure if everything (or anything) is configured correctly.
Before this issue I never had any issues with audio playback and I assume my system must have been in a default configuration state.
The main clue for the MuseScore issue is an error of the form "audio output open failed."
In an attempt to pin the issue down, I learned about aplay
and discovered that this did not work out-of-the-box.
For some reason aplay
tried to use my USB Microphone as the default playback device and failed (unsurprisingly).
After adding a configuration file under /etc/asound.conf
specifying the soundcard (of the motherboard) should be used as default, things seemed to work.
However, after a restart and attempting playback in MuseScore, I learned that I had opened the gates to hell.
Although I believe I perceived some traces of what I expected to hear, I was treated with noise that was way louder and lasted longer than necessary.
This latter is to be taken literally: it didn't stop immediately when I paused but went on for multiple seconds.
Due to the mentions of JACK in the issue thread on Github, I wanted to repeat the aplay
experiments with JACK.
I quickly learned that I could use aplay -D jack
to play through JACK (after I started a JACK server of course).
The JACK server was started using the command jackd -r -d alsa -d hw:1,0
, where hw:1,0
specifies my sound card.
This seemed to be necessary because JACK seems to ignore the ALSA default.
This is the point where I was again met with a sequence of problems:
- Playback of my 16-bit/44.1kHz
test.wav
file failed because JACK only seems to support 32-bit. - After creating a 32-bit version of the file, I got stuttering audio with a warning about a sample rate mismatch.
- The warning suggested to use
aplay -D plug:jack
instead, which resulted in (differently) stuttering audio without a warning. I also tried to play the original 16-bit file out of curiosity and this also worked (with stuttering).
I have been spending more time than I care to admit to figure all of this out. Although I managed to get sound out of JACK, it is pretty useless in its current state. Therefore, I suspect that I am missing some crucial insight(s). Am I using JACK in the wrong way, is it just a matter of configuration or are there better ways to debug audio issues? I am open to any suggestions, hints or insights!
PS: I am on Arch linux using PipeWire as the main audio server.
2 comment threads