bugGnash - The GNU Flash player - Bugs: bug #25456, [regression] gnash not able to...


bug #25456: [regression] gnash not able to play sound from presentation

Submitter:  Pablo Rodríguez <ousia>
Submitted:  Sun 01 Feb 2009 12:43:53 PM UTC
Category:  sound Severity:  3 - Normal
Release:  0.8.4 release Status:  Ready For Test
Privacy:  Public Assigned to:  strk
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup

Jump to the original submission

Mon 07 Sep 2015 07:36:49 PM UTC, comment #24: 

Gnash emitted loud screech after playing PCM audio object after this commit, see bug #45722

Sandro Santilli <strk>
Group Member
Sun 03 Nov 2013 06:59:13 PM UTC, comment #23: 

For the record: I tried with a chunksize of 32 bytes and it worked fine, even with the next commit. Only annoyance was an ERROR logged by FFMPEG decoder which I downgraded to a DEBUG with the next commit.

Sandro Santilli <strk>
Group Member
Sun 03 Nov 2013 06:56:01 PM UTC, comment #22: 


Lacks an automated test, not easy to do w/out a sound "listener".

I've performed "manual" test as much as I could, but would love to hear from others as well (gg0 + bjacques ?)

Sandro Santilli <strk>
Group Member
Sun 03 Nov 2013 04:27:24 PM UTC, comment #21: 


I’m afraid that I’m not allowed to close the bug.

At least, I don’t know how to do it.

Many thanks for your help,


Pablo Rodríguez <ousia>
Sun 03 Nov 2013 04:03:28 PM UTC, comment #20: 

Well, I filed the original report and I was wrong on the title.

I move my comments to bug #24638.

Pablo Rodríguez <ousia>
Sun 03 Nov 2013 02:42:07 PM UTC, comment #19: 

This patch seems indeed to successfully enable incremental decoding, with both gst and ffmpeg

diff --git a/libsound/EmbedSoundInst.cpp b/libsound/EmbedSoundInst.cpp
index 4c7023c..fa565aa 100644
--- a/libsound/EmbedSoundInst.cpp
+++ b/libsound/EmbedSoundInst.cpp
@@ -91,7 +91,8 @@ EmbedSoundInst::decodeNextBlock()
-    const boost::uint32_t inputSize = _soundDef.size() - decodingPosition;
+    boost::uint32_t inputSize = _soundDef.size() - decodingPosition;
+    if ( inputSize > 65525 ) inputSize = 65535;
     log_debug("  decoding %d bytes", inputSize);

Sandro Santilli <strk>
Group Member
Sun 03 Nov 2013 02:30:04 PM UTC, comment #18: 

From launch to sound there are more things happening. It is known that gnash has a longer startup time.

In this case we have a single DEFINESOUND containing mp3 data.
In Gnash this is handled by EmbedSound and EmbedSoundInst.

Looking at the interface it looks like some work was started to do incremental decoding and it may possible to already do that by limiting inputSize variable in EmbedSoundInst::decodeNextBlock.
If you want to experiment with that I hope the above is useful.

In any case this bug is about being unable to play sound, if that's fixed please close this and continue the "incremental decoding" idea in https://savannah.gnu.org/bugs/index.php?24638

Sandro Santilli <strk>
Group Member
Sun 03 Nov 2013 12:33:21 PM UTC, comment #17: 

Many thanks for your reply, Sandro.

Sorry, my previous message wasn’t clear.

I measure seconds from command launch to first sound heard. I quit after sound started playing.

User times seem to be the right ones. My laptop is old, but gnash is 10x slower than flahsplayer. In your system, gnash is less than 7x slower.

I have to compile again with ffmpeg.

But besides that, wouldn’t it be possible that gnash will only decode the sound file on-demand (and not all at once)?

Pablo Rodríguez <ousia>
Sun 03 Nov 2013 10:48:04 AM UTC, comment #16: 

I tried timing from command launch to first sound heard
and these are the results:

PP: 0m1.456s
Gnash/FFMPEG: 0m4.213s
Gnash/GST: 0m7.202s

This is with Gnash 0.8.11dev (master-21900-5b4083d)
FFmpeg (avcodec version: 53.35.0)
Gstreamer 0.10.36

Sandro Santilli <strk>
Group Member
Sun 03 Nov 2013 10:14:24 AM UTC, comment #15: 

Neither sdl-gnash nor gtk-gnash nor flashplayerdebugger would exit by themselves, and the SWF itself doesn't seem to have an explicit quit request within 30 seconds, let alone 2 seconds.

