Distortion in Waveform

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

Matt73
Established Member
Posts: 57
Joined: Fri Aug 27, 2021 5:07 am
Has thanked: 8 times
Been thanked: 6 times

Distortion in Waveform

Post by Matt73 »

Hello Kind People,

Switched to Linux about 2 years ago. Had a few headaches with the usual stuff that Linux newbies have but now I'm cool with entering commands into the terminal etc.

Anyway, I am using Tracktion Waveform on Zorin with a cheap Behringer audio interface. When I fire up Waveform, the audio is often very distorted. The way I fix this is by going into the audio settings and refreshing the input and output or choosing another audio option and then going back to choosing the interface from the drop down menu. However, this doesn't always work and sometimes I have to restart the computer. I think maybe the problem is connected to the fact that when I am not using my DAW, I unplug the USB for the interface so I can listen to the news etc through the laptop speakers. Then when I plug it back in and open my DAW I get this horrible distortion and have to fiddle for a while to get it working ok. It disrupts my creativity and surely can be avoided in this day and age?

Maybe it's because I am using Zorin (Waveform is 'tested on ubuntu 18.04)? Maybe I should switch to Ubuntu? Maybe I should be using JACK? Any advice appreciated.

Best Wishes

Matt
User avatar
Michael Willis
Established Member
Posts: 1451
Joined: Mon Oct 03, 2016 3:27 pm
Location: Rocky Mountains, North America
Has thanked: 69 times
Been thanked: 163 times
Contact:

Re: Distortion in Waveform

Post by Michael Willis »

It seems that you are likely experiencing xruns, which could be caused for a variety of reasons. You should not have to change your distro, and your behringer interface should be fine.

There are several things you can do to reduce the likelyhood of xruns. Probably the first thing to find out is what buffer size, sample rate, and frames count you are using. Report those numbers here and you can get suggestions about how to adjust them. Beyond that, run realTimeConfigQuickScan to diagnose the problem. It will give you suggestions about how to tune your system for realtime audio production.
User avatar
milo
Established Member
Posts: 1242
Joined: Wed Sep 06, 2017 2:55 am
Location: Southern Utah, USA
Has thanked: 275 times
Been thanked: 218 times
Contact:

Re: Distortion in Waveform

Post by milo »

Using JACK might work too. That would tie down a lot of settings for buffer size, sample rate, etc. which might help stabilize things. Try it and see.
Matt73
Established Member
Posts: 57
Joined: Fri Aug 27, 2021 5:07 am
Has thanked: 8 times
Been thanked: 6 times

Re: Distortion in Waveform

Post by Matt73 »

Hello Kind Sirs,

Ok, that's interesting. I'm glad I don't have to change distros because I like Zorin and I am used to it.

Anyway, here is a screenshot of my audio settings page in waveform:
Screenshot from 2021-08-27 19-40-46.png
Screenshot from 2021-08-27 19-40-46.png (252.11 KiB) Viewed 9837 times
What do you think?

When I choose JACK instead of ALSA in the audio settings of waveform, there are no options to choose from. I suppose I have to run JACK. I always shied away from that as it looked a bit daunting and confusing to set up and I am trying to keep things as simple as possible.

Anyway, thanks guys for taking the time to help out a newbie.

Best

Matt
User avatar
bluebell
Established Member
Posts: 1909
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland, Germany
Has thanked: 111 times
Been thanked: 116 times

Re: Distortion in Waveform

Post by bluebell »

The options for jack (samplerate, buffer size etc.) are set when starting jack since they are valid for all clients connecting to jack, not per client.

Linux – MOTU UltraLite AVB – Qtractor – http://suedwestlicht.saar.de/

Kott
Established Member
Posts: 818
Joined: Thu Mar 21, 2013 12:55 am
Location: Vladivostok
Has thanked: 65 times
Been thanked: 122 times

Re: Distortion in Waveform

Post by Kott »

Do you have pulseaudio running?
User avatar
Linuxmusician01
Established Member
Posts: 1524
Joined: Mon Feb 23, 2015 2:38 pm
Location: Holland
Has thanked: 756 times
Been thanked: 135 times

Re: Distortion in Waveform

Post by Linuxmusician01 »

Matt73 wrote: Fri Aug 27, 2021 5:49 pm [...] I suppose I have to run JACK. I always shied away from that as it looked a bit daunting and confusing to set up and I am trying to keep things as simple as possible. [...]
Doesn't necessarily have to be complicated to start and use Jack. Try this:

Code: Select all

jackd -d alsa --device hw:1
(I assumed that your Behringer external (USB?) audio device is hw:1)

