Fix dance-loop tremor (set_target) and raspotify restart lockup (#1130)
Fixes the two issues reported in pollen-robotics/reachy_mini#1130.
1. Dance-loop tremor โ use set_target instead of goto_target
SpotifyDancer.run called reachy_mini.goto_target(..., duration=0.1, method="minjerk") every 50 ms (~20 Hz). goto_target starts a fresh min-jerk profile from zero velocity and blocks on wait_for_task_completion, so restarting it ~20x/s produces continuous head/antenna tremor independent of the music. Switched to set_target, the documented call for control loops >=10 Hz (AGENTS.md). Also added a small RMS deadzone (rms < 0.02 -> neutral pose) so the robot stays still during silence instead of reacting to numeric noise.
2. ALSA โ don't restart raspotify when the config is unchanged
check_and_fix_alsa_config() rewrote /etc/asound.conf and ran systemctl restart raspotify whenever the aplay probe failed. But that probe can fail transiently precisely because the audio analyzer is holding the loopback_in capture, while the on-disk config is already correct. Restarting raspotify in that state wedges ALSA in an EINVAL "Slave PCM not usable" state until reboot. Added an idempotency guard: compare the generated config against the existing file and skip both the rewrite and the restart when they are byte-identical.
Both fixes have been running on a Reachy Mini Wireless (ReachyMiniOS 0.2.3): tremor is gone and the loopback lockup no longer triggers on app restart.
Hi Mickael, this is much appreciated, reminds me that I need to find some free time to breath some life Into this little fellow.
Greets
Jee