What are you timing there ?

One thing I noticed is that with GST media the animation starts later than with FFMPEG media, can you see that ? You can select with -M switch.

Sandro Santilli <strk>
Group Member
Fri 01 Nov 2013 09:31:49 AM UTC, comment #14: 

Compiling Gnash 0.8.11dev (master-21894-5ae7ec0) with Renderer: AGG, Hardware Acceleration: RawFB, GUI: GTK2, Media: Gstreamer 0.10.36, gave the following results:

$ time ./sdl-gnash freeculture.swf
real 0m30.912s
user 0m24.186s
sys 0m1.593s

$ time ./gtk-gnash freeculture.swf
* (lt-gtk-gnash:19667): WARNING *: Couldn't find pixmap file: GnashG.png
real 0m30.714s
user 0m24.209s
sys 0m1.582s

$ time flashplayerdebugger freeculture.swf
Failed to open VDPAU backend libvdpau_r300.so: cannot open shared object file: No such file or directory
Failed to open VDPAU backend libvdpau_r300.so: cannot open shared object file: No such file or directory
real 0m2.551s
user 0m0.839s
sys 0m0.148s

Would it be possible to have this bug fixed for the next 0.8.11 release? (The report is almost 5 years old.)

Many thanks for your help,


Pablo Rodríguez <ousia>
Tue 27 Mar 2012 07:16:50 PM UTC, comment #13: 

I have just upgraded to gnash-0.8.10. Many thanks for your work.

Loading the http://archive.org/download/Lessig-Free_Culture/lessig-freeculture.swf shows a big difference in flashplayerdebbuger and gnash only loading the file:

$ time flashplayerdebugger lessig-freeculture.swf
real 0m2.518s
user 0m0.857s
sys 0m0.155s

$ time gnash-gtk-launcher lessig-freeculture.swf
real 0m29.135s
user 0m23.613s
sys 0m1.422s

Advancing slides with flashplayerdebugger isn't noticeable, but it takes about 22 seconds with gnash-0.8.10.

Sorry for asking this, but is incremental sound decoding already implemented? (Looking at the numbers, this is the only explanation I can find.)

Many  thanks for your help,


Pablo Rodríguez <ousia>
Sat 09 Jul 2011 05:31:38 PM UTC, comment #12: 


thanks for the reply.

I'd ask you to post a comment to this bug when you commit the proposed patch, so I'll be able to report other bugs.

Thanks for your help,


Pablo Rodríguez <ousia>
Sat 09 Jul 2011 08:40:35 AM UTC, comment #11: 

This SWF contains a very large DefineSound tag. Gnash's EmbedSoundInst already supports incremental decoding (currently threaded), so there seems no reason not to parse it chunk by chunk. If the chunk is too small, the worst that can happen is that the sound gets choppy while waiting for data to decode, but a value of e.g. 2 << 14 seems a reasonable balance. Most event sounds are smaller than this anyway, so wouldn't require more than one pass.

One effect is that the decoders frequently get incomplete frames, but we hope that they will then signal that they did not consume all the data, and get it again on the next chunk.

Anyway, decoding in chunks makes it play immediately for me, so if I find no adverse side-effects I'll commit it.

Benjamin Wolsey <bwy>
Group Member
Sat 09 Jul 2011 07:51:19 AM UTC, comment #10: 

Sorry, I overlooked that this was ready for testing.

I'm afraid that it doesn't work for me. I explain.

File is http://randomfoo.net/oscon/2002/lessig/free_culture.swf.

Gnash version: 0.8.10dev (master-20542-844fda1). Downloaded yesterday.

Media: FFmpeg (avcodec version: 52.2.2).

It takes almost 30 seconds to start playing the sound with Gnash 0.8.10dev.

It takes over 70 seconds to start playing sound with Gnash 0.8.9 (0.8.9-20110418-none) and media GStreamer 0.10.31.

Flash Player 10 ( starts playing instantly and it doesn't load CPU to 100% (which happens with both Gnash's versions when decoding sound).

I hope it helps,


Pablo Rodríguez <ousia>
Mon 09 May 2011 07:31:07 AM UTC, comment #9: 

Seems fixed as of

Gnash 0.8.10dev (master-20418-b20c9d2)
Media: FFmpeg (avcodec version: 52.0.0)

Sandro Santilli <strk>
Group Member
Thu 15 Oct 2009 04:42:44 PM UTC, comment #8: 

