Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Audio broken in Firefox 45

Discussion in 'Web' started by diekeure, Dec 22, 2015.

  1. diekeure

    diekeure

    Joined:
    Jan 25, 2013
    Posts:
    221
    Hello,

    Since upgrading to 5.3.1 I get lots of these errors in Firefox:

    The buffer passed to decodeAudioData contains invalid content which cannot be decoded successfully.

    And indeed, not one sound plays.

    The error doesn't give any more information so I'm a bit at a loss. Anyone an idea?

    Thx,
    Alex
     
  2. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    1,070
    I tried some audio things on my end but can't repro this. Can you send a report with the issue please and I take another look?
     
  3. diekeure

    diekeure

    Joined:
    Jan 25, 2013
    Posts:
    221
    I submitted a bug report: 756348

    Hopefully its something that can be easily fixed!

    Thanks!
     
  4. diekeure

    diekeure

    Joined:
    Jan 25, 2013
    Posts:
    221
    Ok, so I had a mail conversation with Unity QA on this issue, my thanks for that.

    The issue looks complicated. First, it's not restricted to 5.3.1, I also have the issue with a 5.3.0 build.

    The build I'm talking about is here: http://users.telenet.be/ava/unity/sound/index.html

    If I open this link in firefox developer edition (45) I get the error as stated above. (tried both 64bit and 32bit versions)
    If I open this link in firefox 44 or 43 I hear the sound but quiet compared to the volume in the editor.
    If I open this link in firefox 42 I hear the sound with a correct volume.
    If I open this link in chrome 47 I hear the sound but quiet.

    Concerning the quiet issue, I think it's related to this issue: 747834

    But for the error in firefox 45 I'm still at a loss. QA couldn't reproduce the problem on Firefox 45 so I must have some setting that is different from theirs in my browser, but I have no idea what.
    If anyone is reading this on firefox 45, can you check out the link and see if it works for you?

    Thanks!
    Alex
     
  5. bdev

    bdev

    Joined:
    Jan 4, 2011
    Posts:
    656
    You're a bit lucky that i havent updated firefox in awhile!

    Chrome 47.0.2526.106 m
    I'm using this as a baseline. Audio played, using this audio's volume as normal.

    Chrome (Canary, 64bit) 49.0.2.2599.0
    Same as regular chrome.

    Microsoft Edge 20.10240.16384.0
    Same as regular chrome (which somewhat surprised me given the vast differences in the audio edge has normally)

    Nightly (64bit)
    42.0a1 played and had the same volume.
    45.0a1 and 46.0.1a1 resulted in no audio at all.

    Firefox (32bit)
    41.0.1, 42.0, 43.0.1, 43.0.2 all played and had the same volume as chrome.


    I should note that when i say had the same volume, I'm measuring it by having chrome play the audio at the same time and listening for a higher or lower sound interleave which i couldn't at least hear with my ears.

    Heres the log from nightly 46
    Code (csharp):
    1.  
    2. GET
    3. XHR
    4. http://www.zita.be/users_error/ [HTTP/1.0 403 Forbidden 463ms]
    5.  
    6. Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://www.zita.be/users_error/. (Reason: CORS header 'Access-Control-Allow-Origin' missing). <unknown>
    7.  
    8. Decompressed Release/Build.memgz in 50ms. You can remove this delay if you configure your web server to host files using gzip compression. UnityLoader.js:1:775
    9.  
    10. Decompressed Release/Build.datagz in 42ms. You can remove this delay if you configure your web server to host files using gzip compression. UnityLoader.js:1:775
    11.  
    12. Decompressed Release/Build.jsgz in 94ms. You can remove this delay if you configure your web server to host files using gzip compression. UnityLoader.js:1:775
    13.  
    14. Successfully compiled asm.js code (total compilation time 1024ms; stored in cache) 43c1b4a8-a5d2-4697-a551-f9a943a34136
    15.  
    16. pre-main prep time: 45 ms UnityLoader.js:1:31293
    17.  
    18. Initialize engine version: 5.3.1f1 (cc9cbbcc37b4) UnityLoader.js:1:31246
    19.  
    20. Creating WebGL 1.0 context. UnityLoader.js:1:31246
    21.  
    22. Renderer: Mozilla UnityLoader.js:1:31246
    23.  
    24. Vendor:   Mozilla UnityLoader.js:1:31246
    25.  
    26. Version:  WebGL 1.0 UnityLoader.js:1:31246
    27.  
    28. GLES:     0 UnityLoader.js:1:31246
    29.  
    30. ANGLE_instanced_arrays GL_ANGLE_instanced_arrays EXT_blend_minmax GL_EXT_blend_minmax EXT_color_buffer_half_float GL_EXT_color_buffer_half_float EXT_frag_depth GL_EXT_frag_depth EXT_shader_texture_lod GL_EXT_shader_texture_lod EXT_texture_filter_anisotropic GL_EXT_texture_filter_anisotropic OES_element_index_uint GL_OES_element_index_uint OES_standard_derivatives GL_OES_standard_derivatives OES_texture_float GL_OES_texture_float OES_texture_float_linear GL_OES_texture_float_linear OES_texture_half_float GL_OES_texture_half_float OES_texture_half_float_linear GL_OES_texture_half_float_linear OES_vertex_array_object GL_OES_vertex_array_object WEBGL_color_buffer_float GL_WEBGL_color_buffer_float WEBGL_compressed_texture_etc1 GL_WEBGL_compressed_texture_etc1 WEBGL_compressed_texture_s3tc GL_WEBGL_compressed_texture_s3tc WEBGL_debug_renderer_info GL_WEBGL_debug_renderer_info WEBGL_depth_texture GL_WEBGL_depth_texture WEBGL_draw_buffers GL_WEBGL_draw_buffers WEBGL_lose_context GL_WEBGL_lose_context MOZ_WEBGL_lose_ UnityLoader.js:1:31246
    31.  
    32. context GL_MOZ_WEBGL_lose_context MOZ_WEBGL_compressed_texture_s3tc GL_MOZ_WEBGL_compressed_texture_s3tc MOZ_WEBGL_depth_texture GL_MOZ_WEBGL_depth_texture UnityLoader.js:1:31246
    33.  
    34. OPENGL LOG: Creating OpenGL ES 2.0 graphics device UnityLoader.js:1:31246
    35.  
    36. UnloadTime: 0.140000 ms UnityLoader.js:1:31246
    37.  
    38. The buffer passed to decodeAudioData contains invalid content which cannot be decoded successfully. index.html
    39.  
    40. Decode error. 43c1b4a8-a5d2-4697-a551-f9a943a34136:1:209815
    41.  
    42. EncodingError: The given encoding is not supported.
    43.  
    I myself have gone through tons of issues with unity audio and webgl. so i decided since i havent tested nightly to give that a shot with this which does not use audio sources but rather uses a plugin i made to interface webaudio directly and support streaming ect. and that works. I did also test another project that does play some audio through audio sources and that works as well and was built on 5.3.1. So i'm not sure what could be causing that issue but wouldn't be surprised if it is something in 5.3.1 (have you tested builds made with prior versions on unity in the browsers that do not play audio?) but it could also be a bug with the browser too?
     
    Last edited: Dec 23, 2015
  6. diekeure

    diekeure

    Joined:
    Jan 25, 2013
    Posts:
    221
    @bdev thanks for your research! Much appreciated!

    So for you it's the same volume on all browsers, at least that's a relieve, perhaps I made a mistake in my test on firefox 42. I've tried to install firefox 42 and 43 to retest, but somehow when I open them it's still the 44 that starts.

    Concerning Firefox 45+, I'm happy to hear that someone else has the same issue, I have the exact same log as yours. I have tested it also with a build made with 5.3.0 so I was wrong when I thought this issue has just sprung up.

    But since it works in all competitors' browsers, it must be something firefox specific... I'll try and see if I can find something there.
     
  7. diekeure

    diekeure

    Joined:
    Jan 25, 2013
    Posts:
    221
  8. jyavenard

    jyavenard

    Joined:
    Dec 23, 2015
    Posts:
    1
    Hello.

    I'm JYA, and I work on Firefox media.

    The mp4 data is incorrectly muxed, in particular the sample table box (stbl) doesn't mark any frames as keyframes
    Our mp4 demuxer is looking for the first keyframe (as no frames prior a keyframe is decodable).
    For audio it's particular because, all AAC or MP3 frames are keyframes, they do not depend on another to be decodable. But this isn't true with all codec.

    So as no frames is marked as keyframe, we end up with an empty array of frames.

    I have submitted a workaround, but ultimately, the data being fed needs to be correct, and right now it isn't.
    (and that it plays with other browsers is no argument to have it played :) )

    Cheers
    JY
     
  9. bdev

    bdev

    Joined:
    Jan 4, 2011
    Posts:
    656
    Interesting, would have thought unity would have re-muxed it automatically. Is the sound loaded through WWW or something?
     
  10. diekeure

    diekeure

    Joined:
    Jan 25, 2013
    Posts:
    221
    No, in the testproject its just an audiosource with an audioclip on the main camera, included in the build.