Is there a way to do this from an app (not looking for store approval with this).
There’s a long standing pulseaudio bug that corrupts subsequent call recordings on the Xperia X but if pulseaudio is restarted it works fine on subsequent recordings as well.
I thought I could write a basic “daemon” to just sit there in a blocking loop waiting for a call to finish/event to happen, but I have no idea how to detect that. (NOTE: if root access is required, that’s fine too, I’m not aiming for a UI app).
You can run a script in the background which listens for dbus events (no root required, no battery drain) and performs actions. The following will restart pulseaudio after a call is disconnected:
/usr/bin/dbus-monitor "type=signal, interface=org.nemomobile.voicecall.VoiceCall, path=/calls/active, member=statusChanged" |
while read -r line; do
if echo "${line}" | grep -q "string \"disconnected\""; then
killall -15 pulseaudio # systemctl --user restart pulseaudio
fi
done
This doesn’t seem to work. It never registers anything from the dbus-monitor. I’m guessing permissions/isolation level problem, or perhaps the event names don’t match up anymore.