My favorites | Sign in
Project Home Downloads Wiki Issues Code Search
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 107933: <audio> tag sound support dies
21 people starred this issue and may be notified of changes. Back to list
 
Reported by dgsprb, Dec 16, 2011
Chrome Version       : 15.0.874.121
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
URLs (if applicable) : https://chrome.google.com/webstore/detail/ggglioliiaplkedaddaanpenblibggnp
Other browsers tested:
Add OK or FAIL after other browsers where you have tested this issue:
Safari 5:
Firefox 4.x:
IE 7/8/9:

What steps will reproduce the problem?
1. Try to play a game that uses the HTML5 <audio> tag;
2. Play until the sound is muted;
3. Open other tabs with similar apps and notice they're mute, too.

What is the expected result?
Sound shouldn't just die.

What happens instead?
Sound for <audio> tags completely dies until Chrome is restarted.

Please provide any additional information below. Attach a screenshot if
possible.
Just try this game for a while. It's not easily reproducible, sometimes it happens very soon, sometimes not, but it happens with any HTML5/JavaScript game.

UserAgentString: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2



Dec 16, 2011
#1 imas...@chromium.org
I was playing the game 18.0.973.0 canary on Win7 for a while and chrome just crashes

Crash ID is : df78ca81aba8ed12

Here is the trace:
Thread 59 *CRASHED* ( EXCEPTION_ACCESS_VIOLATION_WRITE @ 0x00000000 )