Sound handling was completely redesigned at some point, which led to lots of improvements but means a simple revert is probably not possible.

There are other bugs (such as onSoundComplete for event sounds) that would also benefit from another pass over the code, but until I or someone else has time, it's going to stay as a bug.

Benjamin Wolsey <bwy>
Group Member
Sat 10 Oct 2009 02:17:46 PM UTC, comment #7: 

I wish I could contribute a patch, but I'm afraid I cannot code.

There is something I cannot understand. If I don't get it wrong sound decoding was changed in version 0.8.4 (or even 0.8.3) at least for sound events.

Wouldn't it be possible to to revert that change?

Thanks for your help,


Pablo Rodríguez <ousia>
Fri 09 Oct 2009 10:33:59 AM UTC, comment #6: 

There's no point having it like it is, but there is also no one to fix it. A patch would be welcome.

Benjamin Wolsey <bwy>
Group Member
Fri 09 Oct 2009 09:48:21 AM UTC, comment #5: 

There is an issue here that I don't understand.

I'm not an expert, but I cannot see the gain in decoding sound streams and event sounds differently.

I guess decoding sounds that enables playback before decoding is complete is better, since this requires less resources and it is faster for the user.

Could anyone explain this?

Thanks for your help,


Pablo Rodríguez <ousia>
Sat 03 Oct 2009 11:45:55 AM UTC, comment #4: 

The previous message was posted by me (but I wasn't logged in).

The following Flash presentation (http://www.archive.org/download/Lessig-Free_Culture/lessig-freeculture.swf) was played fine with release 0.8.2 (just checked in Windows with the http://getgnash.org/packages/releases/windows/gnash-0.8.2-win32-agg-fltk-ffmpeg.zip).

Using 0.8.4 and 0.8.5, since the whole sound file is decoded before playback, sound and slides are played fine, but it takes a long time before file is played.

Using 0.8.6, the regression is double, because the ActionScript code that advances slides starts before the event sound has started playing (playback starts after decoding whole sound file), so there is a mismatch between audio and slides.

I guess that fixing the originally reported bug would make possible to report other bugs with Gnash playing this file.

Pablo Rodríguez <ousia>
Thu 14 May 2009 08:01:19 PM UTC, comment #3: 

0.8.5 plays sound and slides fine for me, but decodes the whole sound file before audio playback.

Would it be possible that event sounds are decoded while playing? It might help decoding event sounds as sound streams.

Thanks for your help,


Fri 06 Feb 2009 04:03:06 PM UTC, comment #2: 

Trunk plays both the sound and the slides for me, but it (a) doesn't load it like the flashplayer does and (b) has a long pause with high CPU activity before starting to play. I wouldn't be surprised if we're doing what's described in the swfdec bug, that is, decoding the whole thing before playback.

Benjamin Wolsey <bwy>
Group Member
Sun 01 Feb 2009 12:48:05 PM UTC, comment #1: 

gnash-0.8.4 isn't able to play sound from http://randomfoo.net/oscon/2002/lessig/free_culture.swf also.

gnash-0.8.2 played it right.

(Sorry for not having checked that before.)


Pablo Rodríguez <ousia>
Sun 01 Feb 2009 12:43:53 PM UTC, original submission:  

Hi there,

congratulations for your excellent work on a free SWF player.

I have downloaded your latest release (0.8.4) and I'm afraid that it has a regression compared with version 0.8.2. agg, gtk2, gst (built against 0.10.17) are the gnash options.

http://ousia.justfree.com/freeculture.swf contains an audio file file that is played through the presentation slides (the original file at http://randomfoo.net/oscon/2002/lessig/free_culture.swf shares the same content, but not the same ActionScript code). It is an MP3 file at 32kbps mono, over 30 minutes long and it takes more than 5MB.

0.8.2 was able to play the file and the sound, but version 0.8.4 is not able to do it. I wonder whether this bug is similar to the one described at https://bugs.freedesktop.org/show_bug.cgi?id=16634#c9.

I hope it helps,


Pablo Rodríguez <ousia>


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

Attach Files:

No files currently attached


   bug dependencies.

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by strk (Posted a comment)
  • -email is unavailable- added by bwy (Posted a comment)
  • -email is unavailable- added by ousia (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-09-07 strk Dependencies- Depends on bugs #45722
    2013-11-03 strk Assigned toNone strk
    2011-05-09 strk CategoryNone sound
        StatusNone Ready For Test

    Back to the top

    Powered by Savane 3.12.
    Corresponding source code