PDA

View Full Version : [SOLVED] Common problem with Jack Audio, Rakarrack and everything else!



Vansolrick
10th November 2010, 09:52 AM
I noticed that any CPU load, while using Rakarrack guitar effects, causes the sound to distort and it generates loads of noise. This actually happens when using anything while running Jack audio. If I'm recording, I get tons of noise on the recorded track when I play it back (and live when monitoring) because any CPU usage seems to interfere with the signals. It even does it live in the playthrough (monnitor).

I realized it had to do with CPU usage when I noticed a pattern with the noise correlating to the plasma CPU monitor widget I had running originally. The noise refreshed when the monitor did. Since then, I noticed that anything that puts a slight load on the system will cause this disruption (even moving a window around, or anything in the background processes).

Anyone who is experienced with Jack audio, and possibly rakarrack as well, know the cause to this? I figured loading a low resource WM and eliminating unneeded processes can help but it doesn't since the recording program itself, while recording, is enough to cause this problem. (I know this because playing the guitar in Rakarrack, without recording and just using Jack to run the sound to the speakers, doesn't have constant noise but when recording, there is a constant noise)

Vansolrick
12th November 2010, 03:17 AM
No ideas then? I looked up quite a bit and still can't find the answer. I understand the theory in currents and how there will be noise resulting in the high impedance, DC current of the guitar that will be a constant. However, that does not explain how I'm getting terrible, distorted, white noise whenever my cpu needs to do something else for 1 second. It didn't do this in the past and didn't do it on my ubuntu install. The sound literally shapeshifts the signal from the guitar into a terrible shuffling, distorted, white noise effect that drowns out any other sound.

:mad:lol

Sounds to me that its picking up the "noise" of the processor or GPU (when something is dragged across the screen such as a window)

marko
12th November 2010, 03:27 AM
Does it help to turn off cpuspeed?


su -c "service cpuspeed stop"


I've always wondered if the radical clock changes caused by cpuspeed would screw up stuff that's time sensitive like Jack or pulseaudio

hellork
12th November 2010, 03:37 AM
Sounds to me like the preamp or pickup is gathering RI from the computer. Probably a bad ground. Also check levels and make sure the output match the specs for your Line In port, if that is where it is plugged in. Should be less than 1 volt with isolation. Sounds like I know what I'm talking about, but I don't because you did not include enough details about your hookup.

Vansolrick
12th November 2010, 05:12 AM
Sorry for the limited information. Setup is:

Electric Guitar > Direct 1/4" jack to soundcard input

Software: jack, rakorrack, audacity, and alsamixer in konsole.

Everything is connected properly in jack.

Mixed entirely on Alsamixer

Running qtjackctrl as gui setup

And, I picked this up in the jack console whenever the noise shows up:


21:06:32.695 XRUN callback (29 skipped).
JackEngine::XRun: client = rakarrack was not run: state = 2
JackAudioDriver::ProcessAsync Process error
JackPosixMutex::Unlock res = 1
JackEngine::XRun: client = rakarrack was not run: state = 2
JackAudioDriver::ProcessAsync Process error
JackPosixMutex::Unlock res = 1
JackEngine::XRun: client = rakarrack was not run: state = 1
JackAudioDriver::ProcessAsync Process error
JackPosixMutex::Unlock res = 1
JackEngine::XRun: client = rakarrack was not run: state = 1
JackAudioDriver::ProcessAsync Process error
JackPosixMutex::Unlock res = 1
JackEngine::XRun: client = rakarrack was not run: state = 1
JackAudioDriver::ProcessAsync Process error
JackPosixMutex::Unlock res = 1
JackEngine::XRun: client = rakarrack was not run: state = 1
JackAudioDriver::ProcessAsync Process error
JackPosixMutex::Unlock res = 1
JackEngine::XRun: client = rakarrack was not run: state = 1
JackAudioDriver::ProcessAsync Process error
JackPosixMutex::Unlock res = 1
JackEngine::XRun: client = rakarrack was not run: state = 1
JackAudioDriver::ProcessAsync Process error
JackPosixMutex::Unlock res = 1
JackEngine::XRun: client = rakarrack was not run: state = 1
JackAudioDriver::ProcessAsync Process error
JackPosixMutex::Unlock res = 1
JackEngine::XRun: client = rakarrack was not run: state = 1
JackAudioDriver::ProcessAsync Process error
JackPosixMutex::Unlock res = 1
JackEngine::XRun: client = rakarrack was not run: state = 1
JackAudioDriver::ProcessAsync Process error
JackPosixMutex::Unlock res = 1


It repeats but I thought I would show it as it is. This scrolled through when I was just clicking and dragging on a window on the desktop.

I have all the settings identical (as I know) to my setup in my Ubuntu install and didn't have the issues there.

