After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 782132 - Gstreamer doesn't handle Opus preskip larger than one frame
Gstreamer doesn't handle Opus preskip larger than one frame
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
unspecified
Other Linux
: Normal major
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 782157 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2017-05-03 19:23 UTC by Jean-Marc Valin
Modified: 2017-05-29 15:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix chained opus with preskip > packet length (3.22 KB, patch)
2017-05-05 12:14 UTC, Vincent Penquerc'h
committed Details | Review
fix artifacts at chain boundaries (1.96 KB, patch)
2017-05-29 12:47 UTC, Vincent Penquerc'h
committed Details | Review

Description Jean-Marc Valin 2017-05-03 19:23:31 UTC
It seems like Gstreamer has a hard time with Ogg Opus preskip values larger than one frame (960 samples). It normally handles chaining fine, but not when preskip is larger. The following audio sample currently works fine for me:
https://jmvalin.ca/misc_stuff/chain_works.opus
It it made of 1-second streams chained together and should play for 90 seconds (it does for me). Now, this file is almost identical except for a few samples being trimmed (using preskip) at the beginning:
https://jmvalin.ca/misc_stuff/chain_doesnwtork.opus
For me, this file only plays for about 1 second and then hangs gstreamer. Then there's this file that would actually crash totem:
https://jmvalin.ca/misc_stuff/totem_crash2.opus
This got reported in https://bugzilla.gnome.org/show_bug.cgi?id=782095 but it's not just that crash that needs to be fixed. The file should also play for 90 seconds and not just one.
Comment 1 Vincent Penquerc'h 2017-05-05 12:13:14 UTC
*** Bug 782157 has been marked as a duplicate of this bug. ***
Comment 2 Vincent Penquerc'h 2017-05-05 12:14:01 UTC
Created attachment 351192 [details] [review]
fix chained opus with preskip > packet length

This fixes playback, however I get constant small artifacts, which means the clipping is probably still not quite right.
Comment 3 Sebastian Dröge (slomo) 2017-05-08 14:47:24 UTC
Comment on attachment 351192 [details] [review]
fix chained opus with preskip > packet length

Seems to make sense, but should look at the artifacts. Would be good to compare with the expected output, to see in e.g. audacity how much is missing and where.
Comment 4 Jean-Marc Valin 2017-05-08 15:05:11 UTC
I uploaded what the decoded version should look like. For 
https://jmvalin.ca/misc_stuff/totem_crash2.opus
the decoded file (using opusdec) is:
https://jmvalin.ca/misc_stuff/totem_crash2.wav
This example has the large preskip on every stream. 

There's also:
https://jmvalin.ca/misc_stuff/chain_doesnwtork.opus
that should decode to:
https://jmvalin.ca/misc_stuff/chain_doesnwtork.wav
That one only has the large preskip on the first stream.
Comment 5 Vincent Penquerc'h 2017-05-26 13:43:18 UTC
I'd missed this got set to commit-now.

commit 523e98396fa05282ca8e9d98a48426edf72c0023
Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Date:   Fri May 5 12:48:41 2017 +0100

    oggdemux: fix clipping more samples than exist in the first packet
    
    This can happen in Opus (and maybe other codecs ?), and would cause
    failure to play.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=782157


Still artifacts left to fix though.
Comment 6 Sebastian Dröge (slomo) 2017-05-29 07:54:19 UTC
Should this go into 1.12?
Comment 7 Vincent Penquerc'h 2017-05-29 12:47:13 UTC
Created attachment 352766 [details] [review]
fix artifacts at chain boundaries

That fixes the artifacts at chain boundaries - something I'd broken myself.
The 319 chain samples now sounds as good as the opusdec output.
Comment 8 Vincent Penquerc'h 2017-05-29 15:23:54 UTC
commit bb0abf85587a4ef23937928fbd5d550cf1f73e99
Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Date:   Mon May 29 13:44:01 2017 +0100

    oggdemux: fix artifacts at chain boundaries
    
    https://bugzilla.gnome.org/show_bug.cgi?id=782132