Using pisound with Zynthian / Test-Image

Hi all,

I am developing for the project Zynthian. Zynthian is a modular software synth based on Raspi and famous engines like ZynAddSubFX, setBfree, Fluidsynth and others.

Currently we are using Hifiberry soundcards but the pisound looks very promising for more functionality :slight_smile:. Especially the line in would be a very nice feature - so we can use vocoders, effects for guitars and voice, ā€¦

I hope I cn get a pisound as fast as possible because we would like to use it for our showcase on the next Maker-Faire in Berlin.

Regards, Holger

4 Likes

Holger, reach out to me via pranciskus[at]blokas.io

Hi all,

last week I got my (beta) pisound: very nice! I asked a friend to print a 3D-case. For the beta I had to fix the MIDI holes and add a hole for the power plug (all done by hand and not inside the STL). Now my RPi3 with pisound fits into the case:

I created a SD card image based on our build scripts for Zynthian. This image fits onto a 4GB SD card.

<DISCLAIMER>
This image is based on MOD-UI - a fantastic web based user-interface and LV2 host from [MOD devices]
(http://moddevices.com) and other fine open-source software. I and MOD are not responsible for any problems or
failures of the software! If you find bugs, you can try to contact me in this forum - but my main focus is creating 
Zynthian and testing for MOD - so I cannot maintain this image. If you like MOD-UI and need support: think about
buying a MOD-Duo.
</DISCLAIMER>

Requirements for testing:

  • DHCP server
  • RPI3 (RPi2 will not work!)
  • PiSound
  • Mic/Guitar/MIDI-keyboard/ā€¦ and an amplifier
  • Knowledge how to install an SD card image

How to test:

  1. Download the Image (will be available until 09.05.2017): MOD-PiSound-Image (~1.7GB)
  2. Install the image on a SD card (minimum 4GB) - if you donā€™t know how to do this: ask google :wink:
  3. Place the SD card in your RPi3+pisound (Yes - the software is optimized for RPi3 - so RPi2 will not work!)
  4. Connect a network cable (without network ->no ui ->no sound!), connect a guitar/mic and/or MIDI-keyboard
  5. Power on
  6. Wait about 30 seconds
  7. Connect to [YOUR-IP-ADDRESS]:8888
  8. Use the web gui to click your effects and generators together and have fun!

To get a shell onto your RPi do the folowing:
ssh root@[YOUR-IP-ADDRESS]
(the password is pisound)

I have put some demo pedalboards onto the card: try to load them via the second button on the bottem-left.

And here is a small demo (sorry - I am not a really good guitar player) with a Marshall-Amp-Simulation:
https://soundcloud.com/codeman1309/pisound-guitar

Rock on!

Holger

2 Likes

Wow, thanks for this nice surprise! We have also started playing around with mod-host/ui, itā€™s really an amazing piece of software. I will test your build in coming days! And sorry for not warning you about the caseā€¦ :slight_smile:

1 Like

Hi @Pranciskus,

No problem! The case fits after some small additions :wink:

I have noticed a little ā€œproblemā€ - or let me say a difference between the normal Zynthian installation (RPi3 and Hifiberry DAC) and the MOD_pisound. My test pedalboard is the setbfreak-chain: setbfreak is a setbfree hammond organ setup but I made additional LV2 controllers for realtime controlling parameters via MIDI (and thatā€™s why it is called setbfreak).

The setbfreak-chain is a pedalboard which consists of

setbfreak_synth<->setbfreak_overdrive<->setbfreak_whirl<->setbfreak_reverb

The whirl uses much CPU time. On the Zynthian it works without dropout/digital distortion (even on a RPi2+Hifiberry-Zynthian). On the MOD_pisound I got very fast digital distortion. The base is the same Kernel and the same jack2 (with the same options) and I used the performance-schedular for the CPU on both machines.

Maybe a (optimization-)problem with the kernel-driver for the pisound? I wll try to check this the next days - perhaps I can make some demo soundsā€¦

Regards, Holger

Hi @C0d3man,

The pisoundā€™s driver itself is not likely to be the problem - in case of audio, it only participates when configuring the state of the BCM processor according to current audio software needs.

Is there some correlation with MIDI activity load and the distortion? Are you using the physical MIDI ports for the control, or USB?

Thank you,
Giedrius.

Hi @Giedrius,

thanks for your fast answer!

I am using the pisound MIDI ports. The distortion happens when pressing more keys. The setbfreak has to generate more tones and due to the high CPU level (whirl-speaker) it seems that the distortion occurs at hight load. Strange is, that der are no xruns reported from jack2ā€¦

That seems to be a difference between Zynthian/Hifiberry and pisound: For Zynthian we are using the serial device of the RPi and ttymidi as ā€œuser-space-driverā€. It seems that pisound has its own MIDI device, or am I wrong?

BTW: Which GPIOs are used for pisound? For integration into Zynthian we need much GPIOs for TFTP and rotary encoders.

Regards, Holger

Could you check if you can reproduce the issue using an external MIDI controller via USB?

Indeed strange about xruns. Could the distortion be caused by too high sound levels somewhere?

Current available GPIOs for this version of pisound are here: http://blokas.io/pisound/docs/specs/#pinout-of-pi-header

Hey @C0d3man,

Iā€™m not sure which setBfreak synth you have tested with, I have tried ā€˜setBfreak Tonewheel Organā€™ but even before the sound reaches pisound, it usually has corruption at the hit and release of a MIDI note. The difference between HiFiBerry DACs could be different sampling rate (pisound runs on 48kHz instead of 44.1kHz), so the plugin may be behaving unexpectedly? The issue I observed though reproduced also when Jack was running using 44.1kHz sampling rate.

Anyway, I have captured the jackā€™s audio output using jack_capture, and found that having plugged in just the setBfreak Tonewheel Organ in MOD, it produces corrupted audio, before it reaches the sound card. In the Audacityā€™s screenshot below, I have marked the weird waveforms.

We have tried other kinds of synths other than setBfreak and we didnā€™t notice anything abnormal.

Could you show us a screenshot of your setup? Also could you try capturing a sound sample of the issue?

Thank you,
Giedrius.

Hi @Giedrius

Ahh - ok. I will try to use 48kHz for jack. The plugins are independent of the sample rate (in fact they are getting the samplerate as a initialization parameter).

Ahhh! Yes - jack-capture or jack_rec should be my friends! Uuuhhh - the waveforms looks ugly :imp:

Yes - Dexed and others synths worked, so I thought that high CPU usage makes a problem. But I think you are right: There seems to be an ā€œoverloadā€ of the plugin output!

What I am currently not really understand is why this happens. PiSound and Hifiberry may have a different chipsets or a different internal value(?) on which level the output amplifier is used? I thought this is normalized? That may cause this problem when using the same values on both plattforms.

On Zynthian/Hifiberry I have a problem with the mda-ePiano plugin (and this should also be a problem on PiSound - I will check this soon): Without gain-reduction-plugin on the output of the mda-ePiano you also get digital distortion. So the solution maybe to add a simple gain-reduction before connecting to the outputs.

I will do this the next days. And I will try the solution for fixing the distortion alsoā€¦ What I have learned: digital audio is not as easy as I thought :wink:

Thanks && Regards, Holger

Hi @Giedrius,

yesterday I had a gig with my band so I had only time today for further tests.

This is my test pedalboard:

I used the following MIDI data (recorded by myself): setbfreak-test.mid.zip (541 Bytes)

And here is the audio recorded with jack_capture directly on the system:

  1. zynthian_setbfreak-test.wav (reference file from Zynthian, 44.1 kHz)
  2. jack_capture_01_44.1.wav (test with 44.1. KHz)
  3. jack_capture_01_48.wav (test with 48.0 kHz)

The audio data is located here (until 7.5.2017) for downloading.

Maybe jack generates the problemā€¦ I think I will try jack from autostatic repository instead of my own compiled oneā€¦

Regards, Holger

Hey, indeed the audio produced seems different. As jack_capture records the audio data before it is sent to the audio card, the issue is most likely in the software.

Iā€™d suggest keep the test MIDI data simple, like a couple of single notes, so that the waveforms could be compared more easily between different cards / implementations.

Based on the single note patterns I produced in the screenshots in my previous post, Iā€™d say the plugin may be miscalculating some buffer length with the configuration parameters present when pisound is the output device. Would it be possible to log the audio modes used and compare with the HiFiBerry DAC? I think some other parameter than the sampling rate (sample bits or format?) may be different too which doesnā€™t get accounted for appropriately, causing such audio issues to occur.

Hi @Giedrius

many thanks for looking at the problems with setBfreak. I will go on and try to catch some more date at weekend.

Regards, Holger

Hi all,

I created an update: mod-pisound-1.0.img.xz (downloadable until 31.5.2017). There is still the problem with setBfreak. I havnā€™t found why it works on Zynthian but not on my PiSound installation. I also added much more plugins and fixes.

Regards, Holger

2 Likes

Good day Holger,
I just received my pisound. Is there any way I could get a copy of the mod-pisound SD card image file posted back in May? I noticed its no longer hosted or available at the URL above. Although Iā€™ve got a HiFiBerry, Iā€™d like to play with this new hardware too.

Thanks!

andyz

Hi @andyz,

I uploaded the old image to https://gigamove.rz.rwth-aachen.de/d/id/sLhUv7mwNkM44H again (available until 31th Aug 2017). Since the build there were much software updates, but I had no time to add them to this image.

For Hifiberry you can take a look at http://zynthian.org/. We are currently working on the hardware input for Zynthian, so PiSound can be supported by Zynthian hopefully soon.

Regards, Holger

1 Like

Iā€™m a bit confusedā€¦ is this is this about Zynthian or Modep? Or is it the same?

I donā€™t know much about MODDEPā€¦ my test-image boots a MOD-UI and you can access it via ā€œIPā€:8888. I put lots of plugins onto this image.

PiSound works currently not with Zynthian because there are GPIO conflicts. With the new encoder board or my current implementation with controlling Zynthian via OSC the GPIOs will be free for using PiSound for Zynthian. So Zynthian may hopefully support (beside Hifiberry, AufioInjector, ā€¦) also PiSound as sound card.

Zynthian has different sound engines. One of the engines is MOD-UI (a ā€œmetaā€ engine). So Zynthian is not MODDEP or my MOD-GUI test image. It is a combination of hardware controlling, a screen and software behind - a full synth.

Regards, Holger

1 Like

I understand! Thanks for the explanation!

Holger, thanks. I got the image successfully. I look forward to playing with it as well as Zynthian, which is why I got a HiFiBerry in the first place. I appreciate all your efforts!

andyz