Discussion:
[LAU] Crackling in ZynAddSubFX
Peter Lutz
2008-06-20 22:54:51 UTC
Permalink
I'm very new to Linux audio recording, so I apologize in advance if I'm
missing something obvious.

I have a brand new computer with an M-Audio Delta 44 audio card running the
latest version of Ubuntu Studio 8.04. I've been experimenting with software
synthesizers using a USB MIDI keyboard, and I've managed to get QSynth
working very well and have had some success recording that. I thought I'd
try ZynAddSubFX since it sounds amazing. The problem I'm having is that the
sound crackles (that's the best word I can think of to describe it) when I
play it. The very odd thing I've discovered though is that if I record
ZynAddSubFX in Ardour, I don't hear any crackling during playback of the
recording. It's only as I'm listening to ZynAdd in real-time as I play it.
I've tried using different speakers and headphones, but it makes no
difference.

I suppose I could just record it and try to ignore the crackling as I play,
but it would obviously be ideal to have no crackling at all.

I've tried tweaking both the ZynAdd settings and JACK settings (although my
guess is that JACK settings are fine, since I haven't had any issues with
recording live instruments or recording QSynth) but to no avail. I have the
sample rate in ZynAdd matching the one in JACK (48000Hz) and have tried
different buffer sizes in ZynAdd but haven't noticed a difference. I've also
noticed that it usually doesn't crackle when I'm using the default
instrument in ZynAdd, only once I switch to a different one -- then it seems
pretty continuous no matter which instrument I switch to after that.

Does anyone have any ideas as to what could be causing this?
Norval Watson
2008-06-20 23:40:27 UTC
Permalink
Are you running a real-time kernel (rt)?
rt kernel is pretty much essential to avoid snap,crackle and pop.



Get the name you always wanted with the new y7mail email address.
www.yahoo7.com.au/mail
Peter Lutz
2008-06-21 01:03:44 UTC
Permalink
Post by Norval Watson
Are you running a real-time kernel (rt)?
Yes, I am. It's the default kernel in Ubuntu Studio. I get almost no Xruns
in JACK too, so as far as I know, its a separate problem. I have noticed
though that one of the few times I'll get one or two Xruns is when I switch
instruments within ZynAddSubFX. Not sure if that matters.
Post by Norval Watson
Realtime: checked
Monitor: checked
H/W Monitor: checked
H/W Meter: checked (I'm not sure why I have these last two boxes checked,
does it matter?)
Frames/Period: 64 (I've tried 128 too, and that didn't seem to change
anything with ZynAdd)
MIDI Driver: seq
Sample Rate: 48000
Periods/Buffer: 2
Port Maximum: 256
Timeout: 500
Sample Rate: 48000
Buffer Size: 256
OscilSize: 512
PADsynth Interpolation: Linear (fast)
Append: checked
XML compression level: 3
Any ideas?
Peter Lutz
2008-06-21 02:36:41 UTC
Permalink
After a little more experimenting, I found a little workaround for this
issue... although it's still doesn't exactly shed any light on what's
causing the problem. I figure I'll post it here to this mailing list, in
case someone with more experience might know what's going on here.

I noticed that every time I switched to a different instrument in the
ZynAddSubFX instrument bank, I would get an Xrun in JACK. Then I'd start
hearing the crackling sound. The crackling didn't show up at first, only
until I switched instruments. I found that if I disconnected ZynAddSubFX
from system in the JACK Connection's Audio tab and then reconnected it, the
crackling goes away. If I switch to another instrument in ZynAdd, however, I
have to repeat this process otherwise the crackling comes back.

Another thing I noticed is that if I turn on "Verbose messages" in JACK,
load = 13.6919 max usecs: 185.000, spare = 1148.000
The load number will increase and the spare will decrease as I play notes.
If I switch instruments in ZynAdd however, I get an Xrun and then the load
number goes way down in the 1.0 - 2.0 range and as I play notes in ZynAdd,
this number is unaffected. Its as if JACK disconnects itself from ZynAdd or
something, despite not giving any indication that it has done so.