0x698d5bfd	 [chrome.dll	 - audio_util.cc:236]	media::InterleaveFloatToInt16(std::vector<float *,std::allocator<float *> > const &,short *,unsigned int)
0x6957509b	 [chrome.dll	 - audio_device.cc:328]	AudioDevice::FireRenderCallback(short *)
0x6957510f	 [chrome.dll	 - audio_device.cc:292]	AudioDevice::Run()
0x68911527	 [chrome.dll	 - generic_allocators.cc:16]	generic_cpp_alloc
0x68911eff	 [chrome.dll	 - port.cc:231]	TCMalloc_SystemAlloc(unsigned int,unsigned int *,unsigned int)
0x69c3b83a	 [chrome.dll	 - simple_thread.cc:74]	base::DelegateSimpleThread::Run()
0x689140a1	 [chrome.dll	 - thread_cache.h:346]	tcmalloc::ThreadCache::Deallocate(void *,unsigned int)
0x68913d57	 [chrome.dll	 - tcmalloc.cc:1227]	`anonymous namespace'::do_free_with_callback(void *,void (*)(void *))
0x68915ee4	 [chrome.dll	 - allocator_shim.cc:153]	operator delete(void *)
0x68ec6911	 [chrome.dll	 + 0x005b6911]	
0x77759f01	 [ntdll.dll	 + 0x00039f01]	__RtlUserThreadStart
0x77759ed4	 [ntdll.dll	 + 0x00039ed4]	_RtlUserThreadStart

I also notice one time the game totally freeze and no sound is coming (even I close the tab and open new tab and start the game). When I restrart the chrome, it comes back.
Status: Untriaged
Labels: Feature-Media-Audio Stability-Crash
Dec 21, 2011
#2 dhar...@google.com
(No comment was entered for this change.)
Labels: -Pri-2 -Area-Undefined Pri-1 Area-Internals Mstone-18
Dec 21, 2011
#3 imas...@chromium.org
 dharani@, can you let me know why you put this into M18?

Dec 21, 2011
#4 dhar...@google.com
Since we have 25 crashes in 18.0 canary builds, I moved the bug to M18 to get it fixed before we hit dev.
Dec 21, 2011
#5 imas...@chromium.org
(No comment was entered for this change.)
Labels: ReleaseBlock-Dev
Dec 22, 2011
#6 dgsprb
I have experienced the major crash problem now with this Chrome for Windows 16.0.912.63 version. I can barely start to play the game until it stops playing any sound and then suddenly freezes. This is much worse than before, because now it's simply impossible to play the game at all on Windows. I really hope this can be fixed ASAP.

This same bug doesn't happen on the same version on a Mac, though on the Mac the sound is messy, some SFX are killed before being fully played, which also didn't happen before this release.

I've read on another game's website that Chrome has some issues with OGG Vorbis files, which are heavily used on this game, too. (please look up for "Chrome" @ http://dougx.net/plunder/Sound.js)
Dec 22, 2011
#7 imas...@chromium.org
Another crash using Chrome 18.0.979.0 canary on win7 : ef1125444300ca29

stack trace:

Thread 0 *CRASHED* ( 0xc0000024 / 0x00000001 @ 0x777a25ef )

0x777a25ef	 [ntdll.dll	 + 0x000825ef]	RtlUlonglongByteSwap
0x77758e81	 [ntdll.dll	 + 0x00038e81]	RtlpWaitOnCriticalSection
0x6890b39c	 [chrome.dll	 - lock.cc:45]	base::internal::LockImpl::Unlock()
0x68919b07	 [chrome.dll	 - time_win.cc:309]	`anonymous namespace'::RolloverProtectedNow()
0x68919a98	 [chrome.dll	 - time_win.cc:430]	base::TimeTicks::Now()
0x68919b8c	 [chrome.dll	 - tracking_info.cc:17]	base::TrackingInfo::TrackingInfo(tracked_objects::Location const &,base::TimeTicks)
0x68919b2c	 [chrome.dll	 - pending_task.cc:28]	base::PendingTask::PendingTask(tracked_objects::Location const &,base::Callback<void (void)> const &,base::TimeTicks,bool)
0x689198cd	 [chrome.dll	 - message_loop.cc:311]	MessageLoop::PostDelayedTask(tracked_objects::Location const &,base::Callback<void (void)> const &,__int64)
0x688f3d4d	 [chrome.dll	 - tcmalloc.cc:1227]	`anonymous namespace'::do_free_with_callback(void *,void (*)(void *))
0x68b10de2	 [chrome.dll	 - ipc_channel_proxy.cc:360]	IPC::ChannelProxy::Send(IPC::Message *)
0x68919b00	 [chrome.dll	 - time_win.cc:309]	`anonymous namespace'::RolloverProtectedNow()
0x6890b0c8	 [chrome.dll	 - gamepad_seqlock.cc:38]	content::GamepadSeqLock::WriteBegin()
0x6890b054	 [chrome.dll	 - callback_internal.cc:28]	base::internal::CallbackBase::CallbackBase(base::internal::BindStateBase *)
0x689a4413	 [chrome.dll	 - fastmalloc.cpp:268]	WTF::fastMalloc(unsigned int)
0x68919e1d	 [chrome.dll	 - xtree:978]	std::_Tree<std::_Tmap_traits<tracked_objects::Location,tracked_objects::Births *,std::less<tracked_objects::Location>,std::allocator<std::pair<tracked_objects::Location const ,tracked_objects::Births *> >,0> >::find(tracked_objects::Location const &)
0x689a4e5e	 [chrome.dll	 - stringimpl.cpp:187]	WTF::StringImpl::create(unsigned char const *)
0x688f2ba4	 [chrome.dll	 - thread_cache.h:339]	tcmalloc::ThreadCache::Allocate(unsigned int,unsigned int)
0x688f2ba4	 [chrome.dll	 - thread_cache.h:339]	tcmalloc::ThreadCache::Allocate(unsigned int,unsigned int)
0x68942089	 [chrome.dll	 - message_loop_proxy_impl.cc:40]	base::MessageLoopProxyImpl::PostTask(tracked_objects::Location const &,base::Callback<void (void)> const &)
0x68b10e02	 [chrome.dll	 - ipc_channel_proxy.cc:360]	IPC::ChannelProxy::Send(IPC::Message *)
0x68941c08	 [chrome.dll	 - tracked_objects.cc:662]	tracked_objects::ThreadData::NowForEndOfRun()
0x68b10de2	 [chrome.dll	 - ipc_channel_proxy.cc:360]	IPC::ChannelProxy::Send(IPC::Message *)
0x688f16ef	 [chrome.dll	 - tcmalloc.cc:1168]	`anonymous namespace'::do_malloc(unsigned int)
0x688f15b3	 [chrome.dll	 - allocator_shim.cc:124]	malloc
0x6890b0c8	 [chrome.dll	 - gamepad_seqlock.cc:38]	content::GamepadSeqLock::WriteBegin()
0x6890b39c	 [chrome.dll	 - lock.cc:45]	base::internal::LockImpl::Unlock()
0x6891a4d0	 [chrome.dll	 - message_loop.cc:638]	MessageLoop::AddToIncomingQueue(base::PendingTask *)
0x6891a7ca	 [chrome.dll	 - pending_task.cc:32]	base::PendingTask::~PendingTask()
0x68948f89	 [chrome.dll	 - message_loop.cc:304]	MessageLoop::PostTask(tracked_objects::Location const &,base::Callback<void (void)> const &)
0x68ba99bc	 [chrome.dll	 - ipc_sync_channel.cc:409]	IPC::SyncChannel::SendWithTimeout(IPC::Message *,int)
0x68a0b086	 [chrome.dll	 - pickle.cc:334]	Pickle::WriteBytes(void const *,int)
0x698d94e3	 [chrome.dll	 - pipeline_impl.cc:199]	media::PipelineImpl::SetPlaybackRate(float)
0x689187e7	 [chrome.dll	 - thread_local_win.cc:30]	base::internal::ThreadLocalPlatform::GetValueFromSlot(unsigned long &)
0x68922853	 [chrome.dll	 - weak_ptr.h:180]	base::WeakPtr<ObserverListBase<policy::ConfigurationPolicyReader::Observer> >::operator->()
0x688f16ef	 [chrome.dll	 - tcmalloc.cc:1168]	`anonymous namespace'::do_malloc(unsigned int)
0x688f4097	 [chrome.dll	 - thread_cache.h:346]	tcmalloc::ThreadCache::Deallocate(void *,unsigned int)
0x69903a7e	 [chrome.dll	 - ipc_message_utils.h:938]	IPC::ParamTraits<Tuple4<__int64 const &,bool const &,bool const &,bool const &> >::Write(IPC::Message *,Tuple4<__int64 const &,bool const &,bool const &,bool const &> const &)
0x68ba9988	 [chrome.dll	 - ipc_sync_channel.cc:404]	IPC::SyncChannel::Send(IPC::Message *)
0x68ba98f7	 [chrome.dll	 - render_thread_impl.cc:327]	RenderThreadImpl::Send(IPC::Message *)
0x68ba97c7	 [chrome.dll	 - render_widget.cc:232]	RenderWidget::Send(IPC::Message *)
0x694f0bc6	 [chrome.dll	 - render_view_impl.cc:3344]	RenderViewImpl::DidPlay(webkit_media::WebMediaPlayerImpl *)
0x697784b8	 [chrome.dll	 - webmediaplayer_impl.cc:335]	webkit_media::WebMediaPlayerImpl::play()
0x6890b39c	 [chrome.dll	 - lock.cc:45]	base::internal::LockImpl::Unlock()
0x68bb1074	 [chrome.dll	 - webkitplatformsupport_impl.cc:540]	webkit_glue::WebKitPlatformSupportImpl::setSharedTimerFireInterval(double)
0x68bb107c	 [chrome.dll	 - webkitplatformsupport_impl.cc:540]	webkit_glue::WebKitPlatformSupportImpl::setSharedTimerFireInterval(double)
0x68942276	 [chrome.dll	 - time.cc:69]	base::TimeDelta::InMilliseconds()
0x6894c893	 [chrome.dll	 - time_win.cc:126]	base::Time::Now()




