You are not logged in.

#1 2022-05-28 20:44:08

ttshaw1
Member
Registered: 2020-04-12
Posts: 31

Regular crackling when using MIDI keyboard in Ardour with Pipewire

I'm trying to get a MIDI keyboard set up in Ardour. The problem I'm running into is that everything mostly works, but there's a regular crackling happening for about a tenth of a second about once a second when I'm playing the keyboard into Ardour. I assume it's some sort of sampling rate mismatch but don't know where to start looking.

Right now, my setup is
- pipewire running with default settings
- Ardour running with JACK backend, 1024 samples, 21.3ms buffer size
- a MIDI track in Ardour. I've recreated the problem with ACE Reasonable Synth and Simple Synth so far. I assume others will have the same problem.
- a Helvum setup with the MIDI capture going to the Ardour track's midi_in connection, with the track's audio_out connection going to Master/audio_in. Master/audio_out goes to my sound card's playback ports

Any advice on what I should be checking first?

Offline

#2 2022-05-28 22:41:06

Maniaxx
Member
Registered: 2014-05-14
Posts: 738

Re: Regular crackling when using MIDI keyboard in Ardour with Pipewire

When you play the recorded midi track audio is ok?

Try the 'threadirqs' kernel parameter.


sys2064

Offline

#3 2022-07-01 03:19:46

ttshaw1
Member
Registered: 2020-04-12
Posts: 31

Re: Regular crackling when using MIDI keyboard in Ardour with Pipewire

Sorry I took so long to get back to this thread. I edited my /etc/default/grub so that GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet threadirqs" and ran grub-mkconfig -o /boot/grub/grub.cfg , but I'm not sure how I can check if threadirqs was enabled as expected. I tried recording the midi track and playing it back, and noticed the same crackling.

Offline

#4 2022-07-01 08:31:03

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,665

Re: Regular crackling when using MIDI keyboard in Ardour with Pipewire

cat /proc/cmdline

should contain the threadirqs option if it got applied correctly.

Offline

#5 2022-07-01 16:38:37

Maniaxx
Member
Registered: 2014-05-14
Posts: 738

Re: Regular crackling when using MIDI keyboard in Ardour with Pipewire

ttshaw1 wrote:

when I'm playing the keyboard into Ardour.

Does it only happen when the keyboard is involved?
Start 'Ardour' on command line and check for errors and warnings. Also see additional logs by pressing the corresponding button in the upper right corner.

Try higher buffer to see if it changes something:

$ env PIPEWIRE_LATENCY=2048/48000 ardour6

What about other audio software/output?
Try other main sample rate in Ardour project.
Try 'jack2-dbus' instead of pipewire.

Last edited by Maniaxx (2022-07-01 16:54:44)


sys2064

Offline

#6 2022-11-17 04:43:19

ttshaw1
Member
Registered: 2020-04-12
Posts: 31

Re: Regular crackling when using MIDI keyboard in Ardour with Pipewire

I didn't have much time to do testing the past few months, but started troubleshooting again. Sorry if this thread is too old to be bumping; I'd be happy to make a fresh one. It turns out this doesn't have to do with the keyboard; any audio output will crackle as long as ardour is running with the configuration I have now.

There's also a dependence on what output device I use. I have two I care about, a USB DAC and my motherboard sound card. I set my default audio device through the Plasma audio control widget (https://docs.kde.org/stable5/en/plasma- … index.html). If I set my default device to the USB DAC, when ardour is running any, audio source that's playing to the USB DAC will crackle. If I edit my audio patchbay in Helvum so that a source is playing to the motherboard sound card and to the USB DAC, it'll crackle over both. But if I make it play only to the motherboard sound card, it works properly. The reverse is also true; setting the motherboard sound card as default, editing the patchbay so the USB DAC is the only output of a source makes that source's audio work correctly. This is the case with or without

$ env PIPEWIRE_LATENCY=2048/48000

I also tried 128 buffer instead of 2048 and didn't notice a difference.

Does that point toward a solution? I want to keep my audio setup as simple as possible, so I'd prefer to stick with pipewire-jack instead of jack2-dbus. But if it's still a mystery I can give it a shot.

Edit, it's actually more complex than I thought. Doing the switch-from-default trick makes most sources work, but if ardour is connected to that non-default source, everything will crackle again. This also happens if I route ardour to the default sink and run the default sink's monitor to the non-default sink. Ardour can play without crackling, but only if the default source is the motherboard sound card, it's been switched over to the USB DAC, and ardour was launched with PIPEWIRE_LATENCY specified as above. I'm going to need to make some sort of table soon, there's a lot of variables to keep track of here.

Last edited by ttshaw1 (2022-11-17 04:56:32)

Offline

#7 2022-11-22 13:43:47

Maniaxx
Member
Registered: 2014-05-14
Posts: 738

Re: Regular crackling when using MIDI keyboard in Ardour with Pipewire

Try a different USB port. If possible one that doesn't get shared (see 'lsusb -t'). Remove other USB devices.


sys2064

Offline

#8 2023-08-02 13:16:10

edrickblade
Member
Registered: 2023-08-02
Posts: 1

Re: Regular crackling when using MIDI keyboard in Ardour with Pipewire

I found a solution making a .desktop file to run Ardour with Pipewire-ALSA and now I don't have that problem in Ardour, it could be helpful, below is the .desktop script.

[Desktop Entry]
Name=Ardour Pipewire-ALSA
GenericName=Ardour Digital Audio Workstation
Icon=Ardour-Ardour_7.5.0
Exec=env ARDOUR_ALSA_DEVICE=pipewire Ardour7 %U
Type=Application
Categories=AudioVideo;Recorder;AudioVideo;AudioVideoEditing;
Comment[en_US.UTF-8]=Ardour with Pipewire-ALSA configuration


Edrick Blade

Offline

Board footer

Powered by FluxBB