Summary: | module-match asserts on channels=0 | ||
---|---|---|---|
Product: | PulseAudio | Reporter: | Jussi Kukkonen [inactive] <jussi.kukkonen> |
Component: | modules | Assignee: | pulseaudio-bugs |
Status: | RESOLVED FIXED | QA Contact: | pulseaudio-bugs |
Severity: | normal | ||
Priority: | medium | CC: | lennart |
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | Fix candidate |
Description
Jussi Kukkonen [inactive]
2012-09-20 10:07:35 UTC
Oh, this is on pulseaudio 2.0 (wouldn't have just filed this but I thought I was running latest release...) Had some debugging help... It looks like gstreamer does something weird and pulseaudio decides to assert because of that. If I use paplay everything works, but gstreamer using apps will assert PA with module-match. Here's a pa_sink_input_new_data* in pa_sink_input_new() -- notice how the sample_spec is just empty, e.g. sample_spec.channels = 0: Breakpoint 1, pa_sink_input_new (_i=_i@entry=0x7fffb2fd4508, core=0x21ea130, data=data@entry=0x7fffb2fd4680) at pulsecore/sink-input.c:239 239 pulsecore/sink-input.c: No such file or directory. (gdb) print *data $1 = {flags = PA_SINK_INPUT_START_CORKED, proplist = 0x2208780, driver = 0x7f681ee55920 "pulsecore/protocol-native.c", module = 0x2272550, client = 0x2204350, sink = 0x0, origin_sink = 0x0, resample_method = PA_RESAMPLER_INVALID, sync_base = 0x0, sample_spec = {format = PA_SAMPLE_U8, rate = 0, channels = 0 '\000'}, channel_map = {channels = 0 '\000', map = { PA_CHANNEL_POSITION_MONO <repeats 32 times>}}, format = 0x0, req_formats = 0x2200e80, nego_formats = 0x0, volume = {channels = 0 '\000', values = {0 <repeats 32 times>}}, volume_factor = {channels = 0 '\000', values = { 0 <repeats 32 times>}}, volume_factor_sink = {channels = 0 '\000', values = {0 <repeats 32 times>}}, muted = false, sample_spec_is_set = false, channel_map_is_set = false, volume_is_set = false, volume_factor_is_set = false, volume_factor_sink_is_set = false, muted_is_set = false, volume_is_absolute = false, volume_writable = true, save_sink = false, save_volume = false, save_muted = false} I don't think PA should assert when this happens. I couldn't reproduce this, but the information posted so far is enough to find the error. module-match uses the SINK_INPUT_NEW hook, and then relies on the sample spec being properly initialized. This is clearly wrong: if the sink input uses the FIX_CHANNELS flag, the number of channels will be unknown until the sink input has been routed to some sink. In your case the FIX_CHANNELS flag is not being used. I'm not sure if there's some other bug involved in your case (I wouldn't be surprised), but fixing module-match should make things work for you. If the fix doesn't turn out to be hard to do, I'll post a patch soon. Created attachment 67767 [details] [review] Fix candidate Does this patch fix the problem for you? (In reply to comment #4) > Created attachment 67767 [details] [review] [review] > Fix candidate > > Does this patch fix the problem for you? It does. No asserts and seems to work as expected. Thanks. Although I did not test at the same time with stream-restore... Is this bound to break the functionality refered in this comment: /* hook EARLY - 1, to match before stream-restore */ (I'm not familiar with the internals so maybe that makes no sense) This patch actually makes the comment correct :) I think earlier module-stream-restore used the NEW hook too, and the comment was written at that time. Then module-stream-restore was changed to use the FIXATE hook, possibly to fix a bug similar to this, so the comment became outdated. Now the comment is relevant again, because the two modules use the same hook. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.