We have been using Pidog for a while and we were happy with the product.
Following a raspberry upgrade we found that every time Pidog python scripts are started the raspberry became extraordinary slow, the ssh connection is not responding any more, Pidog is not running and after few seconds the ssh connection is lost. After some time it is possible to re-connect but the system is incredibly slow and not usable.
Using TOP on a shell bash I detected that an application connected to something related to the audio has nice set to -20. Forcing nice to -10 for that PID seems avoiding the problem and Pidog executes the correct tasks. Unfortunately this task is created every time Python starts so the workaround just works for one execution. Can you help me debug the issue and find the rootcause?
The issue you are seeing is caused by an old aplay.service that was installed by a previous version of the i2samp.sh script. This service continuously runs the following command in the background:
aplay -D default -t raw -r 44100 -c 2 -f S16_LE /dev/zero
This “zero service” was originally designed to send silent audio data to the sound card to prevent popping noises. However, its side effect is that it constantly consumes CPU.
After a Raspberry Pi OS upgrade, newer versions of PulseAudio assign real‑time scheduling (SCHED_RR) to this process, giving it the highest system priority (PR = -20, rtprio = 19). As a result, this already CPU‑hungry process starves all other processes – causing SSH disconnections, system freezes, and extreme slowness.
Solution – Remove the old services:Run the following commands to stop, disable, and delete the obsolete services:
# Stop and disable the old services
sudo systemctl stop aplay.service
sudo systemctl disable aplay.service
sudo systemctl stop auto_sound_card.service 2>/dev/null
sudo systemctl disable auto_sound_card.service 2>/dev/null
# Delete the service files
sudo rm -f /etc/systemd/system/aplay.service
sudo rm -f /etc/systemd/system/auto_sound_card.service
sudo systemctl daemon-reload
# Confirm they are removed (should show "not found")
systemctl status aplay.service
Let me know if this resolves the issue for you.
unfortunatly it didn’t work, how can I better debug this problem in your opinion?
It is possible that some old configuration files or services from a previous version were not completely removed.
Would you be willing to try a clean reinstall of the Raspberry Pi OS and then reinstall the PiDog libraries from scratch? This often resolves lingering issues that are difficult to debug otherwise.