bugGnash - The GNU Flash player - Bugs: bug #23275, Sound.loadSound does not play

 
 

bug #23275: Sound.loadSound does not play

Submitter:  Johan Euphrosine <proppy>
Submitted:  Sat 17 May 2008 12:10:53 PM UTC
   
 
Category:  sound Severity:  4 - Important
Release:  None Status:  Fixed
Privacy:  Public Assigned to:  strk
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sat 15 Nov 2008 10:14:28 AM UTC, comment #20: 

Thanks a lot for addressing this issue.

I just tested successfully to play http://proppy.aminche.com/soundswiff/pokerSounds.swf with gnash trunk:
proppy@pain ~/Desktop/proppy/gnash-trunk $ ./gui/gnash -v http://proppy.aminche.com/soundswiff/pokerSounds.swf
RcInitFile: couldn't open file: /usr/local/etc/gnashrc
RcInitFile: couldn't open file: /home/proppy/.gnashrc
12925:3061999392] 11:12:13 ERROR: Couldn't find pixmap file: GnashG.png

* (lt-gtk-gnash:12925): WARNING *: Couldn't find pixmap file: GnashG.png
12925:3061999392] 11:12:13 SECURITY: Checking security of URL 'http://proppy.aminche.com/soundswiff/pokerSounds.swf'
12925:3061999392] 11:12:13 SECURITY: Load from host proppy.aminche.com granted (default)
12925:3061999392] 11:12:14 SECURITY: Checking security of URL 'http://proppy.aminche.com/soundswiff/player_arrive.mp3'
12925:3061999392] 11:12:14 SECURITY: Load from host proppy.aminche.com granted (default)
12925:3061999392] 11:12:14 ERROR: The best available resampler is 'audioresample'. Please install gstreamer-ffmpeg 0.10.4 or newer, or you may experience long delays in audio playback!
12925:3060964240] 11:12:14 ERROR: No samples decoded from input of 137256464 bytes
p

Johan Euphrosine <proppy>
Thu 13 Nov 2008 09:49:26 AM UTC, comment #19: 

Inlined instructions in the wiki page
http://wiki.gnashdev.org/MiscMingAll as strk advised on #gnash
irc.

Johan Euphrosine <proppy>
Thu 13 Nov 2008 09:21:49 AM UTC, comment #18: 
Johan Euphrosine <proppy>
Thu 13 Nov 2008 04:52:53 AM UTC, comment #17: 

proppy - could you please update wiki link for ming test documentation , that is, step by step introduction to start writing TestCase using MiscMingAll:
http://proppy.aminche.com/gnash/gnash.html#%5B ...lots of HTML escaped gibberish

Tonko Juricic <tonko>
Wed 29 Oct 2008 04:23:48 PM UTC, comment #16: 

Committed the sound completed probe patch improved to also dispatch the onSoundComplete.
Mind you: this only works for dynamically loaded sounds (both streaming and event atm). Poker sound is one of these cases.


Committed revision 10193.

Sandro Santilli <strk>
Group Member
Wed 29 Oct 2008 09:31:49 AM UTC, comment #15: 

The poll-for-completed idea works. I've implemented locally.
Now tracking a segfault in FFMPEG handler (when linked against FFMPEG-svn) so will commit after that.

Attached is a patch if proppy wants to test :)
Doesn't implement the call to onSoundCompleted yet, but would be trivial to add..
The test shoudl verify that sound from pokerSound comes out
whereas it doesn't without the patch.

