fluid-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [fluid-dev] Crackling sound when more than 4 notes are played simult


From: Marcus Weseloh
Subject: Re: [fluid-dev] Crackling sound when more than 4 notes are played simultaneously
Date: Fri, 21 Aug 2015 10:03:40 +0200

Hi Herschel,

2015-08-21 9:28 GMT+02:00 Herschel Karunaratne
<address@hidden>:
> My arm board is Alwinner A20, 1GHz, 2GB RAM etc., so it should work with
> these resources.

I'm using Fluidsynth on similar hardware: A20 Allwinner, 1GHz, 512MB
RAM. I'm not sure what kernel the Linaro Ubuntu distro is using for
your board, but I suspect it is something based on the linux-sunxi-3.4
kernel. And that is probably the reason why you see the following
messages:
> fluidsynth warning: Requested a period size of 64, got 1024 instead
> fluidsynth warning: Requested 16 periods, got 8 instead

The kernel driver for the A20 audio codec defines very high minimum
values for period size (1024) and num periods (4). If you want to get
anywhere near real-time playback, then you need to recompile the
driver and kernel. Here are the limits as defined in the sunxi audio
codec driver source:

.buffer_bytes_max = 128*1024,//最大的缓冲区大小
.period_bytes_min = 1024*4,//最小周期大小
.period_bytes_max = 1024*32,//最大周期大小
.periods_min = 4,//最小周期数
.periods_max = 8,//最大周期数

 Have a look at this blog post, that guy had the same problem and also
provides a patch for the driver:
http://linux.autostatic.com/2013/09/17/exit-beaglebone-black-hello-cubieboard2

> I have a SF with 13 different instruments and playing through
> USB MIDI. As the Fluidsynth starts I use CC 0 7 0.... command to reduce the
> volume of all the MIDI channels to zero. When a key is pressed the MIDI
> sends  Note ON command to all 16 MIDI channels. I switch ON/OFF instruments
> by setting the MIDI channel volume 0 or 127 again by using cc command again.

Ok, if I understand you right, then you have instruments on 13
individual MIDI channels. When you press a key, a note on is issued to
all 16 channels, so 13 instruments play simultaneously. Pressing 4
keys then means that 4 * 13 = 52 voices will be playing. Pressing the
5th key adds another 13 voices, which brings you to 65. On a
non-real-time kernel, that sounds very close to what fluidsynth can
deliver on this kind of hardware. The CPU load spikes to nearly 100%,
sometimes you hear sounds like crackling, sometimes even something
that sounds like a record needle slowly scratching over a vinyl
record. Reduce the amount of voices, and it quickly goes back to
normal.

So on the A20 hardware, you definitely want to set the synth.polyphony
parameter to 64 or less on a "normal" kernel. I'm running a heavily
stripped down 3.4 kernel with preemt-rt patches, that brings working
polyphony up to 96, with period size 32, periods 2.

Cheers,

    Marcus



reply via email to

[Prev in Thread] Current Thread [Next in Thread]