Good luck in trouble shooting! :)
User avatar
Linuxmusician01
Established Member
Posts: 1524
Joined: Mon Feb 23, 2015 2:38 pm
Location: Holland
Has thanked: 756 times
Been thanked: 135 times

Re: Distortion in Waveform

Post by Linuxmusician01 »

Matt73 wrote: Fri Aug 27, 2021 5:20 am [...]I think maybe the problem is connected to the fact that when I am not using my DAW, I unplug the USB for the interface so I can listen to the news etc through the laptop speakers. Then when I plug it back in and open my DAW I get this horrible distortion and have to fiddle for a while to get it working ok. It disrupts my creativity and surely can be avoided in this day and age?
Linux numbers audio devices (i.e. sound cards), starting from 0 (zero). You have two of 'm: the internal audio card from your computer and the Behringer. When you start your PC those numbers get allocated. Unfortunately not always in the same order. When you connect an external audio device (the Behringer in your case) after bootup it is hw:1.

This may be one reason why it goes wrong after every (re)boot. You must choose your audio device wisely in your DAW.

There is a way to force Linux to number your on-board card always as 0. If you want I can look that up for you. But for now I think you've gotten enough dazzeling info. ;)

Good luck!
Last edited by Linuxmusician01 on Mon Aug 30, 2021 9:41 am, edited 2 times in total.
User avatar
Michael Willis
Established Member
Posts: 1451
Joined: Mon Oct 03, 2016 3:27 pm
Location: Rocky Mountains, North America
Has thanked: 69 times
Been thanked: 163 times
Contact:

Re: Distortion in Waveform

Post by Michael Willis »

Linuxmusician01 wrote: Sat Aug 28, 2021 11:36 am But for now I think you've gotten enough dazzeling info. ;)
Hahaha, welcome to audio on Linux @Matt73, where there's more than one way to do anything, and the corollary is that when you're experiencing issues there are lots of possible reasons why.

Some more considerations are to try installing a low latency kernel, and disable wifi while you're using your DAW.
Matt73
Established Member
Posts: 57
Joined: Fri Aug 27, 2021 5:07 am
Has thanked: 8 times
Been thanked: 6 times

Re: Distortion in Waveform

Post by Matt73 »

Hi Guys,

Well I'm still confused. But there's no way I'm going back to Windows and I can't afford a Mac so..I'll figure it out.

Pulse audio is what works when the USB isn't plugged in and if I open the DAW without the USB interface plugged in and go to audio settings, then it shows that pulse has been selected and the sound comes out of the laptop speakers. If I plug the USB interface in and restart the DAW it sees the interface and I can choose it and it works...until I open the program again and I get the distortion.

What works is when I shut down the computer. Restart it with the USB in and then fire up tracktion waveform. Then I look at the audio settings in the DAW and they are set right (for the USB interface) and I click on the 'test tone' button and it's nice and clear. Then I can work on my freaking awesome tracks. However, if I close the program and reopen it, even without removing the USB, I get the test tone but with lots of distortion...and the tracks play but sound crackly and distorted.

I am thinking that since tracktion tested their Linux version on Ubuntu that I should actually install Ubuntu rather than Zorin (which I know is ubuntu based)?

I don't see how installing jack will help. I don't want to overcomplicate things with another running as well as my DAW. I just want to run the DAW and have it work as it does when I start it first time. And what is the point of installing a low latency kernel if I am using a separate low-latency soundcard?

When I have the USB interface plugged in and I am watching Odysee or using Skype then the system automatically uses the interface. I shut other programs down when I use my DAW though but it doesn't help. In the sound settings on Zorin I can see that it sees the laptop speakers and 2 extra 'digital' and 'analogue' PCM 2902 audio codecs for both outputs and inputs which seem to be the USB interface,

I tried that jack command but it didn't work. I was offered some alternative option for installing it. I need to learn more about JACK because I don't know JACK about JACK.

It's a bloody pain to be honest. I just want to fire up my DAW when I'm feelign inspired and get to work rather than messing with a bunch of tech issues.

Anyway, I thank you all for your kind help. I've also written to Tracktion. I recently paid for the pro version so it should at least work. Their previous versions also had issues and were crashy on Linux.

Best

Matt
User avatar
milo
Established Member
Posts: 1242
Joined: Wed Sep 06, 2017 2:55 am
Location: Southern Utah, USA
Has thanked: 275 times
Been thanked: 218 times
Contact:

Re: Distortion in Waveform

Post by milo »