(file #16747)

Sandro Santilli <strk>
Group Member
Sat 25 Oct 2008 08:38:08 AM UTC, comment #14: 

Reassigned to myself as I got more knowlege about Suond.
One thing is: the 'streaming' parameter of loadMovie
makes the sound play w/out needing any call to .start
if true, or needs .start if false.
Theoretically, if false, loadSound should download the whole
sound and turn it into an event sound...

In any case, onSoundComplete should be triggered when sound
has finished playing.
So, my idea is: in order to implement onSoundComplete with
current threading model, we'll need to have a timer check
for 'sound done' event.
The timer, in turn, owuld keep the Sound instance alive,
no matter any other reference.

The keep-alive thing wuold fix this bug.
Probably, it would also NOT delete a sound instance created
as a local variable of a function (which is instead deleted with pp) but we may still consider that a feature more then a compatibility bug...

Sandro Santilli <strk>
Group Member
  Spam posted by anonymous
Mon 08 Sep 2008 03:29:48 PM UTC, comment #12: 

I don't think this bug should hold a release, so downgraded
from Blocker to Important. I'm not working on it anymore
either...

Sandro Santilli <strk>
Group Member
  Spam posted by anonymous
Tue 24 Jun 2008 01:17:18 PM UTC, comment #10: 

Now I know that the pokerSound.swf is assigning the Sound
instance to a function-local register.

Using swfmill and changing register count from 4 to 0 forces
use of global registers. With global registers both gnash and the proprietary player keep the instance alive and thus sound.

Function-local registers, pp seem to keep alive, gnash doesn't.
I also tried to print value of a function-local register
before assigning to it. It's undefined on second call, so even
if alive must be cleaned up before use.

I wonder if it makes any sense to reproduce such behaviour
as it might leave allocated a lot of things that are really
not possible to access anymore.

Sandro Santilli <strk>
Group Member
Fri 20 Jun 2008 01:59:13 PM UTC, comment #9: 

To recap:

If you create a Sound instance and assign it to a function
local variable, the proprietary player doesn't play it
as well (destroyed by GC). This is tested with Ming.

If you store the sound instance reference to a timeline
variable it keeps alive and plays in pp. Again, tested with Ming.

The above works correctly in gnash (same behaviour as pp).

Now, the difference is when doing something with registers.
Don't know what yet.

Sandro Santilli <strk>
Group Member
Fri 20 Jun 2008 10:02:20 AM UTC, comment #8: 

I confirm GC-related issue:

GNASH_GC_TRIGGER_THRESHOLD=1000 <--- you always hear the sound
GNASH_GC_TRIGGER_THRESHOLD=0 <--- you never hear the sound

Sandro Santilli <strk>
Group Member
Fri 20 Jun 2008 10:00:11 AM UTC, comment #7: 

Alright, I'm starting to belive this is due to the GC.
Basically, for pokerSound, the Sound object is a member
of a sprite timeline, but the sprite it is attached to
is NOT registered to global instance list in that it has

  1. frames thus nothing to do on advance.


This is just an assumption, but gdb tells me the GC
is deleting the sound object before it has a chance
to play so might make sense..

Sandro Santilli <strk>
Group Member
Thu 19 Jun 2008 11:42:05 PM UTC, comment #6: 

Attached the small patch dropping the SWF loader thread
and the MediaParser loader thread.
The only remaining is SDL, as I suspected ...
And no way to drop that, so we can only fix it up (seems time after all).

(file #15880)

Sandro Santilli <strk>
Group Member
Thu 19 Jun 2008 11:36:18 PM UTC, comment #5: 

The code is conceptually correct now.
Only problem is a race condition somewhere between MediaParser
and SDL sound handler. I dropped the SWF loader thread
and problem is still there...

You can verify by hitting ^R with GTK gui (restart).
Sometime works, sometime doesn't...

I bet on SDL sound handler.

Sandro Santilli <strk>
Group Member
Thu 19 Jun 2008 10:15:46 PM UTC, comment #4: 

Alright, I confirm SOund.start() is NOT required to start
a sound. loadSound should do, and .start() would just restart
or seek to a specified location in seconds.

Sandro Santilli <strk>
Group Member
Thu 19 Jun 2008 10:12:09 PM UTC, comment #3: 

The crash is fixed. Now for the original bug:
I confirm gnash doesnt' play it. It requires a call
to Sound.start() for now, it seems that's not necessarely
what it should wait for..

Sandro Santilli <strk>
Group Member
Thu 22 May 2008 08:17:38 AM UTC, comment #2: 

I've committed a fix for the crashing part of this bug.

Bastiaan Jacques <bjacques>
Group Member
Sat 17 May 2008 12:30:49 PM UTC, comment #1: 

Increased to 'security' because of the Ffmpeg segfault in head - the sound not playing is not so important.

Benjamin Wolsey <bwy>
Group Member
Sat 17 May 2008 12:10:53 PM UTC, original submission:  

When compiled with MTASC:
http://proppy.aminche.com/soundswiff/pokerSounds.as
Motion-Twin ActionScript2 Compiler 1.13 - (c)2004-2007 Motion-Twin
Using:
mtasc -swf pokerSounds.swf -main -header 800:600:20 pokerSounds.as

And played using:
proppy@ippiki:~/Desktop/soundswiff$ gnash -v http://proppy.aminche.com/soundswiff/pokerSounds.swf
8166] 14:01:09: SECURITY: Load from host proppy.aminche.com granted (default).
8166] 14:01:10: SECURITY: Load from host proppy.aminche.com granted (default).
8166] 14:01:10: ERROR: start: seeking to offset failed
Main loop ended, cleaning up
Any segfault past this message is likely due to improper threads cleanup.

