rpi: Improve and fix a bug in RPI audio reconfiguration

Fixes #2038