Also, unfortunately, turning off the CPU Scaling process did not change the issue. :(

transmogrifox
12th November 2010, 06:37 PM
Hi. The problem is very plain. Rakarrack is using a large amount of CPU and it's causing xruns. Xruns is when the audio is not processed in the time before it needs to be sent out. Missing "Chunks" of audio in the output stream sound like extreme distortion, and of course, this will effect all audio on your computer.

If you read the Help in Rakarrack you will learn some ways to optimize things (I'm assuming you're using 0.5.8 because prior versions did not have the high CPU effects included).

The test:
Select a preset that does not use Reverbtron, Convolotron, Harmonizer or shifter. If the problem goes away and CPU is normal, then here's what you can do:

In Settings->Preferences->Audio,
Look for Downsample options on Harmonizer, Reverbtron, Convolotron, Shifter, and Sequence. Set them all to 22000 or lower. This changes the internal processing sample rate and saves CPU usage. Convolotron is the most CPU-hungry. I have mine set to 16000.

For Reverbtron and Convolotron you can reduce the "Length" parameter to further reduce CPU usage.

I don't know why it was different on your Ubuntu setup.

For my audio setup, I started with Debian Sid, most basic install (CLI only), added Openbox and XFCE4 panel and then start that from my ~/.xinitrc script. No clock or other gadgets on the panel...only a menu, sys tray and app dock. I recommend reducing normal desktop services and applets when doing RT audio. It lets you play much closer to the margin :)

I think you can do the same kind of thing with Fedora. Install something lightweight like Fluxbox or Openbox. Make a file called .xinitrc in your home folder. Put the programs you want to start in there.. For example Mine contains these two lines:
openbox-session &
xfce4-panel

Then <ctrl><alt><F1> to your tty1, log in.
$sudo service gdm stop
$startx

That will give you a lightweight environment.
When you're done with RT audio tasks, you can bring back your normal Fedora desktop environment by switching to tty1 then
<ctrl> <c> to kill your x session,
$sudo service gdm start

You may want to back check me on my methods for stopping and starting gdm. On CentOS 5 I have to
$sudo init 3
If I want to kill gdm, otherwise it respawns gdm. A more extreme measure is to remove gdm from the runlevel 5 init scripts.... anyway... I hope that is helpful to you.

Vansolrick
14th November 2010, 08:47 AM
Hi. The problem is very plain. Rakarrack is using a large amount of CPU and it's causing xruns. Xruns is when the audio is not processed in the time before it needs to be sent out. Missing "Chunks" of audio in the output stream sound like extreme distortion, and of course, this will effect all audio on your computer.

If you read the Help in Rakarrack you will learn some ways to optimize things (I'm assuming you're using 0.5.8 because prior versions did not have the high CPU effects included).

The test:
Select a preset that does not use Reverbtron, Convolotron, Harmonizer or shifter. If the problem goes away and CPU is normal, then here's what you can do:

In Settings->Preferences->Audio,
Look for Downsample options on Harmonizer, Reverbtron, Convolotron, Shifter, and Sequence. Set them all to 22000 or lower. This changes the internal processing sample rate and saves CPU usage. Convolotron is the most CPU-hungry. I have mine set to 16000.

For Reverbtron and Convolotron you can reduce the "Length" parameter to further reduce CPU usage.

I don't know why it was different on your Ubuntu setup.

For my audio setup, I started with Debian Sid, most basic install (CLI only), added Openbox and XFCE4 panel and then start that from my ~/.xinitrc script. No clock or other gadgets on the panel...only a menu, sys tray and app dock. I recommend reducing normal desktop services and applets when doing RT audio. It lets you play much closer to the margin :)

I think you can do the same kind of thing with Fedora. Install something lightweight like Fluxbox or Openbox. Make a file called .xinitrc in your home folder. Put the programs you want to start in there.. For example Mine contains these two lines:
openbox-session &
xfce4-panel

Then <ctrl><alt><F1> to your tty1, log in.
$sudo service gdm stop
$startx

That will give you a lightweight environment.
When you're done with RT audio tasks, you can bring back your normal Fedora desktop environment by switching to tty1 then
<ctrl> <c> to kill your x session,
$sudo service gdm start

You may want to back check me on my methods for stopping and starting gdm. On CentOS 5 I have to
$sudo init 3
If I want to kill gdm, otherwise it respawns gdm. A more extreme measure is to remove gdm from the runlevel 5 init scripts.... anyway... I hope that is helpful to you.

You're right. That was the problem and it was fixed by following your instructions. I'll be setting up a session like the one you described for RT recording. I can't thank you enough! Thank you.

Vansolrick
19th November 2010, 01:47 AM
Does it help to turn off cpuspeed?


I've always wondered if the radical clock changes caused by cpuspeed would screw up stuff that's time sensitive like Jack or pulseaudio

Thanks. You're actually correct as well. This is the root source of the problem :) Just narrowed it down now.

dd_wizard
19th November 2010, 02:20 AM
You can also set the cpu governor to performance by installing cpufrequtils and using the included cpufreq-set. It's in the fedora repo and has a good man page for cpufreq-info and cpufreq-set.

dd_wizard

ArthurX
23rd July 2011, 08:30 PM
This also worked for me in fedora 15.


su -c "service cpuspeed stop"

It improved the jack latency time.
I have a firewire mixer and it worked out of the box with fedora, but a bit to high latency.
I got a bit fedup with ubuntu was hard to get the mixer working.

Greetings Arthur