Zynthian doesn't shutdown properly

Still the same problem after update via web-ui

 ##########################       ----------------------------------------
#                          #      ZynthianOS: Built on os.zynthian.org
#            ##            #      Timestamp: 2020-05-27
#      ##   #  #   ##      #      Optimized: Raspberry Pi 3 Model B Plus
#     #  #  #  #  #  #     #      ----------------------------------------
###   #  #  #  #  #  #   ###      Kit:           V1
#  #  #  #  #  #  #  #  #  #      Display:       PiTFT 2.8 Resistive
#   ##   #  #  #  #   ##   #      Soundcard:     HifiBerry DAC+
#         ##    ##         #      Wiring Layout: PROTOTYPE-4
#                          #      ----------------------------------------
 ##########################
                                  zynthian-ui: master (ae6fb3)
                                  zynthian-webconf: master (45bcb0)
                                  zyncoder: master (ef24e0)
                                  zynthian-sys: master (6d9366)
                                  zynthian-data: master (336ead)
                                  ---------------------------------------

Linux zynthian 4.19.97-v7+ #1294 SMP Thu Jan 30 13:15:58 GMT 2020 armv7l

What is the command/script preformed when clicking on “YES” ?

Zynthian UI is run from a BASH script which monitors its exit status. If the exit status is 0 then the BASH scripts runs the poweroff command. If you are able to run poweroff successfully from the command line it suggests that zynthian is either not exiting or is returning a different exit value.

poweroff is working from comand line.

Try this:

systemctl stop zynthian
cd /zynthian/zynthian-ui
X :0 & DISPLAY=:0 ./zynthian_gui.py ; echo "EXIT CODE: $?" ; killall Xorg 

Within Zynthian UI try to shutdown then see what is printed at the command line.

After executing your commands the ui doesn’t restart:
ERROR: PatternManager failed to open file for load /zynthian/zynthian-my-data/sequences/patterns.zynseq

In the meantime I enabled rsyslog. Maybe i will have more informations.

That error may be ignored and is removed from the development branch (soon to be merged).

here is what the log say:

Feb 16 13:02:42 zynthian startx[451]: zynseq exit
Feb 16 13:02:42 zynthian systemd[1]: systemd-rfkill.socket: Succeeded.
Feb 16 13:02:42 zynthian systemd[1]: Closed Load/Save RF Kill Switch Status /dev/rfkill Watch.
Feb 16 13:02:42 zynthian systemd[1]: Stopped target Graphical Interface.
Feb 16 13:02:42 zynthian systemd[1]: Stopped target Multi-User System.
Feb 16 13:02:42 zynthian systemd[1]: rpi-eeprom-update.service: Succeeded.
Feb 16 13:02:42 zynthian systemd[1]: Stopped Check for Raspberry Pi EEPROM updates.
Feb 16 13:02:42 zynthian systemd[1]: Stopping rng-tools.service...
Feb 16 13:02:42 zynthian systemd[1]: Stopped target Sound Card.
Feb 16 13:02:42 zynthian rngd[355]: stats: bits received from HRNG source: 60064
Feb 16 13:02:42 zynthian rngd[355]: stats: bits sent to kernel pool: 6144
Feb 16 13:02:42 zynthian systemd[1]: Stopping Turn on/off Screen Backlight...
Feb 16 13:02:42 zynthian rngd[355]: stats: entropy added to kernel pool: 6144
Feb 16 13:02:42 zynthian a2jmidid[510]: Bridge stopping...
Feb 16 13:02:42 zynthian rngd[355]: stats: FIPS 140-2 successes: 3
Feb 16 13:02:42 zynthian sh[1217]: /bin/sh: 1: cannot create /sys/class/backlight/*/bl_power: Directory nonexistent
Feb 16 13:02:42 zynthian systemd[1]: Stopping Alsa to Jack Bridge...
Feb 16 13:02:42 zynthian rngd[355]: stats: FIPS 140-2 failures: 0
Feb 16 13:02:42 zynthian systemd[1]: Stopping Zynthian User Interface...
Feb 16 13:02:42 zynthian rngd[355]: stats: FIPS 140-2(2001-10-10) Monobit: 0
Feb 16 13:02:42 zynthian rngd[355]: stats: FIPS 140-2(2001-10-10) Poker: 0
Feb 16 13:02:42 zynthian rngd[355]: stats: FIPS 140-2(2001-10-10) Runs: 0
Feb 16 13:02:42 zynthian rngd[355]: stats: FIPS 140-2(2001-10-10) Long run: 0
Feb 16 13:02:42 zynthian systemd[1]: Stopping Zynthian Webconf...
Feb 16 13:02:42 zynthian rngd[355]: stats: FIPS 140-2(2001-10-10) Continuous run: 0
Feb 16 13:02:42 zynthian rngd[355]: stats: HRNG source speed: (min=525.613; avg=613.663; max=732.385)Kibits/s
Feb 16 13:02:42 zynthian rngd[355]: stats: FIPS tests speed: (min=6.149; avg=6.582; max=6.851)Mibits/s
Feb 16 13:02:42 zynthian rngd[355]: stats: Lowest ready-buffers level: 2
Feb 16 13:02:42 zynthian systemd[1]: Stopped target Login Prompts.
Feb 16 13:02:42 zynthian rngd[355]: stats: Entropy starvations: 0
Feb 16 13:02:42 zynthian rngd[355]: stats: Time spent starving for entropy: (min=0; avg=0.000; max=0)us
Feb 16 13:02:42 zynthian rngd[355]: Exiting...
Feb 16 13:02:42 zynthian systemd[1]: Stopping QMidiNet Service...
Feb 16 13:02:42 zynthian systemd[1]: Stopping MOD ttymidi...
Feb 16 13:02:42 zynthian killall[1218]: zynthian_gui.py: no process found
Feb 16 13:02:42 zynthian systemd[1]: Stopping dphys-swapfile - set up, mount/unmount, and delete a swap file...
Feb 16 13:02:59 zynthian systemd-modules-load[102]: Inserted module 'i2c_dev'

It seems to stop properly except these two lines maybe:

zynthian sh[1217]: /bin/sh: 1: cannot create /sys/class/backlight/*/bl_power: Directory nonexistent
zynthian killall[1218]: zynthian_gui.py: no process found

