Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Post History

66%
+2 −0
Q&A 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 le...

0 answers  ·  posted 9mo ago by mr Tsjolder‭  ·  edited 9mo ago by mr Tsjolder‭

#2: Post edited by user avatar mr Tsjolder‭ · 2024-02-26T08:22:46Z (9 months ago)
add distro information
  • I am trying to debug an [issue](https://github.com/musescore/MuseScore/issues/11220) with audio playback in [MuseScore](https://musescore.org/en).
  • 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:
  • 1. Playback of my 16-bit/44.1kHz `test.wav` file failed because JACK only seems to support 32-bit.
  • 2. After creating a 32-bit version of the file, I got stuttering audio with a warning about a sample rate mismatch.
  • 3. 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!
  • I am trying to debug an [issue](https://github.com/musescore/MuseScore/issues/11220) with audio playback in [MuseScore](https://musescore.org/en).
  • 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:
  • 1. Playback of my 16-bit/44.1kHz `test.wav` file failed because JACK only seems to support 32-bit.
  • 2. After creating a 32-bit version of the file, I got stuttering audio with a warning about a sample rate mismatch.
  • 3. 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.
#1: Initial revision by user avatar mr Tsjolder‭ · 2024-02-23T16:50:03Z (9 months ago)
How to debug audio issues with JACK on Linux
I am trying to debug an [issue](https://github.com/musescore/MuseScore/issues/11220) with audio playback in [MuseScore](https://musescore.org/en).
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:
 1. Playback of my 16-bit/44.1kHz `test.wav` file failed because JACK only seems to support 32-bit.
 2. After creating a 32-bit version of the file, I got stuttering audio with a warning about a sample rate mismatch.
 3. 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!