Dec 23, 2011
#8 dgsprb
Looks like more people are involved in the same issue: https://code.google.com/p/chromium/issues/detail?id=71322
Dec 23, 2011
#9 fischman@chromium.org
Kenji: when you repro this does stderr show a message about failing to create threads?  If so this is a dup of issue 61293.
Jan 4, 2012
#10 kar...@google.com
not a dev blocker.
Labels: -ReleaseBlock-Dev ReleaseBlock-Beta
Jan 4, 2012
#11 albe...@google.com
Eugene this is a release block beta, can you look into it? 
Status: Assigned
Owner: e...@chromium.org
Jan 4, 2012
#12 e...@chromium.org
Looks like chrome is just running out of memory. Both stacks have variant of malloc() in them.

Not sure if that something to do with audio, or we are unlucky ones who tries to allocate more memory after somebody else used all available memory...

Jan 4, 2012
#13 e...@chromium.org
 Issue 108819  has been merged into this issue.
Cc: vrk@chromium.org crog...@google.com
Jan 4, 2012
#14 e...@chromium.org
RIght now no fix. I can try investigating the code once again, and I'll do that this evening, but I don't see anything wrong. We are just sending task from host to renderer, to set the volume, and that "post task" dies horrible death.
Jan 4, 2012
#15 e...@chromium.org
(No comment was entered for this change.)
Labels: -Mstone-18 -ReleaseBlock-Beta
Jan 4, 2012
#16 fischman@chromium.org
FWIW, this isn't simple memory exhaustion.
Both stacks have tcmalloc's do_free_with_callback in their midst, but it makes no sense that that calls back in to chromium code (audio or otherwise).  I suspect stack corruption is much more likely.
Jan 5, 2012
#17 e...@google.com
I believe I see the problem, actually there are at least 3:
* AudioDevice destructor is called on one thread, while IO thread can have some delayed task scheduled. Depending on the exact timing destructor can delete the data while delayed task does something (ones in the queue would be deleted, but one that is executed right now is not). That would cause crash similar to first in that bug.
* AudioDevice::Stop() passes address of local to the scheduled task, but waits for completion of that task no longer than 1 second. If IO thread is very busy task can start execution after AudioDevice::Stop() exits, using garbage.
* If IO thread is busy, AudioDevice::Stop() shuts down audio thread before stream is actually closed, potentially causing hang and/or crash. I was able to reproduce hang simulating busy IO thread by adding Sleep() to AudioDevice::ShutDownOnIOThread().

