Trying to understand the 'custom' wiring

I’ve decided to try using Zynthian so I’ve started it up on a standard Pi4B using a Behringer USB audio interface. I switched to the ‘testing’ repositories and updated.

I’m surprised how many xruns I’m getting. When I run Ubuntu Studio 20.04 on this same Pi and audio interface, I can configure jackd with 128 samples and 2 periods, and no problems. With Zythian I am stuck at 256 samples.

It sounds really good.

My Pi4B has a power button on pin 5 (GPIO3). To make this button shut down Zynthian, I suppose I just need to map it to Zynthian’s “Select” button. but all I see in the UI is:

Switches Pins: 0,0,0,0

And I can’t find it documented anywhere? Do I need something like 0,0,0,5 ? Or 0,0,5,0 ? Or am I completely wrong ?

And… I would also like to add a sustain pedal onto a different GPIO pin. I see examples like 0,0,0,0,101,102,103,104 but… what do the numbers mean ?

My vague recollection is the cvustom wiring is just about the port expander connections to rotary encoders and maybe MIDI interfaces.

The bus is pretty crowded, good luck finding your sustain connection.
Bring it in through a MIDI CC channel might avoid low level coding.
(There are those under $10 Arduino boards that do HID MIDI interfaces)

(I have not seen documentations for the different custom numbers)

Thanks Max. My GPIO bus isn’t crowded at all, though - so far I only have the power button (and its LED) plugged into it. With all those free pins available, I think it must be possible to do this without adding an extra Arduino board.

My little aluminium case has enough space for a 1/4 jack socket, but definitely not room for another board…

  • The numbers under 50 are RBPi’s GPIO pin numbers, but using the WiringPi numbering.

  • The numbers from 100 to 116 are from the GPIO expander (MCP23017) on the Zynscreen or AllInOne module (v2). This chip MUST be at I2C address 0x20. The IRQ pins can be configured from webconf.

  • You have to specify 2 pins (A & B) for each encoder (4 encoders).

  • You have to specify one pin for each switch (up to 8 switchs).

If you have a zynaptik module, another 16 extra switches are supported, but these numbers are configured internally (200-216). No configuration is needed for it.

BTW, if a pin is set to 0, it’s disable.


1 Like

Thank you !

Do you know what order the 8 switches are in ?

Is it “layer, learn, back, select, extra1, extra2, extra3, extra4” ?

If so, I think something like 0,0,9,0,2,0,0,0 would work for me.

By the way… if 0 means disabled, is it therefore impossible to use WiringPi 0 (pin 11, GPIO 17) ?

No. The right order is:

layer, back, learn, select, extra1, extra2, extra3, extra4

On official kits, pin 11 is used by the Zynscreen Touch interface, so this limitation normally doesn’t cause any problem. Anyway, you are right. It’s a “bug”, very easy to fix, but hard to deploy because it affects the configuration of many zynthians around the world. If you could live without using this pins, the better :wink:


Haha yes I will manage - thanks very much for the explanation.

I got both working. Unfortunately the long-press on select doesn’t actually do a shutdown, it goes to a UI page asking if the user really wants to shut down.

So for my headless Zynthian, it requires a long click, then a short click, to perform the shutdown.

The sustain functionality works really well.

The Zynthian sdcard image is really very impressive. Has anyone made an attempt to separate it from the OS, so that it could be installed on top of Ubuntu instead of Raspian ?

Hmm there is one problem. If I configure more than 4 switches, the web-conf UI main page has a delay of about 120 seconds before it renders.

For example, if I use

Switches Pins: 0,0,0,0,9

then my power button works nicely as a sustain pedal, but the webconf UI has a big delay only on the main page. Sub-pages are still loading at normal speed.

This is really strange. Could you open an issue on the tracking system? I will try to reproduce the problem …


I am struggling to find where the web-conf logs what it is doing. The main page displays a ‘status’ of various components and configurations. It feels like one of those status checks is taking 120 seconds, and it also feels like the web-conf UI is single-threaded.

From command line run:

journalctl -u zynthian-webconf -f


Unfortunatley nothing in the log gives me a clue:

Sep 22 09:08:40 zynthian[413]: DEBUG:root:CONFIG VAR: ZYNTHIAN_MIDI_AUBIONOTES_ENABLED=0
Sep 22 09:08:40 zynthian[413]: DEBUG:root:CONFIG VAR: ZYNTHIAN_MIDI_FINE_TUNING=440
Sep 22 09:10:42 zynthian[413]: DEBUG:root:Build info => ZynthianOS: Built on
Sep 22 09:10:42 zynthian[413]: DEBUG:root:Build info => Timestamp: 2020-09-05
Sep 22 09:10:42 zynthian[413]: DEBUG:root:Build info => Optimized: Raspberry Pi 3 Model B Plus
Sep 22 09:10:42 zynthian[413]: DEBUG:root:LV2 presets => 5
Sep 22 09:10:42 zynthian[413]: DEBUG:root:Pianoteq presets => 0
Sep 22 09:10:42 zynthian[413]: DEBUG:root:Puredata presets => 0
Sep 22 09:10:42 zynthian[413]: DEBUG:root:ZynAddSubFX presets => 0