PipeWire pulse protocol sends spec-violating subscription event
Version, Distribution, Desktop Environment:
- Version: pipewire-0.3.24-1.1
- Distribution: openSuSE Tumbleweed
Description of Problem:
vlc: ../../modules/audio_output/pulse.c:434: context_cb: Assertion `!"unreachable"' failed.
How Reproducible:
Happens every time I launch e.g. pavucontrol
while playing something in VLC.
Steps to Reproduce:
const pa_subscription_mask_t mask = PA_SUBSCRIPTION_MASK_SINK
| PA_SUBSCRIPTION_MASK_SINK_INPUT;
pa_context_set_subscribe_callback(sys->context, context_cb, aout);
op = pa_context_subscribe(sys->context, mask, NULL, NULL);
Then launch pavucontrol
.
Actual Results:
Program terminated with signal SIGABRT, Aborted.
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:49
49 return ret;
[Current thread is 1 (Thread 0x7f0c1f776640 (LWP 68990))]
Missing separate debuginfos, use: zypper install libfaad2-debuginfo-2.10.0-1.6.x86_64
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:49
#1 0x00007f0c20668864 in __GI_abort () at abort.c:79
#2 0x00007f0c20668749 in __assert_fail_base (fmt=0x7f0c207d49e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x7f0c1facf219 "!\"unreachable\"", file=0x7f0c1facf000 "../../modules/audio_output/pulse.c", line=434, function=<optimized out>) at assert.c:92
#3 0x00007f0c206779b6 in __GI___assert_fail (assertion=assertion@entry=0x7f0c1facf219 "!\"unreachable\"", file=file@entry=0x7f0c1facf000 "../../modules/audio_output/pulse.c", line=line@entry=434, function=function@entry=0x7f0c1facf6b8 <__PRETTY_FUNCTION__.22> "context_cb") at assert.c:101
#4 0x00007f0c1facca8c in context_cb (ctx=0x1201cf0, type=PA_SUBSCRIPTION_EVENT_CHANGE, idx=46, userdata=0x11f9980) at ../../modules/audio_output/pulse.c:434
#5 0x00007f0c1fa81f6f in pa_command_subscribe_event (pd=<optimized out>, command=<optimized out>, tag=<optimized out>, t=0x7f0c18002ad0, userdata=0x1201cf0) at pulse/subscribe.c:53
#6 0x00007f0c1fa0890c in pa_pdispatch_run (pd=0x7f0c18001880, packet=packet@entry=0x7f0c18008120, ancil_data=ancil_data@entry=0x7f0c18000ee8, userdata=userdata@entry=0x1201cf0) at pulsecore/pdispatch.c:346
#7 0x00007f0c1fa5e01f in pstream_packet_callback (p=<optimized out>, packet=0x7f0c18008120, ancil_data=0x7f0c18000ee8, userdata=0x1201cf0) at pulse/context.c:353
#8 0x00007f0c1fa0c9cd in do_read (p=p@entry=0x7f0c18000c50, re=re@entry=0x7f0c18000dd0) at pulsecore/pstream.c:1020
#9 0x00007f0c1fa0e53f in do_pstream_read_write (p=0x7f0c18000c50) at pulsecore/pstream.c:260
#10 0x00007f0c1fa71bf3 in dispatch_pollfds (m=0x11ec920) at pulse/mainloop.c:655
#11 pa_mainloop_dispatch (m=m@entry=0x11ec920) at pulse/mainloop.c:896
#12 0x00007f0c1fa7224e in pa_mainloop_iterate (m=m@entry=0x11ec920, block=block@entry=1, retval=retval@entry=0x0) at pulse/mainloop.c:927
#13 0x00007f0c1fa722f0 in pa_mainloop_run (m=0x11ec920, retval=0x0) at pulse/mainloop.c:942
#14 0x00007f0c1fa82159 in thread (userdata=0x11efce0) at pulse/thread-mainloop.c:101
#15 0x00007f0c1fa1e2b8 in internal_thread_func (userdata=0x11ecad0) at pulsecore/thread-posix.c:81
#16 0x00007f0c2081a299 in start_thread (arg=0x7f0c1f776640) at pthread_create.c:473
#17 0x00007f0c207423b3 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Expected Results:
static void context_cb(pa_context *ctx, pa_subscription_event_type_t type,
uint32_t idx, void *userdata)
{
audio_output_t *aout = userdata;
aout_sys_t *sys = aout->sys;
unsigned facility = type & PA_SUBSCRIPTION_EVENT_FACILITY_MASK;
type &= PA_SUBSCRIPTION_EVENT_TYPE_MASK;
switch (facility)
{
case PA_SUBSCRIPTION_EVENT_SINK:
sink_event(ctx, type, idx, userdata);
break;
case PA_SUBSCRIPTION_EVENT_SINK_INPUT:
/* only interested in our sink input */
if (sys->stream != NULL && idx == pa_stream_get_index(sys->stream))
sink_input_event(ctx, type, idx, userdata);
break;
default: /* unsubscribed facility?! */
vlc_assert_unreachable();
}
}