I built a new image today using the latest RPiOS Trixie Desktop and added support for x86_64 engines. While testing I switched to SoX as the audio backend (pipewire-alsa is installed) and tested the added engines. I had engine issues with the Linux StockfishDD which were likely due to the engine analysis. The log showed the following:
2026-04-24 10:34:38.647 WARNING engine - stop_async: engine analyser stop timed out after 1.0s - cancelling task
2026-04-24 10:34:47.632 ERROR base_events - default_exception_handler: Exception in callback Protocol.pipe_data_received()
handle: <Handle Protocol.pipe_data_received()>
Traceback (most recent call last):
File "/usr/lib/python3.13/asyncio/events.py", line 89, in _run
self._context.run(self._callback, *self._args)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/picochess/venv/lib/python3.13/site-packages/chess/engine.py", line 968, in pipe_data_received
self._line_received(line)
~~~~~~~~~~~~~~~~~~~^^^^^^
File "/opt/picochess/venv/lib/python3.13/site-packages/chess/engine.py", line 981, in _line_received
self.command._line_received(line)
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/opt/picochess/venv/lib/python3.13/site-packages/chess/engine.py", line 1294, in _line_received
self.line_received(line)
~~~~~~~~~~~~~~~~~~^^^^^^
File "/opt/picochess/venv/lib/python3.13/site-packages/chess/engine.py", line 1445, in line_received
self.result.set_result(None)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^
asyncio.exceptions.InvalidStateError: invalid state
2026-04-24 10:34:59.820 WARNING engine - _analyse_forever: engine engine not ready, analysis may fail
2026-04-24 10:35:15.648 WARNING engine - stop_async: engine analyser stop timed out after 1.0s - cancelling task
2026-04-24 10:35:15.649 ERROR engine - _engine_task: engine (playing) unexpected error during play_move: CommandState.NEW
Traceback (most recent call last):
File "/opt/picochess/uci/engine.py", line 797, in _engine_task
analysis = await self.engine.analysis(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<5 lines>...
)
^
File "/opt/picochess/venv/lib/python3.13/site-packages/chess/engine.py", line 1774, in analysis
return await self.communicate(UciAnalysisCommand)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/picochess/venv/lib/python3.13/site-packages/chess/engine.py", line 997, in communicate
self.next_command.set_finished()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/opt/picochess/venv/lib/python3.13/site-packages/chess/engine.py", line 1269, in set_finished
assert self.state in [CommandState.ACTIVE, CommandState.CANCELLING], self.state
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: CommandState.NEW
2026-04-24 10:35:15.652 ERROR picochess - think: Engine returned Exception when asked to make a move
2026-04-24 10:35:15.653 WARNING engine - handle_bestmove_0000: engine ping failed with unexpected state: CommandState.NEW
2026-04-24 10:35:16.401 ERROR picochess - process_main_events: engine crashed - game has not ended
2026-04-24 10:35:16.670 WARNING engine - _analyse_forever: engine engine not ready, analysis may fail
2026-04-24 10:35:16.670 WARNING engine - _handle_protocol_state_failure: engine continuous analysis protocol failure: AssertionError: CommandState.NEW
2026-04-24 10:35:16.670 WARNING engine - _recover_from_failed_analyser_stop: continuous analysis protocol failure: AssertionError: CommandState.NEW - restarting engine Stockfish DD 64 SSE4.2
2026-04-24 10:35:16.741 ERROR base_events - default_exception_handler: UciAnalysisCommand failed after returning preliminary result (<Future cancelled>)
protocol: <UciProtocol (pid=1861)>
transport: <_UnixSubprocessTransport pid=1861 returncode=0 stdin=<_UnixWritePipeTransport closed fd=14 closed> stdout=<_UnixReadPipeTransport closed fd=15 closed> stderr=<_UnixReadPipeTransport closed fd=24 closed>>
chess.engine.EngineTerminatedError: engine process died unexpectedly (exit code: 0)
2026-04-24 10:35:17.605 WARNING picotutor - pop_last_move: picotutor eval for next move must be done without history
2026-04-24 10:35:17.678 WARNING engine - start_analysis: start analysis requested but no engine loaded
2026-04-24 10:35:18.680 WARNING engine - start_analysis: start analysis requested but no engine loaded
I added 'Analysis = false' to stockfishdd.uci and that seemed to sort it out.
But, I've noticed that when restarting a game (I'm using no-eboard mode) I lose the sound (No "Engine Setup" or "OK") and no more move announcements. I see the same issue when using the Windows stockfish16.exe engine. I can play sound by logging in via ssh ('play /opt/picochess/talker/voices/en/christina/verygoodmove.ogg') and no errors show in the log. I'll do more testing to see if I can learn anything. I'm on master (commit 57e8f87e).
Randy