distortion when recording

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

Post Reply
finotti
Established Member
Posts: 528
Joined: Thu Sep 01, 2011 9:07 pm
Has thanked: 86 times
Been thanked: 23 times

distortion when recording

Post by finotti »

Let me start by apologizing for being completely ignorant on sound on Linux. I've been using GNU/Linux for a long time and am comfortable with it, but I am just now trying to do some recording with it.

I am running aptosid (basically Debian Sid/Unstable with a different (more up to date) kernel). My sound card is an ASUS Xonar DGX PCI-E GX2.5 (https://smile.amazon.com/gp/product/B007TMZ1BK/):

Code: Select all

$ inxi -A
Audio:     Card-2 C-Media CMI8788 [Oxygen HD Audio] driver: snd_oxygen
           Sound: Advanced Linux Sound Architecture v: k4.9.0-4.slh.1-aptosid-amd64
I am using an old Line 6 X3 (http://line6.com/legacy/podx3/) to record guitar parts. I connect the headphones out from the X3 to the mic in in the Xonar. (And I'm using Ardour to record, but it seems irrelevant.) The problem is that I keep getting some distortion/breaking out/clipping when recording, or even when just listening to what is coming from the X3 through the speakers.

The thing is, looking at levels in Ardour (or the input level in pavucontrol), there is no clipping at all. The X3 also has a clipping light for the input (the guitar) and it is not clipping coming in. If I connect headphones (to the same jack that was connecting to the soundcard), I get no distortion through them.

I tried lowering both the output of the X3 and input level in PulseAudio (using pavucontrol), and the volume gets really low, but still comes distorted.

As an example, check this sample here: http://luisfinotti.org/music/files/SOTW ... _08.42.mp3 Of course, the guitar has overdrive/distortion of "the good kind", but you can hear the bad kind in the intro at about 0:08 or 0:09 (and many times after that).

On a side note, the X3 has USB audio connection. I could record in Audacity via USB, and I had no distortion problems. Unfortunately, I cannot record on Ardour with it (i.e., via USB), but I will leave that for another thread. (That would be my ultimate goal, but it seems it would be harder to achieve.)

Here is some more info on the system, if relevant:

Code: Select all

$ inxi -v3
System:    Host: debian Kernel: 4.9.0-4.slh.1-aptosid-amd64 x86_64 (64 bit gcc: 6.3.0) Console: tty 14
           Distro: aptosid 2013-01 Ἑσπερίδες - kde-full - (201305050307)
Machine:   Device: desktop System: ASUS product: All Series
           Mobo: ASUSTeK model: Z87-PRO v: Rev 1.xx UEFI: American Megatrends v: 1707 date: 12/13/2013
CPU:       Quad core Intel Core i7-4771 (-HT-MCP-) cache: 8192 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 28834
           clock speeds: max: 3900 MHz 1: 2912 MHz 2: 2540 MHz 3: 1951 MHz 4: 3500 MHz 5: 3500 MHz 6: 3241 MHz
           7: 3427 MHz 8: 3457 MHz
Graphics:  Card: Intel Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller bus-ID: 00:02.0
           Display Server: X.org 1.19.1 driver: intel tty size: 133x74 Advanced Data: N/A out of X
Network:   Card-1: Intel Ethernet Connection I217-V driver: e1000e v: 3.2.6-k port: f080 bus-ID: 00:19.0
           IF: eth0 state: up speed: 100 Mbps duplex: full mac: e0:3f:49:a3:4c:a6
           Card-2: NetGear WNA1100 Wireless-N 150 [Atheros AR9271] driver: ath9k_htc usb-ID: 003-003
           IF: wlx4c60de719837 state: N/A mac: N/A
Drives:    HDD Total Size: 9257.9GB (51.6% used)
           ID-1: model: WDC_WD10EALS
           ID-2: model: Samsung_SSD_840
           ID-3: model: WDC_WD20EARX
           ID-4: model: WDC_WD20EARX
           ID-5: model: WDC_WD40EZRX
Info:      Processes: 316 Uptime: 7:21 Memory: 5988.8/15737.1MB Init: systemd runlevel: 5 Gcc sys: 6.3.0
           Client: Shell (bash 4.4.71) inxi: 2.3.5

Code: Select all

$ lsmod | grep snd
snd_seq_dummy           1467  2
snd_seq                45208  7 snd_seq_dummy
snd_oxygen             15438  3
snd_oxygen_lib         28917  1 snd_oxygen
snd_hda_codec          84071  0
snd_mpu401_uart         5763  1 snd_oxygen_lib
snd_rawmidi            17932  1 snd_mpu401_uart
snd_hda_core           44481  1 snd_hda_codec
snd_seq_device          3240  2 snd_seq,snd_rawmidi
snd_hwdep               5930  1 snd_hda_codec
snd_pcm                78327  4 snd_oxygen_lib,snd_hda_codec,snd_hda_core
snd_timer              19353  2 snd_seq,snd_pcm
snd                    56967  17 snd_oxygen_lib,snd_oxygen,snd_hwdep,snd_seq,snd_hda_codec,snd_timer,snd_mpu401_uart,snd_rawmidi,snd_seq_device,snd_pcm
soundcore               5283  1 snd
Any help or suggestions would be greatly appreciated!
rghvdberg
Established Member
Posts: 1067
Joined: Mon May 12, 2014 7:11 am
Has thanked: 15 times
Been thanked: 36 times

Re: distortion when recording

Post by rghvdberg »

pavucontrol is for pulseaudio
when using Ardour you are using either jack or alsa, afaik pavucontrol won't do a thing for that
open a terminal and run alsamixer, from there you can set levels
press F6 to select the soundcard if you have multiple soundcards connected
F4 is the recording tab, check the levels at that, especially the Mic Boost stuff
Also I think it's better to record from the 'Line in' instead of Mic ports on your soundcard

hope this helps
finotti
Established Member
Posts: 528
Joined: Thu Sep 01, 2011 9:07 pm
Has thanked: 86 times
Been thanked: 23 times

Re: distortion when recording

Post by finotti »

beck wrote:
finotti wrote:Any help or suggestions would be greatly appreciated!
I don't know if my suggestion will like and help you.
Recording distorted guitar quickly clips when plugged in. That clipping is something that quickly occurs in the direct electronic connection. Slight clipping will become overload quickly.
It is easier and better to record a distorted guitar amp with a mic. Then the 'room' wil kill slight clipping so it will not overload that quick in what you record.
And as a side effect, the sound will get deeper and warmer. You don't need a cabinet-plugin anymore.

Are you recording agains 0db by coincidence?
What it also could be and what you could try is to lower the db's a bit. Get away from that clipping border. Better record with max -3db peak, or even a bit lower.

Recording distorted guitar is difficult and needs finesse and caution. It overloads very quick.
Thanks for the suggestions. Although I'd love to record a real amp, I really can't. I record a home, mostly at night when my wife and son are sleeping. I really need a quiet way of doing it.

rghvdberg wrote:pavucontrol is for pulseaudio
when using Ardour you are using either jack or alsa, afaik pavucontrol won't do a thing for that
open a terminal and run alsamixer, from there you can set levels
press F6 to select the soundcard if you have multiple soundcards connected
F4 is the recording tab, check the levels at that, especially the Mic Boost stuff
Also I think it's better to record from the 'Line in' instead of Mic ports on your soundcard
hope this helps
Thanks, also, for the reply! I think you've got it! There was a "Analog Input Monitor" that could be set for either 0db or -6db. Setting it to -6db seems to have fixed the problem.

BUT: something very weird is happening. I've set all capture volumes to zero (on pavucontrol, and in pulse, xonar and x3 in alsamixer -- see attachments) and I still hear (and can record) the guitar coming through the X3! I don't understand what is happening... Any ideas?
Attachments
alsamixer: Xonar sound card
alsamixer: Xonar sound card
am_xonar.png (55.67 KiB) Viewed 1134 times
alsamixer: Pod X3
alsamixer: Pod X3
am_x3.png (31.25 KiB) Viewed 1134 times
alsamixer: PulesAudio
alsamixer: PulesAudio
am_pa.png (46.91 KiB) Viewed 1134 times
finotti
Established Member
Posts: 528
Joined: Thu Sep 01, 2011 9:07 pm
Has thanked: 86 times
Been thanked: 23 times

Re: distortion when recording

Post by finotti »

Here is the screenshot of pavucontrol's input section. Note both are muted and the level indicators do not move when I play (and hear myself).
Attachments
pavucontrol
pavucontrol
pavucontrol.png (38.6 KiB) Viewed 1134 times
finotti
Established Member
Posts: 528
Joined: Thu Sep 01, 2011 9:07 pm
Has thanked: 86 times
Been thanked: 23 times

Re: distortion when recording

Post by finotti »

beck wrote:
finotti wrote:There was a "Analog Input Monitor" that could be set for either 0db or -6db. Setting it to -6db seems to have fixed the problem.
Like i said to. Distortion is overload. If you're gonna record overload overloaded you get clipping very quick.

This problem i don't kill in the settings. I just put down the mixer slider a bit.
I tried to getting it down very very low in the mixing (barely audible) in both the unit and Ardour, and there was still breaking up before. It sounded as it was the distortion was *recorded* with the track, not clipping. (Again the meters were way below 0db, and below even 3db, as you suggested.)

Now, do you have any idea why there is sound coming through when all the input sliders (in alsamix and pavucontrol) are all the way down? (BTW, I've just disconnected the USB cable, so it's coming through the Xonsar card.
User avatar
sysrqer
Established Member
Posts: 2519
Joined: Thu Nov 14, 2013 11:47 pm
Has thanked: 319 times
Been thanked: 148 times
Contact:

Re: distortion when recording

Post by sysrqer »

I have the same thing on my laptop where the sound comes in at a particular set level even when everything is set to zero. I haven't found a solution for it so will be glad to see some of the replies you get.
finotti
Established Member
Posts: 528
Joined: Thu Sep 01, 2011 9:07 pm
Has thanked: 86 times
Been thanked: 23 times

Re: distortion when recording

Post by finotti »

beck wrote:Is it hearable distortion? Or just a slight visual peak on the meter, way below hearing frequencies?
You can hear it, but not see it. The meters all look fine, no clipping, nothing above -3db. But it sounds distorted. Again, you can hear it right away here: http://luisfinotti.org/music/files/SOTW ... _08.42.mp3

I've made a recording today, after decreasing the "Analog Input Monitor", and it helped quite a bit, but still had some distortion.

By the way, I cannot record clean guitar properly either, because it also breaks up...

Thanks for your replies!
User avatar
sysrqer
Established Member
Posts: 2519
Joined: Thu Nov 14, 2013 11:47 pm
Has thanked: 319 times
Been thanked: 148 times
Contact:

Re: distortion when recording

Post by sysrqer »

Maybe makes sure frame rates and bit rates match everywhere in the chain.
CrocoDuck
Established Member
Posts: 1133
Joined: Sat May 05, 2012 6:12 pm
Been thanked: 17 times

Re: distortion when recording

Post by CrocoDuck »

Hi there, few things I was thinking.

Like you did, double check there aren't too high gains and preamplifier setup in alsamixer.

Also, pick up your device manual and look whether there is some hardware setting (maybe achieved through jumpers on the board) that switches on some hardware gain or input/output characteristic.

Check whether the output impedance of the headphone out f the X3 is much lower than the input impedance of the soundcard (you should find these data in manuals and specs). If not, distortion might arise by improper electronic coupling of the two devices. Do you have other outputs on the X3?

When the volume is low (or 0) and you can still record sound, is it very faint? This could be just electrical cross talking.

Does the distortion comes up when you use JACK or only when you are on PulseAudio? Have a look at this.

You mentioned you are new to Linux audio. Hopefully this contains a not too wrong representation of the basic Linux audio anatomy. You can refer to Libre Music Production for beginner friendly tutorials.
finotti
Established Member
Posts: 528
Joined: Thu Sep 01, 2011 9:07 pm
Has thanked: 86 times
Been thanked: 23 times

Re: distortion when recording

Post by finotti »

Thanks CrocoDuck for the really good resources!

I tried the 1/4" outputs, and had similar problems...

The sound coming through (with mix at 0) was pretty loud. I could record just fine like that. (But still some distortion...) And distortion came through pulesaudio and jack.

I've just got a Focusrite 2i2 and it works with no distortion! I was thinking of returning it if I can get things to work. In particular, it would be nice if I could record from the X3 USB...

Thanks again for the helpful comments (from CrocoDuck and everyone else)!
Post Reply