Working on fixes.
Jan 5, 2012
#18 e...@chromium.org
Adding Mstone-17, because now we know what the problem is, and problem is serious. Hopefully will have some fix tomorrow, Fri 6th.
Labels: Mstone-17
Jan 5, 2012
#19 e...@chromium.org
Adding Mstone-17 back, because now we know what the problem is, and yes, it is regression, and serious one.

Hopefully will have some fix tomorrow, Fri 6th.
Jan 5, 2012
#20 e...@chromium.org
Of course it should be Mstone-18...
Labels: -Mstone-17 Mstone-18
Jan 12, 2012
#21 bugdro...@chromium.org
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=117464

------------------------------------------------------------------------
r117464 | enal@chromium.org | Thu Jan 12 11:00:19 PST 2012

Changed paths:
 M http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/media/audio_device.cc?r1=117464&r2=117463&pathrev=117464
 M http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/media/audio_device.h?r1=117464&r2=117463&pathrev=117464

Safe and reliable fix for 2 race conditions.
(We may want to revisit the issue later, implementing more performant one...)

BUG=107933
TEST=Everything should work, and there would be no more crashes in AudioDevice.

Review URL: http://codereview.chromium.org/9112029
------------------------------------------------------------------------
Jan 12, 2012
#22 albe...@chromium.org
Kenji will play the game to try to repro (wait until check in) 
Owner: imas...@chromium.org
Jan 15, 2012
#23 babyline...@gmail.com
I have the same question...
Jan 16, 2012
#24 dgsprb
I've noticed it's taking more time for Chrome to crash in the current release (16.0.912.75). But still happens in a few seconds after starting to play with SFX enabled.
Jan 16, 2012
#26 d...@masterleep.com
http://www.dungeoneers.com is another HTML5 game with the same problem.  The game uses fairly simple HTML5 audio which works pretty well in Mac Firefox, limps along in Mac Chrome, but is unusable in Windows Chrome (sounds go completely silent, page hangs up, browser crashes, etc.)
Jan 17, 2012
#27 dgsprb
Cut the Rope has also documented this bug on their blog:
http://www.cuttherope.ie/dev/