Oh well. I'm content with this workaround. I just thought I'd post this info
in case it may be helpful for someone else.
Post by Norval Watson
Are you running a real-time kernel (rt)?
Yes, I am. It's the default kernel in Ubuntu Studio. I get almost no Xruns
in JACK too, so as far as I know, its a separate problem. I have noticed
though that one of the few times I'll get one or two Xruns is when I switch
instruments within ZynAddSubFX. Not sure if that matters.
Post by Norval Watson
Realtime: checked
Monitor: checked
H/W Monitor: checked
H/W Meter: checked (I'm not sure why I have these last two boxes checked,
does it matter?)
Frames/Period: 64 (I've tried 128 too, and that didn't seem to change
anything with ZynAdd)
MIDI Driver: seq
Sample Rate: 48000
Periods/Buffer: 2
Port Maximum: 256
Timeout: 500
Sample Rate: 48000
Buffer Size: 256
OscilSize: 512
PADsynth Interpolation: Linear (fast)
Append: checked
XML compression level: 3
Any ideas?
Atte André Jensen
2008-06-21 06:37:24 UTC
Permalink
I
thought I'd try ZynAddSubFX since it sounds amazing.
It is an amazing synth indeed.
The problem I'm
having is that the sound crackles (that's the best word I can think of
to describe it) when I play it.
ZynAddSubFx has some fundamental problems with realtime. The original
author has given up on this, but Lats Luthman is working on a fix. In
the mean time you'll have to patch it yourself, patches available here:

http://sourceforge.net/tracker/?atid=502314&group_id=62934&func=browse

It might be easier to just get 2.2.1 and apply this patch
(that's the patches I use, wrapped up in one file, since I always forget
which ones to apply):

http://atte.dk/download/attes_patches.diff
--
peace, love & harmony
Atte

http://atte.dk | http://myspace.com/attejensen
http://anagrammer.dk | http://modlys.dk
Dave Phillips
2008-06-21 14:33:00 UTC
Permalink
Post by Atte André Jensen
I thought I'd try ZynAddSubFX since it sounds amazing.
It is an amazing synth indeed.
Amen. It is fantastic.
Post by Atte André Jensen
ZynAddSubFx has some fundamental problems with realtime. The original
author has given up on this, but Lats Luthman is working on a fix. In
http://sourceforge.net/tracker/?atid=502314&group_id=62934&func=browse
It might be easier to just get 2.2.1 and apply this patch
(that's the patches I use, wrapped up in one file, since I always forget
http://atte.dk/download/attes_patches.diff
Thanks for the diff, Atte. Does anyone know which, if any, distros have
patched ZynAddSubFX with these patches ? I'll rebuild it if I have to,
but it would be nicer if the distro maintainers agreed to use the
patched version.

Best,

dp
Patrice Brousseau
2008-07-17 06:10:52 UTC
Permalink
I know I'm a little late... but...

I recompiled zynaddsubfx (cvs patched) and it now works fine with freebob...

Yes!
Post by Peter Lutz
I'm very new to Linux audio recording, so I apologize in advance if
I'm missing something obvious.
I have a brand new computer with an M-Audio Delta 44 audio card
running the latest version of Ubuntu Studio 8.04. I've been
experimenting with software synthesizers using a USB MIDI keyboard,
and I've managed to get QSynth working very well and have had some
success recording that. I thought I'd try ZynAddSubFX since it sounds
amazing. The problem I'm having is that the sound crackles (that's the
best word I can think of to describe it) when I play it. The very odd
thing I've discovered though is that if I record ZynAddSubFX in
Ardour, I don't hear any crackling during playback of the recording.
It's only as I'm listening to ZynAdd in real-time as I play it. I've
tried using different speakers and headphones, but it makes no difference.
I suppose I could just record it and try to ignore the crackling as I
play, but it would obviously be ideal to have no crackling at all.
I've tried tweaking both the ZynAdd settings and JACK settings
(although my guess is that JACK settings are fine, since I haven't had
any issues with recording live instruments or recording QSynth) but to
no avail. I have the sample rate in ZynAdd matching the one in JACK
(48000Hz) and have tried different buffer sizes in ZynAdd but haven't
noticed a difference. I've also noticed that it usually doesn't
crackle when I'm using the default instrument in ZynAdd, only once I
switch to a different one -- then it seems pretty continuous no matter
which instrument I switch to after that.
Does anyone have any ideas as to what could be causing this?
------------------------------------------------------------------------
_______________________________________________
Linux-audio-user mailing list
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-user
Loading...