GNOME Bugzilla – Bug 93479
alsasink crashes when restarting
Last modified: 2004-12-22 21:47:04 UTC
In my playing with alsasink I came across this bug. When you set the state from GST_STATE_PLAYING to GST_STATE_READY, and then back to GST_STATE_PLAYING again, alsasink crashes. Test program attached compiling should be easy :) run it with ./program ~/some.mp3 alsasink It'll play 10 seconds of the mp3, and then stop, wait ten seconds and crash. If you change alsasink to osssink and run again, it'll play 10 seconds, wait 10 play 10 seconds, wait 10...etc until you stop it. Another error with alsasink seems to be that if you disable the timeout, it plays the whole song through without problems until near the end when it starts dumping ** (test-gst-alsa:3079): WARNING **: alsa: poll reports error. constantly. Backtrace: (4 is the event type that the event got, I added this myself) ** (test-gst-alsa:4966): WARNING **: got an event on alsasink 4 Program received signal SIGSEGV, Segmentation fault.
+ Trace 27408
Thread 1026 (LWP 4966)
Created attachment 11131 [details] simple mp3 player that demonstrates bug
More info: It's crashing in gstalsa.c: 1026 because peeked is NULL.
Attached patch fixes the problem, but I don't know if it's the right way to fix it.
Created attachment 11133 [details] [review] Fixes the problem, but is it the right fix?
It works, but you'd basically miss the first few samples of your nice audio stream, so it's not a very nice fix... I'd rather find out why peeked is NULL.
Actually, it seems to work in the test app, but in my actual app, it then just crashes after a few more buffers have ben pulled. Same line, memcpy(GST_ALSA_PAD(this->pads)->access_addr, peeked, len); except this time access_addr is NULL, and peeked isn't. ARGH.
Hm, how bitrotten is alsasink??? I don't know why it's NULL... maybe alsasink is just borked, maybe it's just alsa (crappy)... Anyway, can we consider alsasink 'broken'? ;)
Wingo did update alsasink, but AFAIK there where still bugs in it and there simply where not enough time before he left to iron out the last bugs. We need a new maintainer for this (and the jack plugins). Maybe Leif?
Re-assigning to Leif.
This error is with event handling. After the restart a DISCONTINUOUS event is emitted. GstAlsa nonetheless tries to process data it didn't get. The attached patch fixes the problem.
Created attachment 13791 [details] [review] see above
yey, it works for me
patch commited to head. closing