Meanwhile, I wonder if someone was able to find another way to use audio in Chrome without triggering this problem. I'd be happy to release an update that works while we are waiting for le must anticipated stable version.

And I really don't mean using Flash as a fallback.
Jan 17, 2012
#29 imas...@chromium.org
I have tested with 18.0.1010.0 canary on MacOSX 10.7.2 and Windows7 for the following games and it looks OK.

* Starship Lite
* Cut the Rope
* http://www.dungeoneers.com (I got bunch of script errors on window7 so it was not playable).

So, I am closing this as "Fixed" in Chrome 18.
Status: Verified
Jan 18, 2012
#30 dgsprb
This is great news! Can't wait to get my hands on this next version. Thank you, people!
Jan 22, 2012
#31 dgsprb
I guess the next Chrome release is still cooking. So I decided to release a new update with SFX Mute turned on by default on Windows operating systems. It seems that playing a single BGM track doesn't hurt, so the game doesn't get completely deaf. It could be an option for those suffering with the issue.
Jan 24, 2012
#32 bugdro...@chromium.org
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=118810

------------------------------------------------------------------------
r118810 | tommi@chromium.org | Tue Jan 24 01:21:53 PST 2012

Changed paths:
 M http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/media/audio_device.cc?r1=118810&r2=118809&pathrev=118810
 M http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/media/audio_device.h?r1=118810&r2=118809&pathrev=118810

Simplify shutdown of AudioDevice's audio thread.

This is a followup change for  bug 107933  (see code review 9112029) that does the following:
* Makes Stop() asynchronous.
* Simplifies shutdown of AudioDevice's audio thread by always doing it from the IO thread.
* Simplifies access to of most member variables (added documentation).
* We no longer need synchronisation with the IO thread when shutting down the audio thread since we'll always shut it down from the IO thread.
* We don't need a lock to guard the audio_thread_ variable (and others related ones), since they're only modifed on the IO thread when the audio thread is not running.

I checked the implementations of AudioDevice::RenderCallback if this is OK and it should be fine.

BUG=107933
TEST=Run media and content tests

