[Top][All Lists]

[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: Herschel Karunaratne
Subject: Re: [fluid-dev] Crackling sound when more than 4 notes are played simultaneously
Date: Fri, 21 Aug 2015 12:15:06 +0000 (UTC)

Hi Marcus,
There is another thing which forgot to mention. I accidentally changed the sample rate to 4800 using -r ,and could play any amount of notes simultaneously and no crackles at all but there is long latency.



On Friday, 21 August 2015, 17:34, Herschel Karunaratne <address@hidden> wrote:

Hi Marcus,

Thanks for the information and I was thinking of recompile the Sunxi codec and the kernel too. I will do this.
Also is there any other way to use 13 voices simultaneously other than method I am doing? Any suggestions?



On Friday, 21 August 2015, 13:33, Marcus Weseloh <address@hidden> wrote:

Hi Herschel,

2015-08-21 9:28 GMT+02:00 Herschel Karunaratne
> 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
> 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:

> 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

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.



reply via email to

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