Don't crash after PulseAudio restarts
If PulseAudio daemon gets restarted, wys then crashes when trying to set up call audio afterwards:
wys[5337]: Assertion 'o' failed at pulse/operation.c:67, function pa_operation_unref(). Aborting.
#0 0x0000ffffa9065714 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x0000ffffa90538e8 in __GI_abort () at abort.c:79
#2 0x0000ffffa91dfed0 in pa_operation_unref () at /lib/aarch64-linux-gnu/libpulse.so.0
#3 0x0000ffffa9457d0c in g_cclosure_marshal_VOID__BOOLEANv () at /lib/aarch64-linux-gnu/libgobject-2.0.so.0
#4 0x0000ffffa9455c5c in () at /lib/aarch64-linux-gnu/libgobject-2.0.so.0
#5 0x0000ffffa9472690 in g_signal_emit_valist () at /lib/aarch64-linux-gnu/libgobject-2.0.so.0
#6 0x0000ffffa9472ffc in g_signal_emit_by_name () at /lib/aarch64-linux-gnu/libgobject-2.0.so.0
#7 0x0000aaaab5a44b1c in update_direction_state
(self=0xffff8c012440, mm_call=0xffff880121c0, path=0xaaaad6d3d3c0 "/org/freedesktop/ModemManager1/Call/1", direction=WYS_DIRECTION_FROM_NETWORK, old_state=<optimized out>, new_state=<optimized out>)
at ../src/wys-modem.c:151
#8 0x0000aaaab5a44c9c in call_state_changed_cb (mm_gdbus_call=<optimized out>, old_state=MM_CALL_STATE_DIALING, new_state=MM_CALL_STATE_RINGING_OUT, reason=<optimized out>, self=0xffff8c012440)
at ../src/wys-modem.c:183
#9 0x0000ffffa8ed0dcc in ffi_call_SYSV () at /lib/aarch64-linux-gnu/libffi.so.6
#10 0x0000ffffa8ed16f4 in ffi_call () at /lib/aarch64-linux-gnu/libffi.so.6
#11 0x0000ffffa9456338 in g_cclosure_marshal_generic () at /lib/aarch64-linux-gnu/libgobject-2.0.so.0
#12 0x0000ffffa94559f8 in g_closure_invoke () at /lib/aarch64-linux-gnu/libgobject-2.0.so.0
#13 0x0000ffffa946a2b8 in () at /lib/aarch64-linux-gnu/libgobject-2.0.so.0
#14 0x0000ffffa94718c0 in g_signal_emitv () at /lib/aarch64-linux-gnu/libgobject-2.0.so.0
#15 0x0000ffffa928da04 in () at /lib/aarch64-linux-gnu/libmm-glib.so.0
#16 0x0000ffffa8ed0dcc in ffi_call_SYSV () at /lib/aarch64-linux-gnu/libffi.so.6
#17 0x0000ffffa8ed16f4 in ffi_call () at /lib/aarch64-linux-gnu/libffi.so.6
#18 0x0000ffffa9456224 in g_cclosure_marshal_generic () at /lib/aarch64-linux-gnu/libgobject-2.0.so.0
#19 0x0000ffffa94559f8 in g_closure_invoke () at /lib/aarch64-linux-gnu/libgobject-2.0.so.0
#20 0x0000ffffa9469b30 in () at /lib/aarch64-linux-gnu/libgobject-2.0.so.0
#21 0x0000ffffa947262c in g_signal_emit_valist () at /lib/aarch64-linux-gnu/libgobject-2.0.so.0
#22 0x0000ffffa9472b98 in g_signal_emit () at /lib/aarch64-linux-gnu/libgobject-2.0.so.0
#23 0x0000ffffa95bfa00 in () at /lib/aarch64-linux-gnu/libgio-2.0.so.0
#24 0x0000ffffa95ad658 in () at /lib/aarch64-linux-gnu/libgio-2.0.so.0
#25 0x0000ffffa936151c in g_main_context_dispatch () at /lib/aarch64-linux-gnu/libglib-2.0.so.0
#26 0x0000ffffa93618e8 in () at /lib/aarch64-linux-gnu/libglib-2.0.so.0
#27 0x0000ffffa9361c80 in g_main_loop_run () at /lib/aarch64-linux-gnu/libglib-2.0.so.0
#28 0x0000aaaab5a439ec in run (modem=<optimized out>) at ../src/main.c:363
#29 0x0000aaaab5a439ec in main (argc=<optimized out>, argv=<optimized out>) at ../src/main.c:642
wys gets restarted by systemd automatically and then manages to set up call audio just fine, so it's not very visible for the user, but we shouldn't crash nevertheless.
Edited by Sebastian Krzyszkowiak