Running the debugger without restarting X11

Has anyone worked out a way to run in debug mode without restarting the X server every launch? It really slows down development.

Currently I’m running:

systemctl stop zynthian
X -s 0
< launch debugger>

I got those instructions from the wiki.

Every time I restart the debugger I need to manually kill and restart X11.

Thank you!

1 Like

Add an ampersand to the end which runs the application in the background, e.g. X -r -s 0 &.

1 Like

I should have been more clear with my description. Backgrounding the process isn’t going to help me here.

Here’s what I’m doing for development.

# ssh'ed into zynthian.local
systemctl stop zynthian
X -r -s 0 

From a vscode instance I’m launching the debug version of zynthian, this launches in a new terminal.

   {
           "name": "Zynthian Debug",
           "type": "debugpy",
           "request": "launch",
           "program": "zynthian_main.py",
           "python": "/zynthian/venv/bin/python3",
           "console": "integratedTerminal",
           "justMyCode": true,
           "subProcess": true,
           "env": {
               "DISPLAY": ":0",
               "ZYNTHIAN_LOG_LEVEL": "10"
           }
       }

I would then press some buttons on my midi driver to test it. Make some edits and want to restart the process to test again.

To restart the debugging session after changing code I need to:

  1. stop the debugging process
  2. go back to the previous terminal and kill X
  3. restart X11
  4. re launch the zynthian debugger.

So that’s what I’m trying to avoid. Ideally zynthian should be able to re-connect to the same x11 server every time rather than having to reset x11.

1 Like

I’m not sure what your doing different to me. I use vscode on a laptop with it connected to the zynthian via SSH plugin. I tend to stay X in the vscode terminal but it also works from a separate ssh session, with the display set, e.g. DISPLAY=:0 X -r -s 0&. I start the debugger in vscode with the F5 key and access zynthian via VNC. I stop the debugger with the stop icon in vscode and start it again without issue.

The physical display can become blank. This can usually be fixed by running, powersave_control.sh off because there is a background task that blanks the display which can kick in and does not get reset by the python code.

2 Likes