No sound is played.

Work fine with the pp.

According to bwy and strk:
(01:44:49 PM) bwy: segfault with head (ffmpeg).
(01:47:07 PM) bwy: Can you submit a bug report marked 'Security')?
(01:48:35 PM) bwy: That's just terrible..
(01:48:37 PM) bwy: .
(01:51:18 PM) proppy: bwy: sure
(01:52:00 PM) bwy: Valgrind gives about 10 pages of errors, but it seems all due to carrying on after ffmpeg has failed.
(02:09:14 PM) strk: kind of valgrind-clean with gstreamer

proppy@ippiki:~/Desktop/soundswiff$ gnash -V
Gnash 0.8.2
Copyright (C) 2005-2008 Free Software Foundation, Inc.
Gnash comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of Gnash under the terms of the GNU General
Public License.  For more information, see the file named COPYING.
Build options 0.8.2
   Target:
   Renderer: agg - GUI: GTK - Media handler: gst
   Configured with: CFLAGS=-Wall -g -Werror-implicit-function-declaration -O2 --host=i486-linux-gnu --build=i486-linux-gnu --prefix=/usr --mandir=/share/man --infodir=/share/info --enable-plugin --enable-gui=gtk,kde --enable-cygnal --enable-gstreamer --enable-media=gst --enable-renderer=agg --with-npapi-plugindir=/lib/gnash --enable-shared=yes --enable-sdk-install --without-swfdec-testsuite --disable-rpath --enable-lotsa-warnings --without-gcc-arch --without-ming
   CXXFLAGS: -g -O2 -pthread -pthread     -W     -Wall     -Wcast-align     -Wcast-qual     -Wpointer-arith     -Wreturn-type      -fvisibility-inlines-hidden
Gstreamer version is: 0.10.18


Johan Euphrosine <proppy>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #16747:  SoundProbe.patch added by strk (3KiB - text/x-patch)
file #15880:  nothread.diff added by strk (1KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by tonko (Posted a comment)
  • -email is unavailable- added by strk (Posted a comment)
  • -email is unavailable- added by bjacques (Updated the item)
  • -email is unavailable- added by bwy (Updated the item)
  • -email is unavailable- added by proppy (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 19 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-11-16 strk StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2008-10-29 strk StatusIn Progress Ready For Test
    2008-10-29 strk Attached File- Added SoundProbe.patch, #16747
    2008-10-25 strk StatusConfirmed In Progress
    2008-10-25 strk Assigned toNone strk
    2008-09-08 strk Severity5 - Blocker 4 - Important
        StatusIn Progress Confirmed
        Assigned tostrk None
    2008-06-19 strk Attached File- Added nothread.diff, #15880
        Severity3 - Normal 5 - Blocker
    2008-06-19 strk Categorycore sound
        Severity6 - Security 3 - Normal
        StatusConfirmed In Progress
    2008-06-19 strk StatusReady For Test Confirmed
        Assigned tobjacques strk
    2008-05-22 bjacques StatusNone Ready For Test
        Assigned toNone bjacques
    2008-05-17 bwy Severity3 - Normal 6 - Security

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code