Noise when using JACK

Still new to all of this? Feel free to post in any of the subforums on this site, but in this subforum newbie questions are especially encouraged!

Moderators: MattKingUSA, khz

Post Reply
oakwood
Established Member
Posts: 14
Joined: Mon Nov 28, 2022 2:52 pm
Has thanked: 4 times
Been thanked: 1 time

Noise when using JACK

Post by oakwood »

Hello to all!

I am relatively new to Linux, I am a former Mac user, with some "hobbyist level" experience with music production (basic knowledge of Garageband).

I am now experimenting with audio production under Linux.

I am on an HP EliteBook 840 G7, with Linux Mint 20.3.

Following the steps described in this tutorial I managed to install a low latency kernel, then I have installed JACK, and Qsynth. Everything seems to work fine if I use Qsynth and pulseaudio: I use the vmpk simple virtual keyboard, and I have good output sound.

I have also tested JACK, as suggested in the tutorial using

Code: Select all

$ jack-play test.wav

and I hear the right clean output.

However, when I tell Qsynth to use JACK, I have noise. Specifically, when I hit a key in vmpk I have "white noise" for few milliseconds, and only when it fades I have a little bit of the note that I was supposed to play.

I have the same "white noise" problem if I use Rose Garden.

I have tried to change the sample rate and the frames/period settings, with many combinations, and also the Timeout, in JACK, but the problem stays the same.

Thank you in advance for any help you can give!

Fabio

User avatar
Loki Harfagr
Established Member
Posts: 268
Joined: Thu Aug 02, 2018 1:28 pm
Has thanked: 151 times
Been thanked: 53 times

Re: Noise when using JACK

Post by Loki Harfagr »

Did you try different soundfonts in QSynth? (in the idea that millisecs whitenoise lies in that soundfont itself)

User avatar
Impostor
Established Member
Posts: 1334
Joined: Wed Aug 17, 2022 1:55 pm
Has thanked: 138 times
Been thanked: 345 times

Re: Noise when using JACK

Post by Impostor »

I have tried to change the sample rate and the frames/period settings, with many combinations, and also the Timeout, in JACK, but the problem stays the same.

Definitely sounds like your audio buffer size is too small anyway.

I'd recommend QjackCtl to start and configure Jack. If the largest selectable (4096) buffer still doesn't rid you of distortion, something's amiss..

Also make sure to set your cpu to performance mode.

And what's this "timeout" setting you mentioned?

oakwood
Established Member
Posts: 14
Joined: Mon Nov 28, 2022 2:52 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Noise when using JACK

Post by oakwood »

Loki Harfagr wrote: Mon Nov 28, 2022 5:11 pm

Did you try different soundfonts in QSynth? (in the idea that millisecs whitenoise lies in that soundfont itself)

Good idea!
I tried other soundfonts, but the result is the same!

:(

oakwood
Established Member
Posts: 14
Joined: Mon Nov 28, 2022 2:52 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Noise when using JACK

Post by oakwood »

Impostor wrote: Mon Nov 28, 2022 6:19 pm

I have tried to change the sample rate and the frames/period settings, with many combinations, and also the Timeout, in JACK, but the problem stays the same.

Definitely sounds like your audio buffer size is too small anyway.

I'd recommend QjackCtl to start and configure Jack. If the largest selectable (4096) buffer still doesn't rid you of distortion, something's amiss..

Also make sure to set your cpu to performance mode.

And what's this "timeout" setting you mentioned?

Thank you for the suggestion!
Unfortunately, it doesn't work...

Could you give me some hint about how to set the cpu to performance mode?
I don't know how to.

About the Timeout, it is in the "advanced" panel of the QjackCtl settings, I read somewhere that it may help... but it doesn't :(

User avatar
khz
Established Member
Posts: 1648
Joined: Thu Apr 17, 2008 6:29 am
Location: German
Has thanked: 42 times
Been thanked: 92 times

Re: Noise when using JACK

Post by khz »

oakwood wrote: Tue Nov 29, 2022 5:12 am

Could you give me some hint about how to set the cpu to performance mode?

As root

Code: Select all

cpupower frequency-set -g performance

Info:

Code: Select all

cpupower frequency-info

https://wiki.linuxaudio.org/wiki/system ... _processes
https://linux.die.net/man/1/cpupower
https://linux.die.net/man/1/cpupower-frequency-info
https://linux.die.net/man/1/cpupower-frequency-set

. . . FZ - Does humor belongs in Music?
. . GNU/LINUX@AUDIO ~ /Wiki $ Howto.Info && GNU/Linux Debian installing >> Linux Audio Workstation LAW
  • I don't care about the freedom of speech because I have nothing to say.
User avatar
Impostor
Established Member
Posts: 1334
Joined: Wed Aug 17, 2022 1:55 pm
Has thanked: 138 times
Been thanked: 345 times

Re: Noise when using JACK

Post by Impostor »

There's a utility which performs system checks for optimizing audio performance:

https://codeberg.org/rtcqs/rtcqs/releases

Just download rtcqs_x86_64 (6.5 MB);
Go into your download folder, check its sha256sum;
Right-click the file, set permission to executable;
Right-click in the download folder and choose "open in terminal";
Run

Code: Select all

./rtcqs*

You'll probably get some warnings and tips (do not blindly follow them, like disabling meltdown/spectre mitigations. Know what you are doing first!)

oakwood
Established Member
Posts: 14
Joined: Mon Nov 28, 2022 2:52 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Noise when using JACK

Post by oakwood »

khz wrote: Tue Nov 29, 2022 6:03 am
oakwood wrote: Tue Nov 29, 2022 5:12 am

Could you give me some hint about how to set the cpu to performance mode?

As root

Code: Select all

cpupower frequency-set -g performance

Info:

Code: Select all

cpupower frequency-info

https://wiki.linuxaudio.org/wiki/system ... _processes
https://linux.die.net/man/1/cpupower
https://linux.die.net/man/1/cpupower-frequency-info
https://linux.die.net/man/1/cpupower-frequency-set

Thank you for the reply and hints, @khz !

I have done this:

Code: Select all

(base) fabio@Fabio-EliteBook:~$ cpupower frequency-info
analyzing CPU 0:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 400 MHz - 4.90 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 400 MHz and 4.90 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 800 MHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
(base) fabio@Fabio-EliteBook:~$ sudo cpupower frequency-set -g performance
Setting cpu: 0
Setting cpu: 1
Setting cpu: 2
Setting cpu: 3
Setting cpu: 4
Setting cpu: 5
Setting cpu: 6
Setting cpu: 7
(base) fabio@Fabio-EliteBook:~$ cpupower frequency-info
analyzing CPU 0:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 400 MHz - 4.90 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 400 MHz and 4.90 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 3.50 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
    

The problem is still there :(

(However, I see a great improvement in the performance of MIDI in Ardour, which is not part of this question, but thank you! :) )

tkmusic
Established Member
Posts: 36
Joined: Tue Feb 07, 2023 6:06 am
Has thanked: 7 times
Been thanked: 3 times

Re: Noise when using JACK

Post by tkmusic »

Sorry if I'm necroing an old thread, but I'm running into a similar issue. I'm trying to test recording in Ardour, and I'm getting a lot of staticy noise coming out of the speakers. It's not just with any MIDI input: I get the same result when I try to play anything with my bass. I've tried lowering the volume level on the track I'm recording on, but I can still hear the unwanted distortion. Could it be a frame-buffer or a connection issue, and if so how do I go about fixing it? If anyone needs screenshots of my setup/JACK connections, I can post them too.

Post Reply