Bug 294366 - phonon does not report finished state right after the end of a sound
Summary: phonon does not report finished state right after the end of a sound
Status: RESOLVED FIXED
Alias: None
Product: phonon-backend-gstreamer
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 4.6
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 4.6.1
Assignee: Harald Sitter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-18 14:55 UTC by solsTiCe
Modified: 2012-02-19 21:31 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.6.1


Attachments
debug output of my program running phonon 4.5.1 (25.79 KB, text/x-log)
2012-02-19 12:04 UTC, solsTiCe
Details
debug output on my prog running phonon 4.6 (6.72 KB, text/x-log)
2012-02-19 12:07 UTC, solsTiCe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description solsTiCe 2012-02-18 14:55:01 UTC
Version:           4.6
OS:                Linux

I have a little app that use pyqt and phonon to play wav file generated by espeak
the sound are played sequentially with a pause between each sound

now with latest version of phonon (I don't know where it started), the sound is played but the finished state or changed state of the player object (from Phonon.createPlayer or even Phonon.MediaObject connected to a Phonon.AuioOutput) is reported at least 3 seconds after the sound ends playing.

this obviously completly brake my app.

I filled this against phonon-gstreamer because I tried phonon-vlc backend where there is no such problem. It's even worse with phonon-vlc because sound are not played until their end but cut before. It lacks like 500ms or less but it's easily heard.

I don't use KDE.

Reproducible: Always

Steps to Reproduce:
I am only experiencing this with my software. I don't run KDE so the only way to reproduce is to run my sft at
http://www.sorobanexam.org/static/data/mentalcalculation-0.3.5.1.tar.gz

Actual Results:  
3 seconds delay means the numver stays 3 seconds when it should vanished after espeak has " pronounced" the sound

Expected Results:  
the number disapear right away after the sound is played meaning the finished or changed state is signaled right after the sound ends
Comment 1 solsTiCe 2012-02-18 15:32:22 UTC
It is definitvly working with phonon 4.5.1 and phonon-gstreamer 4.5.1

so something broke in 4.6.0

may be it's in phonon and not the backend. I have no idea
Comment 2 Harald Sitter 2012-02-19 01:32:23 UTC
Well, in Phonon 4.6 (at least I think it we did the change in 4.6) signals are queued in the main event loop, i.e. if you hog the event loop the state change will arrive much later, and 3 seconds sounds like exactly that is happening.

at any rate a debug log would be nice
http://techbase.kde.org/Development/Tutorials/Debugging/Phonon


also just as a reminder for ourselves, the fact that vlc truncates the sound might be an indication that the input file itself is not 'proper'. which would actually conveniently explain the problem.
Comment 3 solsTiCe 2012-02-19 12:04:58 UTC
Created attachment 68927 [details]
debug output of my program running phonon 4.5.1
Comment 4 solsTiCe 2012-02-19 12:07:58 UTC
Created attachment 68928 [details]
debug output on my prog running phonon 4.6
Comment 5 solsTiCe 2012-02-19 12:10:19 UTC
I can't get any verbose output with phonon 4.6. It works with phonon 4.5.1
PHONON_GST_GST_DEBUG st to 8 changes nothing !

You don't need any info as you confirm yourself the bug, do you ?
And you don't see this as a bug ?

this breaks Qt/Phonon API, right ?
Comment 6 Myriam Schweingruber 2012-02-19 12:15:40 UTC
No, he didn't confirm. Anyway, thanks for the feedback.
Comment 7 Harald Sitter 2012-02-19 20:48:33 UTC
I cannot reproduce the bug because your app refuses to output any output for me unfortunately.

Anyhow, your 4.6 seems to be compiled with debug off, please recompile with debug on and get a new log.
Comment 8 Torrie Fischer 2012-02-19 21:30:41 UTC
Git commit 9a26f7df9d0c5147d6918d1e24a7ba861c57528f by Trever Fischer.
Committed on 19/02/2012 at 22:27.
Pushed by tdfischer into branch 'master'.

Wake up our condition variable if we finish within three seconds, which would otherwise hold up emission of finished()
FIXED-IN:4.6.1

M  +1    -0    gstreamer/mediaobject.cpp

http://commits.kde.org/phonon-gstreamer/9a26f7df9d0c5147d6918d1e24a7ba861c57528f
Comment 9 Torrie Fischer 2012-02-19 21:31:15 UTC
Git commit e79d309b1e42a365ab973e562a62c334dec265c1 by Trever Fischer.
Committed on 19/02/2012 at 22:27.
Pushed by tdfischer into branch '4.6'.

Wake up our condition variable if we finish within three seconds, which would otherwise hold up emission of finished()
FIXED-IN:4.6.1

M  +1    -0    gstreamer/mediaobject.cpp

http://commits.kde.org/phonon-gstreamer/e79d309b1e42a365ab973e562a62c334dec265c1