Ahh, the noobie blues! Sorry about the headaches. In our defence, pro audio is complicated to set up on other OS's too. I've been in your shoes, and I promise that it gets easier as you stick with it. Let me try to address some questions.

It sounds like your problem is something about switching in and out if PulseAudio. Maybe your DAW is running on ALSA and pausing PA or something. My guess is that JACK will help, or at least will be worth trying to troubleshoot. Based on the error message you might not have JACK installed. I recommend using a GUI JACK interface like qjackctl (forgive the awful name -- it's a very useful app).

Code: Select all

sudo apt install qjackctl
JACK is designed for connecting audio between apps, but it is also good at pinning down your audio setup and getting PA out of the way.

A low latency OS kernel is different than a low latency interface. Typically you want both. The newer stock kernels are better at latency than the old ones, so you may get by with a stock kernel. I wouldn't worry about that yet.

I doubt that switching your distro to Ubuntu will help. Switching to AV Linux might, but I wouldn't go there yet.
JamesPeters
Established Member
Posts: 188
Joined: Fri Jun 29, 2018 6:35 pm
Has thanked: 8 times
Been thanked: 15 times

Re: Distortion in Waveform

Post by JamesPeters »

Have you disabled usb autosuspend? I had issues similar to this using ALSA (and Jack) at low latency settings with USB audio devices until I disabled that. The audio device is most likely "aggressively going to sleep" when it's not used, with the default setting of the distro. Unfortunately this isn't an obvious thing since unlike Windows, there's no "high performance power profile" to set in "control panel". You might remember doing this in Windows. It still has to be done in Linux to attain the same benefit, but finding settings like this involves a bit of searching.

Another aspect of that is setting your CPU frequency governor to "performance" (although that's probably not the problem right now).

I use TLP to change this. There's a GUI frontend for it called TLP UI which is in the Arch repo but not Ubuntu repo, although I've read TLP UI can be installed from a PPA. Using TLP itself is fine, it's not difficult to do, but it means you'd be editing the tlp.conf file in a text editor. You'd be "uncommenting" lines as needed by removing "#" at the start of whatever line's settings you need to enable, and changing "0" to "1" or "Y" to "N" (and so on) for various lines in the file (there's documentation within the file itself, so that's all I needed). On my system the tlp.conf file is installed in /etc/. The particular line to look for here is USB_AUTOSUSPEND="0". Make sure that's "uncommented".

The CPU frequency governor can be set in that same file, or you could use a utility to change it as you want (sometimes I like to let the CPU "throttle down"). I'm using cpupower-gui, and that should be available in the main Ubuntu repo.

Using Jack shouldn't be necessary. Jack is handy for connecting various audio devices and applications together, but if you "just want to use the DAW" as though you would've done in Windows or Mac, chances are Jack isn't important to you.

I don't know how that particular DAW handles Pulse Audio though. In Reaper (what I use) it automatically disables Pulse Audio when it uses ALSA, if you enable that feature. This prevents Pulse Audio from interfering with Reaper using ALSA. So that might be the problem or part of it.
Matt73
Established Member
Posts: 57
Joined: Fri Aug 27, 2021 5:07 am
Has thanked: 8 times
Been thanked: 6 times

Re: Distortion in Waveform

Post by Matt73 »

Wow, thanks guys. Some juicy ideas here. I will give them all a try when the bloody kids give me a moment to myself. I'll report the findings. Looks like some have nerdiness thrust upon them.
Matt73
Established Member
Posts: 57
Joined: Fri Aug 27, 2021 5:07 am
Has thanked: 8 times
Been thanked: 6 times

Re: Distortion in Waveform

Post by Matt73 »

Ok so I got the TLP UI working and unticked the USB autosuspend box and then clicked saved. Then I tried the DAW and got the same problem. I went back and started up TLP UI again and I see the box is ticked again. How do I get it to stay unticked?
Matt73
Established Member
Posts: 57
Joined: Fri Aug 27, 2021 5:07 am
Has thanked: 8 times
Been thanked: 6 times

Re: Distortion in Waveform

Post by Matt73 »

Even if I leave the USB interface plugged in, the next time I startup waveform and click on the test tone I get the nasty distortion. I fiddle around with the audio settings in the DAW, change them and then go back or sometimes select a different USB codec and it workks again...until the next time I start the program....I've been into TLPUI to try and change the USB options but they don't seem to stay changed. This whole thing is annoying me now. I will take a break and check back later.

I've though about installing JACK but I don't need to connect any software to any other and I don't want another app running at the same time as the DAW really. I just want to use the DAW itself and keep things simple. I could have recorded an album in the time it's taken to get through all these seemingly endless Linux headaches.
Post Reply