Review URL: https://chromiumcodereview.appspot.com/9264013
------------------------------------------------------------------------
Mar 25, 2012
#33 dgsprb
Still happens on Windows XP, which doesn't upgrade beyond Chrome 17.x.
Mar 25, 2012
#34 roboray...@gmail.com
Sound still crashes on Windows, both XP and 7. In the game I wrote, I'm using small sound clips throught <audio> element (for now, later I'll use something "new Audio" and array to store active clips, but that's not the case). 
It works for a while, and then game, and every card which uses HTML5 audio gets muted. I have no idea how are you going to fix it, but Firefox and Opera handle it nicely, so there is no problem with my code.
My game can crash sound pretty fast (shouldn't take more than 15 seconds of messing with menu (each option selection plays sound)), so if anybody would like to use it for tests, just ask me.
Mar 25, 2012
#35 dgsprb
Yeah, I quit trying to use new Audio() for each sound clip a long time ago, because it would not only produce quirky sound, but also kill Chrome even faster.

The solution with a limited number of <audio> elements which are reused in a cyclic way (simulating audio channels) has proven to be very solid on Chrome 16.x, until 17.x came up, causing major crashes in a few seconds after starting to play games.

Chrome 18.x has brought stability to that method again, but unfortunatelly that version is not available to Windows XP.

Of course, the best scenario would be one in which audio would just work, whatever the method you choose to manage it.
Mar 25, 2012
#36 roboray...@gmail.com
Why is Chrome 18.x not available on XP anyway?
It's most popular Windows after 7, at least I heard so. Is XP support dropped?
About game, it seems that Chrome is actually not the best browser and that HTML5 games still have long way to be worth developing. I've had to do it anyway and I'm not regretting, but then, if I were to create game, I'd use Flash for the next one.
And somebody may wonder why there aren't as many games based on HTML5 (except of fact that it's way younger than Flash)...

Mar 25, 2012
#37 dgsprb
Oh, actually the version that works on Windows 7 is also from the 17.x family. I really thought it was 18.x already. Well, my mistake. It's more like the latest version works on W7 but not XP.
Apr 6, 2012
#38 dgsprb
OH NO!!

The bug is back on the current 18.0.1025.151 production version!
Apr 6, 2012
#39 dgsprb
Quick update:

I have just tested Starship with more/less audio elements, instantiating a new Audio() object for every sound clip instead of the current trick which recycles a limited number of audio elements and also tried preventing new clips from being loaded over playing clips, to no avail.

After that, I have posted a new version with the infamous SFX mute (F2 key) shortcut back in the game, enabled by default.
Apr 6, 2012
#40 dgsprb
Just checked: As before, it's a Windows-only issue. (doesn't happen on Mac)
Apr 9, 2012
#41 nickthea...@gmail.com
This happens to me on the latest dev version of chrome as well, listening to ANY html5 audio, for example: http://shoptalkshow.com/episodes/007-rapidfire-1/

and after a little while on windows 7, the audio will stop, you go to the tab, press the play pause button and nothing happens, scroll to a different point in the audio and nothing happens, you have to reload the whole page and it's irritating.
May 10, 2012
#42 step...@overhead.fm
This bug is back in 18.0.1025.168 on Mac. It seemed like it had been resolved, but I'm having the same issues again.
Jul 31, 2012
#43 vicglar...@gmail.com
Still happens on windows
Sep 26, 2012
#44 canan...@gmail.com
Happens on Linux, too.  Creating lots of <audio> elements can reliably trigger a crash (even if references are not held, so they ought to be gc'ed).  I wonder if there are two different bugs here, as some people seem to indicate they can get a crash even when using only a limited pool of <audio> elements.
Oct 16, 2012
#45 sladecol...@gmail.com
Getting the same issue:
18.0.1025.151 (Developer Build 130497 Linux) Ubuntu 11.04
50 audio files ..crashes after random amount of plays.
I could get it to reliably crash on refresh if I tries to load all files in the begin of js file ..had to put load in body onload()

Oct 16, 2012
#46 sladecol...@gmail.com
Ok found my issue...was doing x.cloneNode(true).play()  changed it to .play()
seems to be working...Memory management issue ?

Mar 10, 2013
#47 bugdro...@chromium.org
(No comment was entered for this change.)
Labels: -Area-Internals -Feature-Media-Audio -Mstone-18 Cr-Internals-Media-Audio M-18 Cr-Internals
Apr 25, 2013
#48 sladecol...@gmail.com
Still Happening V25

for(var i = 1; i <= 100;i++)$num_wav[i] = new Audio("audio/" + i + ".ogg");

Apr 25, 2013
#49 dalecur...@chromium.org
Too many audio tags causing a renderer crash is issue 61293.  The gist is we're running out of threads.
Sign in to add a comment

Powered by Google Project Hosting