fluid-dev
[Top][All Lists]
Advanced

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

Re: [fluid-dev] Distorted Sound with FluidSynth + Alsa on a SBC


From: Ceresa Jean-Jacques
Subject: Re: [fluid-dev] Distorted Sound with FluidSynth + Alsa on a SBC
Date: Tue, 19 Nov 2019 19:17:47 +0100 (CET)

Hi Etienne,

> odroid@odroid:~$ fluidsynth -C0 -R0 -r 44100 -c2 -v -d -a alsa -m alsa_seq /home/odroid/Documents/bandoneon_v2.sf2

Here some tips. Those result on experimention using Raspberry device.

1) Avoiding lost of precious cpu cycles:

1.1) Setting reverb and chorus off: Use -C0 -R0.

1.1) Never use -v and -d option permanently. Both consume a lot of precious cpu cycles.

2) Allowing fluidsynth sufficient time to compute things:

2.1) Prefer low sample rate: 44100Hz (avoid 96000Hz):

2.2)Avoid -c2 option and prefer -o audio.periods=xx , also use  -o audio.period-size=yy to choose the size of each buffer.

First use Alsa driver before trying using Alsa hardware device layer.

Play one note using "noteon" command before trying playing note from your MIDI controller.

The first thing to do is choosing high value for xx and yy.Then when a one note sounds fine you could try to diminish xx, yy to

get lower latency as possible.

 

Have you solved your issue ?

What settings did you use when you got a distorded sound ?

jjc.

 

> Message du 15/11/19 18:57
> De : "Etienne Besançon" <address@hidden>
> A : address@hidden
> Copie à :
> Objet : Re: [fluid-dev] Distorted Sound with FluidSynth + Alsa on a SBC
>
>

> Thanks for reactivity,

>  

> Pulse audio is now uninstalled.

>  

> I was able to get sound from Alsa:

>  

> odroid@odroid:~$ aplay -l

> **** List of PLAYBACK Hardware Devices ****

> card 0: ODROIDHDMI [ODROID-HDMI], device 0: SPDIF PCM dit-hifi-0 []

>   Subdevices: 1/1

>   Subdevice #0: subdevice #0

> card 1: ODROIDDAC [ODROID-DAC], device 0: PCM5102 HiFi pcm5102-0 []

>   Subdevices: 1/1

>   Subdevice #0: subdevice #0

>  

> odroid@odroid:~$ aplay -D hw:CARD=ODROIDDAC,DEV=0 Desktop/foo.wav 

> Playing WAVE 'Desktop/foo.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo

> ^CAborted by signal Interrupt...

>  

> Fluidsynth gets right rate:

>  

> odroid@odroid:~$ fluidsynth -C0 -R0 -r 44100 -c2 -v -d -a alsa -m alsa_seq /home/odroid/Documents/bandoneon_v2.sf2

 

> Changing the rate has an expected impact: even distorted, switching from 48000 to 96000 will increase the notes of one octave.

> I also try to change the soundfont without improvement.

>  

> Indeed, the CPU is a 32-bits Cortex-A5…

>  

> HLB

>  

>  

>  

>  

> Message du 15/11/19 10:26
> De : "Philippe Simons" <address@hidden>
> A : "FluidSynth mailing list" <address@hidden>
> Copie à : "Etienne Besançon" <address@hidden>
> Objet : Re: [fluid-dev] Distorted Sound with FluidSynth + Alsa on a SBC
>
>
device seems to be powerful enough.
maybe you can also try to disable 64bit floating point operations and use 32bit with cmake enable-floats options
also if you are not using pulse at all, try to disable it completely

>
Philippe

>
On Fri, Nov 15, 2019 at 9:34 AM Marcus Weseloh <address@hidden> wrote:
>
Hi Etienne,

>
first please try to find out if Fluidsynth is actually the problem or if there is something wrong with your audio setup. Maybe try to play a normal wav file via the alsa device:

>
$ aplay -D hw:1,0 /path/to/a/soundfile.wav

