Author Topic: PreenFM2 Port to Baremetal RaspberryPi 3B  (Read 13561 times)

styro2000

  • Team member
  • *
  • Posts: 4
    • View Profile
PreenFM2 Port to Baremetal RaspberryPi 3B
« on: November 24, 2019, 03:11:35 AM »
Hello,
was searching the interwebs for a small opensource synth to complement the digitakt for live duties and found
PreenFM2. I love FM (i have an Yamaha FS1R) so i was hooked, if only the processor would be more powerful and
less cumbersome to program (i did stuff on the stm32f series and was somehow frustrated about the tools from st).
So there was a RaspberyPi lying around and so i ported PreenFM2 to the RaspberryPi  > RasPreenFM2
It runs baremetal so the latency is about 3ms which is quite ok.
MANY THANKS FOR THIS GREAT SYNTH!
Great Source, i learned a lot working on it and sorry for some quite awful coding, i hope Your cool with the port and the name
All stuff is on https://github.com/styro2000/RasPreenFM2
All the best and keep up the great work!
styro

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2259
    • View Profile
Re: PreenFM2 Port to Baremetal RaspberryPi 3B
« Reply #1 on: November 24, 2019, 11:34:17 AM »
 :o
WOW !!!
I started some time ago to port it to a RPI3 but under linux + Real time kernel. I never finished it ;)
Baremetal is much better !!!!
That's a very nice project !

So you have any info about the kind of performance you get ?
EDITED : i read the github README ;) That answer this question.
« Last Edit: November 24, 2019, 11:38:14 AM by Xavier »

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2259
    • View Profile
Re: PreenFM2 Port to Baremetal RaspberryPi 3B
« Reply #2 on: November 24, 2019, 11:39:32 AM »
I assume the audio main loop is single-threaded. No ?
Would be great to use the 4 cores of the RPI3  ;)

styro2000

  • Team member
  • *
  • Posts: 4
    • View Profile
Re: PreenFM2 Port to Baremetal RaspberryPi 3B
« Reply #3 on: November 25, 2019, 06:45:05 PM »
Hi Xavier,
thanks for Your feedback!
Yes, its only running on one core. The circle framework can access the other cores,
but it doesn't to look trivial, but it would give an impressive performance boost for sure!
I could imagine that it may give problems accessing the cores directly in the sound-dma-irq,
probably having the cores in an idle-loop and a semaphore that triggers the calculation from sound-dma-irq
could work, perhaps using one core per timbre or a clever algo to distribute over all cores.
Anyway there are many cycles waiting to be used ;)!
If i want to change the amount of operators/voices, its enough to change the definitions in common.h
or are there other things to change?
many thanks an all the best
styro

styro2000

  • Team member
  • *
  • Posts: 4
    • View Profile
Re: PreenFM2 Port to Baremetal RaspberryPi 3B
« Reply #4 on: December 04, 2019, 07:10:56 PM »
Hallo :),
the RasPreenFM2 Project evolves, some bugs are squashed, the speed of the ARP/LFO/ENVs/etc
are corrected, the filters are polyphonic per voice and got it to play 20 Voices à 6 Operators & Filters without (noticeable) hickups... (still on one core!), more info is on the github readme. 
I am not sure if i spotted a Bug, on a patch with an LFO modulation, when the number of voices is increased, the new voices didn't get the LFO-Speed (stays at 0). Is this ev. also on the PreenFM2?

@Toltekradiation, many thanks for the filters, great addition!

many thanks for the inspiring synth and all the best!
styro


   

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2259
    • View Profile
Re: PreenFM2 Port to Baremetal RaspberryPi 3B
« Reply #5 on: December 06, 2019, 10:05:56 AM »
I am not sure if i spotted a Bug, on a patch with an LFO modulation, when the number of voices is increased, the new voices didn't get the LFO-Speed (stays at 0). Is this ev. also on the PreenFM2?

Someone reported some problems when the number of voices increases that i could not reproduce.
Do you more info or steps to reproduce, i would be happy to take a look.


Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2259
    • View Profile
Re: PreenFM2 Port to Baremetal RaspberryPi 3B
« Reply #6 on: December 06, 2019, 06:37:21 PM »
I found something... Can you tell me if adding another valuechanged() here fix you problem ?
https://github.com/Ixox/preenfm2/blob/master/src/synth/LfoOsc.cpp?ts=4#L34
Can you try to add ?
      valueChanged(1);
in addition to valueChanged(3)


styro2000

  • Team member
  • *
  • Posts: 4
    • View Profile
Re: PreenFM2 Port to Baremetal RaspberryPi 3B
« Reply #7 on: December 08, 2019, 11:22:13 AM »
Hi Xavier
Great, it worked!
many thanks and all the best!
styro