Apparently the system is mostly stopped anyway. I think I can unplug the power without damaging the sdcard.

It will be good to resolve this though…

Will you describe the steps you took to get your device to this state? What image did you flash and how? What updates did you apply, etc.

Hi @Djeremaille !

I see you are running an older SD image and updates can cause problems with it. Also, i remember to have the same problem you have with older SD images. I strongly encourage you to try the latest stable SD image:

https://os.zynthian.org/2020-09-05-zynthianos-buster-lite-armhf-1.0.0-RC3.zip

Regards!

Thanks @jofemodo . I am downloading the latest stable image at the moment. Is this the same as the 1.0.0-RC3?

Apparently not. I will download the RC3

Edit: Yes It is the same md5

Fresh flash. No updates. Just changed from v4 to v1 in the web-ui then rebooted.
Screen and encoders are working.
Long press button 4. Press Yes. Raspberry hang on the zynthian screen and don’t power off.
Maybe I have a wiring problem. I have to check that.
I give up for the moment…

Do you let go of the long press?

Yes I do

I love the Zynthians Kit 4.5. But what really annoys me: It very often does not shutdown/powerOff. At Zynthian Splash screen it shows: Error, ip: .

and goes back to gui. What can I do? Thanks for any hints…

P.S.: It is the last stable Image, downloaded November 2021

Hi @Lumm !

You should open an issue on the issue tracker:

Try to give all the needed information. If we can’t reproduce the error, we can’t solve it.
Also, you should try with the testing branch (perhaps using a separated SD card) tyo see if the issue is already solved.

Thanks!

FWIW, I’ve got the same issue on testing (updated yesterday). Stable is fine. I’ve created an issue here: Bug: Zynthian sometimes crashes when attempting to power off · Issue #633 · zynthian/zynthian-issue-tracking · GitHub together with a couple of additional observations. (Short story: it seems related to the number of layers in the current configuration, but there is no set limit (like, if it were to happen only with three layers or more), but for a given snapshot, it seems to happen consistently on each shutdown).

1 Like

I think I have the same issue like described here on this topic. I added 5 layers and tried this configuration multiple times and everytime I ended up with this shutdown error. There seems to be something wrong with saving and restoring snapshots. Some information I wrote down in this topic Multiple layers + external midi controller + stage piano? - #29 by pianissimo
Unfortunately at this moment I have not the time to trace a little deeper (check midi , audio routing, logs) on this bug. But hopefully now there is some information available. @ricard thank you for registering this bug. Is this a high prio bug? Because I think backup and restoring configuration should be something to take special care on it.

@jofemodo recently merged a fix I devised for the shutdown issue (Fix closing crash by polluxsynth · Pull Request #428 · zynthian/zynthian-ui · GitHub) on testing.

EDIT: I don’t think it will fix your problem @pianissimo because the bug I’ve described here only seems to occur when actually shutting down the UI. But if nothing else, it may help diagnose the problem, as one of the changes on the testing branch involves printing out the exit code from the Zynthian application on the error screen when it crashes, which can be helpful in getting some insight as to why the application crashes.