Zynthian development environment setup

One of my new years goals is to contribute something to Zynthian development :sweat_smile:

Currently I have 2 options on my mind:

  1. Remote debugging via VS Code on “bare metal” installation on RPi4
    It should work on any OS, so it is the first way that I’ve thought of.
  2. Dockerized Zynthian image (I doubt that it already exist)
    This is very tricky, as it would require to run some audio server that may enable audio routing from Docker image to OS of the host. And I even don’t know if e.g. Pulse Audio client may be wired up to existing Zynthian configuration.

I’ve seen Zynthian Emulator Setup for Development - ZynthianWiki and Zynthian Emulator - ZynthianWiki but if I’m not wrong it works only on Linux hosts and unfortunately my daily OS is Windows 10. So some viable alternative would be ideal.

Could you recommend some other development environment setup for my use-case?

1 Like

Hi @multim!

Years ago, i used to develop for zynthian on my linux desktop using the “emulator”, but as the project got more complex, it becames more difficult to keep working a reliable development environment on desktop and i ended developing directly on RBPi.

The true is that there are too many dependencies with the “real machine” and you always need to test changes on a real zynthian, so i realized it’s better to improve my development workflow having a “real zynthian” aside my desktop computer.

My setup is really simple:

  • A working zynthian machine connected to my local network
  • My linux desktop computer connected to my local network

I work with a local copy of the repositories on my desktop and make the changes with my favorite text editor (Kate), copy the files to the zynthian machine (grsync is really useful here) and test the changes on the zynthian machine (the terminal is my best friend here).
When new code is tested, i commit the changes and test the “update process” to close the loop.

This is my workflow, but other developers probably have their own way.

Anyway, if you really want to work on a “desktop development environment”, you are very welcome. Feel free to work on it and please, share your advances.

Best regards!

1 Like

Maybe take a look at systemd-nspawn with binfmt

https://blog.oddbit.com/post/2016-02-07-systemd-nspawn-for-fun-and-wel/

Oh, didn’t see the bit about windows 10. Install VirtualBox and run a vm.

Or use wsl.

Running Zynthian on VirtualBox is something I may consider.

And I really doubt that on WSL I can get any working audio routing, also zyntian emulator most probably will crash there.

I also use a real Zynthian, or at least a Raspberry Pi for most development. Contrary to @jofemodo I tend to work on the files on the actual RPi via ssh, e.g. using vi or via VNC running Code::Blocks IDE. I test then commit and push to GitHub directly on the RPi. I use a Windows 10 laptop with built-in SSH command line client and Edge browser to access Zynthian’s noVNC. I sometimes use a Bodhi Linux netbook instead of the Windows 10 laptop. I tried using VSCode with its SSH plugin but that kills the RPi due to horrible memory usage (and leakage) in its C++ plugin.

1 Like

You wont be able to run Zynthian on Virtualbox as Virtualbox is a hypervisor, not a cpu emulator. You could run Ubuntu or Fedora on Virtualbox and use those to emulate arm code though.

The most confusing lscpu output I’ve seen in a long time.

This is the Zynthian webconfig from the 2021-09-25 image running in a systemd-nspawn container. Set up with the instructions above on Fedora. systemd isn’t a thing so you have to hand start a bunch of stuff after setting some environment variables.

Also, you don’t get a soundcard…

I’ve done the remote vscode debugging properly

Debugging python code on zynthian from a computer with remote vscode

2 Likes

I’ve just added this…

https://wiki.zynthian.org/index.php/Zynthian_Webconf_debug_with_Visual_Studio_Code_(VSC)

Not quite finished as I have to get something to eat. . .

2 Likes