Argon One V2 m2.sata case and Argon Remote

So I have this setup: Argon v2 m2.sata case & rpi4 & Argon IR remote and I’m running libreElec on it…

This has been discussed here before - the v2 board/case has some intermittent race condition issue between the board firmware and the linux kernel which makes a graceful shutdown via remote a lottery. A botched shutdown requires a manual restart.

My question is does the v3 m2.nvme board have the same problem or does graceful IR shutdown work there correctly and every time?

Thx cam

By the way:

Do you have a better experience (minimized count of issues) if you use v1.1.4 with the additional provided rpi-tools addon 12.0.0.1/12.80.1.1 from here?

Or does the problem still exist very often with that as well?

I updated to LE 12.0.1 and installed argon40 device v1.1.5 (released today) but the latest rpi-tools for me come up as 12.0.0.0.

I will check this out now, thanks

Please search for the rpi-tools 12.0.0.1 (virtual.rpi-tools-12.0.0.1.zip) below ‘Assets’ of the v1.1.4 version. These rpi-tools additional packages are suitable for 12.0.x(LE12)/12.80.x(LE13).

I have not attached these files additionally to 1.1.5, because there are already 2 pull requests in the queue to integrate the required gpiod library into the official provided packages. The only difference is that it was decided to move it to the system-tools addon to make gpiod immediately available for all platforms.

Until then, I recommend to install the rpi-tools package 12.0.0.1 to have gpiod for full comfort with short shutdown times - especially in your case with the power off via remote control.

thank you very much H

1 Like

Hey on a sidenote if its not too much trouble and since I have you :wink:

The problem was described as a race condition elsewhere but the symptoms I’m seeing aren’t really in line with that.

Basically when all is good pressing the power button will start immediate shutdown (no Kodi powerdown/reboot dialog) and that always seems to succeed and I can power up the RPI4 again with the IR no problem…
When all is not good pressing the IR power button brings up the Kodi reboot/shutdown dialog. I can shut down by conforming and it sort of does shut down but leaves the red LED on.
Once in that state the RPI4 remains unresponsive and must be restarted by pulling power.

So that doesnt really look like a race condition. More like the board firmware doesnt capture, process and propagate the power down event any more. The IR event clearly still reaches Kodi. :man_shrugging:

I don’t know if I can explain it properly in fewer words.

A power button press (more than 3 seconds but shorter than 5 seconds) or an power off signal via the remote control do the same:

  • initiate a timed shutdown immediately. This will happens without any software at operating system level or KODI. It’s programmed in the MCU firmware. This process gives a limit of 10 seconds until the power to the RPi4 will be cut and the LED goes off (no power :wink:)
  • this happens ever, independing if the KODI addon or other service exists

Parallel to that started timeout of 10 seconds, the MCU usually signals to the RPi4 via GPIO pin, that a hard shutdown is initiated. This is the signal which the KODI addon or an alternative service tries to listen for and inform KODI to shutdown properly. Now the time ticks and KODI must stop all running threads before the 10 seconds are timed out. Please note the operating system must also do some things during shut down like unmounting local storages or network file systems.

This is the reason to use v1.1.4/1.1.5 with gpiod, to ensure KODI have a chance to do that in time.

One of the technical problems is, the MCU should normally not cut the power after 10 seconds. Instead it should wait until the pin of UART is going down and extend the timeout until then. Because I doesn’t have an oscilloscope I can’t 100 percent be sure, that the pin not accidentally flaps and irritates the MCU. At software site it looks like all things are right, but firmware or hardware bug at RPi4 could also be a cause.

It seems that sometimes the MCU does not recognize that the UART pin has dropped and then the LED stays on because the RPi4 has not been disconnected from power. Additionally, you can get the MCU into trouble if you use the i2cdump command or another process sends a specific/critical command to the MCU via I2C.

If you skip the hardware button option (means especially the power button of the remote control as well) and navigate via cursor to the power menu of KODI, using the command line or something else to inform LE about a shut down, another workflow is starting.

This works only if the addon is working right or an alternative services do the right things. The MCU must be informed that it should cut off the power, because it doesn’t know about that operating system event. The addon installs a shutdown script which is in use as long the KODI process is running. If you stopped KODI via systemctl before it’s possible that it skipped - but this is not the normal use case of LE I think.

The shutdown script informs the MCU via I2C to cut the power after the UART pin is falling down. Like mentioned above the 10 second limit starts just at the moment as the shutdown script is called and MCU starts to observe the UART pin. This is later in the shutdown process and therefore more controllable by software than the hardware button events.
Possible technical issues: The MCU isn’t available via I2C at this time or the UART pin is accidentally floating afterwards. Then the power cut will not work properly and the LED may light up.

At my installation I could reproduce in the past, that the MCU isn’t available during shutdown if the MCU was going stuck because of i2cdump usage or if the shutdown was already initiated via the hardware events. But since version 0.0.12a it shouldn’t be a generic issue of the addon themself anymore. Recently I could identifiy that the default available Python modules for the GPIO control in LE12+ was the root cause for an additional race condition. If the addon can not switch to the gpiod module, KODI will take 30 seconds to kill the python thread of the addon (because of a bug in the used default modules), so the via hardware button events intiated 10 second limit in the MCU is exceeded every time.

Regarding the IR signal:

It’s received by 2 components at the same time. The MCU is connected in parallel to the IR receiver to be able to detect everytime the “power button” sequence of the remote control. The second component is gpio-ir driver at pin 23 of the RPi4 if enabled in config.txt.
If the “power sequence” is catched by the observing addon thread fast enough, than you shouldn’t have the opportunity to navigate in KODI afterwards. Usually you should get only a freezed screen with a wheel/or not or grayed out power off dialog. If that fail/is disturbed because of any kind of possible issue (the addon isn’t installed, maybe a self configured lirc settings, the addon thread crashed or was killed in background) you can navigate further until the power cut is executed after the round about 10 second limit.

1 Like