>
For the sound file, use one in the format that you want fluidsynth to output. So if you want it to render 16bit 441000 audio, then try to play a stereo wav with 16 bit and 41000 sample rate. 
See if simply playing the wav file also results in distorted audio.

>
Cheers
Marcus

>

>
Am Do., 14. Nov. 2019 um 22:17 Uhr schrieb Etienne Besançon <address@hidden>:
>

> > Hi!

> >  

> > I'm running FluidSynth on a Single Board Computer, a Hardkernel Odroid C1+ that is actually stacked with a audio board integrating a high-end DAC. The aim is to turn this into a MIDI expander. Long story short, that actually runs pretty good on my desktop computer but got a very distorted sound on the SBC.

> >  

> > The MIDI instrument is well discovered:

> >     odroid@odroid:~$ lsusb 

> >     Bus 001 Device 005: ID 2341:8037 Arduino SA 

> >  

> > Fluidsynth is configured as follow:

> >     odroid@odroid:~$ fluidsynth -C0 -R0 -r 44100 -v -d -a alsa -o audio.alsa.device=hw:1 -o synth.polyphony=64 -m alsa_seq /home/odroid/Documents/Bandoneon.sf2 

> >     FluidSynth version 1.1.6

> >     Copyright (C) 2000-2012 Peter Hanappe and others.

> >     Distributed under the LGPL license.

> >     SoundFont(R) is a registered trademark of E-mu Systems, Inc.

> >     

> >     fluidsynth: warning: Failed to pin the sample data to RAM; swapping is possible.

> >     fluidsynth: prog 0 0 0

> >     fluidsynth: prog 1 0 0

> >     fluidsynth: prog 2 0 0

> >     fluidsynth: prog 3 0 0

> >     fluidsynth: prog 4 0 0

> >     fluidsynth: prog 5 0 0

> >     fluidsynth: prog 6 0 0

> >     fluidsynth: prog 7 0 0

> >     fluidsynth: prog 8 0 0

> >     fluidsynth: prog 9 128 0

> >     fluidsynth: warning: No preset found on channel 9 [bank=128 prog=0]

> >     fluidsynth: prog 10 0 0

> >     fluidsynth: prog 11 0 0

> >     fluidsynth: prog 12 0 0

> >     fluidsynth: prog 13 0 0

> >     fluidsynth: prog 14 0 0

> >     fluidsynth: prog 15 0 0

> >     Type 'help' for help topics.

> >     

> >     event_pre_noteon 0 60 106

> >     event_post_noteon 0 60 106

> >     fluidsynth: noteon 0 60 106 00000 36.312 3.550 0.000 0

> >     event_pre_noteoff 0 60 106

> >     event_post_noteoff 0 60 106

> >     fluidsynth: noteoff 0 60 0 00000 3.574 1

> >     event_pre_noteon 0 60 106

> >     event_post_noteon 0 60 106

> >     fluidsynth: noteon 0 60 106 00001 39.626 3.876 0.000 0

> >     event_pre_noteoff 0 60 106

> >     ^C

> >  

> > The instrument well connected:

> >     odroid@odroid:~$ aconnect -io

> >     client 0: 'System' [type=kernel]

> >         0 'Timer           '

> >         1 'Announce        '

> >     client 24: 'Arduino Micro' [type=kernel]

> >         0 'Arduino Micro MIDI 1'

> >     client 128: 'FLUID Synth (3113)' [type=user]

> >         0 'Synth input port (3113:0)'

> >     odroid@odroid:~$ aconnect 24 128

> >  

> > Well, everything looks fine but the sound I get when playing the midi instrument is very distorted, noisy. Changing the rate did not improved, playing with the buffer a little bit. Weirdly enough, switching output to pulse audio ("fluidsynth -a pulseaudio...") gives expected sounds but with a 2~3 seconds latency.

> >  

> > Any clue about this? How can I get more details regarding what going on?

> >  

> > Thanks!

> > HLB

> >  

_______________________________________________
> fluid-dev mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/fluid-dev
>
_______________________________________________
> fluid-dev mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/fluid-dev
>



_______________________________________________
fluid-dev mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/fluid-dev


reply via email to

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