summaryrefslogtreecommitdiffstats
path: root/media/audio
Commit message (Collapse)AuthorAgeFilesLines
* Some fixups for AudioController and unit testshclam@chromium.org2010-06-224-21/+81
| | | | | | | | | | | | Some fixes to AudioController and more unit tests. AudioController is now ready to be used by AudioRendererHost. BUG=39885 TEST=media_unittests Review URL: http://codereview.chromium.org/2861010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50480 0039d316-1c4b-4281-b951-d872f2087c98
* AudioController accepts hardware buffer size as parameter.hclam@chromium.org2010-06-163-22/+51
| | | | | | | | | | BUG=39885 TEST=media_unitests AudioController to take hardware buffer size for opening the audio device. Review URL: http://codereview.chromium.org/2822014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50046 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 49982 - patchthakis@chromium.org2010-06-162-4/+1
| | | | | | | TBR=thakis@chromium.org Review URL: http://codereview.chromium.org/2825006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50002 0039d316-1c4b-4281-b951-d872f2087c98
* patchthakis@chromium.org2010-06-162-1/+4
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49982 0039d316-1c4b-4281-b951-d872f2087c98
* AudioController to perform audio operations on a separate threadhclam@chromium.org2010-06-075-7/+697
| | | | | | | | | | | | | | | Added AudioController as a wrapper over AudioOutputStream to operate methods of AudioOutputStream on a separate thread managed by AudioController. This way most of the audio operations will be non-blocking. Next step is to modify AudioRendererHost to use AudioController. TEST=media_unittests --gtest_filter=AudioControllerTest.* BUG=39885 Review URL: http://codereview.chromium.org/2477005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49079 0039d316-1c4b-4281-b951-d872f2087c98
* Removed PushSource::Packet. SeekableBuffer.current_time() fixed to returnsergeyu@chromium.org2010-05-262-56/+16
| | | | | | | | | | kInvalidTimestamp when the time is unknown. TEST=media_unittests BUG=28654 Review URL: http://codereview.chromium.org/2140001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48329 0039d316-1c4b-4281-b951-d872f2087c98
* Fix folding code to respect new AAC channel order caused by ffmpeg roll. ↵fbarchard@chromium.org2010-05-172-11/+8
| | | | | | | | | | | Also tested for OGG. BUG=43094 TEST=play a movie with 5.1 sound. ie startrek-sbspot_h720p.mov. The voices should be centered. Review URL: http://codereview.chromium.org/2095007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47433 0039d316-1c4b-4281-b951-d872f2087c98
* Fixed memory leaks in media_unittests that cause heapcheck errors.sergeyu@chromium.org2010-05-161-0/+9
| | | | | | | | BUG=none TEST=none TBR=ajwong@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47388 0039d316-1c4b-4281-b951-d872f2087c98
* Fixed memleak in alsa_output.ccsergeyu@chromium.org2010-05-161-1/+2
| | | | | | TBR=ajwong@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47375 0039d316-1c4b-4281-b951-d872f2087c98
* Fixed media_unittests.sergeyu@chromium.org2010-05-153-26/+69
| | | | | | | | | | BUG=44253,44254 TEST=media_unittests succeeds when run in valgrind TBR=ajwong@chromium.org Review URL: http://codereview.chromium.org/2103002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47374 0039d316-1c4b-4281-b951-d872f2087c98
* Removed AlsaPcmOutputStrem::Packet. Fixed bug in ↵sergeyu@chromium.org2010-05-145-187/+217
| | | | | | | | | | | AlsaPcmOutputStream::ScheduleNextWrite which would cause high CPU consumption. BUG=28654 TEST=Audio still works on Linux Review URL: http://codereview.chromium.org/2008010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47333 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 46314 - floating point audio support in util functions for volume and ↵fbarchard@chromium.org2010-05-043-65/+29
| | | | | | | | | | | | | | folding BUG=42861 TEST=none Review URL: http://codereview.chromium.org/1856002 TBR=fbarchard@chromium.org Review URL: http://codereview.chromium.org/1926001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46320 0039d316-1c4b-4281-b951-d872f2087c98
* floating point audio support in util functions for volume and foldingfbarchard@chromium.org2010-05-043-29/+65
| | | | | | | | | BUG=42861 TEST=none Review URL: http://codereview.chromium.org/1856002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46314 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup: Explicitly add a bunch of missing includes.thestig@chromium.org2010-04-153-3/+6
| | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/1623014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44635 0039d316-1c4b-4281-b951-d872f2087c98
* Looping for audio / videohclam@chromium.org2010-04-141-3/+25
| | | | | | | | | | Fixed the looping problem with audio / video. BUG=39478 TEST=audio plays with looping Review URL: http://codereview.chromium.org/1620010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44502 0039d316-1c4b-4281-b951-d872f2087c98
* Too many audio hangs Leopardhclam@chromium.org2010-04-131-0/+1
| | | | | | | | | | | | | | | | | | BUG=30242 TEST=Go to this page: http://weston.ruter.net/projects/test-cases/chrome-mp3-audio-crash/ Click play and it won't hang. Opening (not) too many audio streams in Leopard will cause a deadlock in AudioQueue, freezing the browser process. Unfortunately there isn't a way to detect that in the AudioQueue API. So this change limits the number of streams allowed. The limit for Leopard is set to 15 and other OSes are 50. Review URL: http://codereview.chromium.org/1559024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44419 0039d316-1c4b-4281-b951-d872f2087c98
* Flush audio data after seekhclam@chromium.org2010-04-084-15/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is about 400 to 600 ms of audio that needs to be flushed after seek, this have a pretty UX effect. This is partially fixed in this patch by reducing the amount of data down to about at most 500 ms stored in the hardware buffer. This patch clears data in the software buffer in the browser process when seek happens. We could reduce the amount of hardware buffer to further reduce the amount of lag but that can be fixed by subsequent patch. BUG=24150 TEST=audio still works, audio still play after seek the playback of old data after seek is substantially reduced. Few changes in this patch: 1. Flush software buffer after seek in browser process 2. Get rid of prerolling, this actually has not effect at all, so getting rid of useless code Needs to be done after this patch: 1. Further reduce the remaining data after seek and pause 2. Still hit the DCHECK in ClockImpl::Play(), this doesn't seem to be a new problem introduced in this patch Review URL: http://codereview.chromium.org/1508021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43983 0039d316-1c4b-4281-b951-d872f2087c98
* Assume pending buffered bytes is zero when ALSA has underrun.scherkus@chromium.org2010-04-085-16/+73
| | | | | | | | | | | | | According to docs, snd_pcm_delay() may not reach zero when ALSA has underrun. Furthermore it may return negative numbers when underrun, leading to an underflow when converted to uint32. Previously none of this was an issue however as of r43546 we now wait for pending buffered bytes to reach zero before notifying that the audio stream has finished. This doesn't completely fix the Linux ended event issue, but is a required fix regardless. BUG=30452 TEST=media_unittests Review URL: http://codereview.chromium.org/1618006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43914 0039d316-1c4b-4281-b951-d872f2087c98
* Minor C++ fixes found by Clang.evan@chromium.org2010-03-301-1/+1
| | | | | | | | | In cases where I've added an #include, it's generally due to Clang being more picky about templates being available during expansions. Review URL: http://codereview.chromium.org/1432003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43098 0039d316-1c4b-4281-b951-d872f2087c98
* - OpenBSD media/audio support stubpvalchev@google.com2010-03-262-0/+91
| | | | | | | | - FreeBSD has ALSA, add it to media.gyp Review URL: http://codereview.chromium.org/1301003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42699 0039d316-1c4b-4281-b951-d872f2087c98
* Prevent integer underflow when calculating next_fill_time_ms in ↵scherkus@chromium.org2010-02-251-5/+14
| | | | | | | | | | | AlsaPcmOutputStream. BUG=35819 TEST=play any content containing audio under linux, the sound should no longer cut out Review URL: http://codereview.chromium.org/660066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40070 0039d316-1c4b-4281-b951-d872f2087c98
* Remove size_t from audio IPC code.jam@chromium.org2010-02-0515-187/+188
| | | | | | | The change got to this size because I had to modify the surrounding code (I didn't want to just cast at the last minute). Review URL: http://codereview.chromium.org/577006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38192 0039d316-1c4b-4281-b951-d872f2087c98
* More plumbing of the low latency modecpu@chromium.org2010-01-136-27/+69
| | | | | | | | | | | | | | - added flag to factory to request low latency mode - implemented switch from triple buffered to double buffer on windows (mac is already double buffered all the time) - added tests BUG=28292 TEST=ut included Review URL: http://codereview.chromium.org/523073 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36090 0039d316-1c4b-4281-b951-d872f2087c98
* Retry 35837 linux: grab device name before closing itajwong@chromium.org2010-01-092-3/+14
| | | | | | | | | | | | PcmClose frees the handle regardless of whether there's an error while shutting down, so grab the PcmName result first in case we want to use it in an error message. Original Review URL: http://codereview.chromium.org/538005 BUG=20006 Review URL: http://codereview.chromium.org/542002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35854 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 35837 - Failed media tests - linux: grab device name before closing itrsesek@chromium.org2010-01-081-3/+2
| | | | | | | | | | | | | | | PcmClose frees the handle regardless of whether there's an error while shutting down, so grab the PcmName result first in case we want to use it in an error message. BUG=20006 Review URL: http://codereview.chromium.org/538005 TBR=evan@chromium.org Review URL: http://codereview.chromium.org/540003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35848 0039d316-1c4b-4281-b951-d872f2087c98
* linux: grab device name before closing itevan@chromium.org2010-01-081-2/+3
| | | | | | | | | | | | PcmClose frees the handle regardless of whether there's an error while shutting down, so grab the PcmName result first in case we want to use it in an error message. BUG=20006 Review URL: http://codereview.chromium.org/538005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35837 0039d316-1c4b-4281-b951-d872f2087c98
* Add a low-latency audio test that uses syncsocketscpu@chromium.org2009-12-171-0/+118
| | | | | | | | | BUG=none TEST=unit test included Review URL: http://codereview.chromium.org/500002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34787 0039d316-1c4b-4281-b951-d872f2087c98
* Move some XDG code from chrome to base, make DIR_USER_CACHE generic rather ↵thestig@chromium.org2009-12-021-0/+1
| | | | | | | | | | than Chromium specific, and clean up a few headers. BUG=none TEST=none Review URL: http://codereview.chromium.org/449048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33565 0039d316-1c4b-4281-b951-d872f2087c98
* First patch in making destructors of refcounted objects private.jam@chromium.org2009-11-051-1/+3
| | | | | | | BUG=26749 Review URL: http://codereview.chromium.org/360042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31136 0039d316-1c4b-4281-b951-d872f2087c98
* Limit frequency of audio to 48000.fbarchard@chromium.org2009-11-051-0/+9
| | | | | | | | | BUG=24480 TEST=Play colors2.ogv and do a seek. Should play and seek but audio will be mute. Review URL: http://codereview.chromium.org/365010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31084 0039d316-1c4b-4281-b951-d872f2087c98
* Reduce sleep time on Mac to 500 ms, same as PCfbarchard@chromium.org2009-11-051-1/+1
| | | | | | | | | BUG=26555 TEST=run valgrind or let build bot do it and if it runs faster than you can go make a coffee and get back, then its good. Review URL: http://codereview.chromium.org/366023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31078 0039d316-1c4b-4281-b951-d872f2087c98
* SetVolume and GetVolume take one volume instead of separate left and right ↵fbarchard@chromium.org2009-11-0412-87/+71
| | | | | | | | | | | volumes. BUG=26660 TEST=no visible difference. Make sure volume still works. Code size should go down marginally. Review URL: http://codereview.chromium.org/357004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31018 0039d316-1c4b-4281-b951-d872f2087c98
* Quick fix for Alsa stutter - Wake up sooner.fbarchard@chromium.org2009-10-221-0/+3
| | | | | | | | | BUG=23974 TEST=http://fbarchard-kir.ad.corp.google.com/testmatrix/red/red2.ogv Review URL: http://codereview.chromium.org/316005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29761 0039d316-1c4b-4281-b951-d872f2087c98
* Fold first 3 channels of multichannel instead of 5. Use fixed point.fbarchard@chromium.org2009-10-202-94/+113
| | | | | | | | | BUG=none TEST=play a multichannel video, such as trek6.ogv. Voices should sound centered and music stereo. Review URL: http://codereview.chromium.org/304006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29550 0039d316-1c4b-4281-b951-d872f2087c98
* Move Alsa device opening into the audio thread, and add in support for ↵ajwong@chromium.org2009-10-167-119/+656
| | | | | | | | | | | | | | | multi-channel audio. Moving the device opening into the audio thread will prevent browser hangs for badly behaving alsa implementations (like pulseaudio) that can hang snd_pcm_open if pulseaudiod is wedged, even if SND_PCM_NONBLOCK is requested. For multi-channel audio, device enumeration has been added to try and find a multi-channel device with a stable channel mapping. According to http://0pointer.de/blog/projects/guide-to-sound-apis.html, default should only be used with mono and stereo stream because the channel ordering is not defined by Alsa. To get a well-defined channel ordering, one must use one of the surround40, surround51, etc., device names. However, these device names do not always allow multiple opens, so a fallback scheme is implemented to use default if necessary. BUG=20945,17703 TEST=listened with built-in soundcard and USB soundcard with various other audio programs running. Review URL: http://codereview.chromium.org/275022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29299 0039d316-1c4b-4281-b951-d872f2087c98
* Pad time to next audio data write to compensate for nanosleep inaccuracy on ↵ajwong@chromium.org2009-10-151-0/+10
| | | | | | | | | | | | | linux. Nanosleep on linux can miss its deadline by up to 10ms (according to the manpage). Pad 20ms (2x that amount) to give room for missed deadlines. BUG=23974 TEST=listened to previously stuttering audio clip on low-end hardware. Review URL: http://codereview.chromium.org/271081 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29163 0039d316-1c4b-4281-b951-d872f2087c98
* Support 8 and 32 bit formats for Mac Channel Swizzler.fbarchard@chromium.org2009-10-091-2/+4
| | | | | | | Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=28484 Review URL: http://codereview.chromium.org/261028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28571 0039d316-1c4b-4281-b951-d872f2087c98
* quick syntax fixfbarchard@chromium.org2009-10-081-1/+1
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28487 0039d316-1c4b-4281-b951-d872f2087c98
* Support 8 and 32 bit formats for Mac Channel Swizzler.fbarchard@chromium.org2009-10-081-7/+13
| | | | | | Review URL: http://codereview.chromium.org/261028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28484 0039d316-1c4b-4281-b951-d872f2087c98
* Mac Surround Sound 5.1 channel layout adapter from AAC layout to native ↵fbarchard@chromium.org2009-10-063-12/+60
| | | | | | | | | | | Audio Core layout. BUG=23298,23684 TEST=play trek6.mp4 in test matrix. voices should be centered. Review URL: http://codereview.chromium.org/246039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28080 0039d316-1c4b-4281-b951-d872f2087c98
* Avoid potential "NULL used as int" warnings by changing ASSERT_EQ(NULL, ...) ↵pkasting@chromium.org2009-09-291-1/+1
| | | | | | | | | to ASSERT_TRUE(... == NULL). Patch by Jacob Mandelson (see http://codereview.chromium.org/202057 ), r=me. BUG=none TEST=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27511 0039d316-1c4b-4281-b951-d872f2087c98
* Fixing audio in machclam@chromium.org2009-09-173-8/+94
| | | | | | | | | | | | | | | | | | | | | | | | TEST=media_unittests BUG=21574 Several problems in mac audio: 1. AudioQueueEnqueueBuffer doesn't accept empty buffers. But we often hit buffer underrun with various reasons. In order to simulate the behavior of Windows that empty buffer would make the callback be called after a short time, we write a short buffer of silence. 2. Mac audio doesn't provide pending bytes (unplayed buffer size in audio buffer). This is now fixed by having a running counter. 3. After Stop() is called, Start() will take a long time for the audio packet to be played. It is found that AudioQueueEnqueueBuffer should be called before AudioQueueStart otherwise we'll hit this problem of long delay for start. Review URL: http://codereview.chromium.org/194112 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26510 0039d316-1c4b-4281-b951-d872f2087c98
* Pause for <video> should have immediate effect on audiohclam@chromium.org2009-09-171-2/+3
| | | | | | | | | | | | | BUG=20351 A bug found while fixing mac audio. IPCAudioSouce transist to a wrong state after Play() is called. Resulting to pause having no effect. This will solve the problem of audio keeps playing a while after it is paused. Review URL: http://codereview.chromium.org/193095 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26500 0039d316-1c4b-4281-b951-d872f2087c98
* AudioHardwareGetProperty is deprecated in Mac OS X 10.6 ("Snow Leopard").mark@chromium.org2009-09-171-5/+15
| | | | | | | | | | | All audio hardware properties can be accessed via AudioObjectGetPropertyData, present since Mac OS X 10.4 ("Tiger"). BUG=20925 sort of TEST=Builds in all sorts of configurations Review URL: http://codereview.chromium.org/210009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26478 0039d316-1c4b-4281-b951-d872f2087c98
* Don't redefine what Snow Leopard provides if Snow Leopard has provided it.mark@chromium.org2009-09-161-1/+3
| | | | | | Review URL: http://codereview.chromium.org/205015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26347 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Fix a ton of compiler warnings."tony@chromium.org2009-08-281-1/+1
| | | | | | | | | | | This reverts commit r24792. TBR=estade Review URL: http://codereview.chromium.org/179028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24796 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a ton of compiler warnings.estade@chromium.org2009-08-281-1/+1
| | | | | | | | | | | | | | | Most of these are classes with virtual methods lacking virtual destructors or NULL used in non-pointer context. BUG=none TEST=app_unittests && base_unittests --gtest_filter=-ConditionVariableTest.LargeFastTaskTest patch by Jacob Mandelson <jlmjlm [at] gmail> http://codereview.chromium.org/171028/show git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24792 0039d316-1c4b-4281-b951-d872f2087c98
* Provide unplayed bytes ALSA implementation of audiohclam@chromium.org2009-08-244-3/+32
| | | | | | | | | | | | | BUG=19921 TEST=play an video track on linux, AV should be in sync. Use snd_pcm_delay() to provide the number of unplayed bytes in linux's audio implementation. This information will correct the sync problem for linux. Review URL: http://codereview.chromium.org/173288 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24163 0039d316-1c4b-4281-b951-d872f2087c98
* Providing unplayed bytes in audio hardware bufferhclam@chromium.org2009-08-2413-33/+115
| | | | | | | | | | | | | | | | | BUG=20007 TEST=WinAudioTest.PCMWaveStreamPendingBytes We used to guess what is in the hardware audio buffer to perform audio sync. But due the triple buffering and other platforms has other buffering scheme we need to be able to know how many bytes are left in the hardware buffer. We provide this data via AudioCallback::OnMoreData(), so we can predict when the requested buffer will be played. Review URL: http://codereview.chromium.org/174243 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24114 0039d316-1c4b-4281-b951-d872f2087c98
* Threadsafe access to AudioSource callback. Release stream on close. Handle ↵ajwong@chromium.org2009-08-215-46/+151
| | | | | | | | | | | | | | | | | | | | error on open better. This should fix the memory leak on stream close by synchronizing the removal of the audio source callback with the signaling of a close event to both the audio source, and to the audio manager. This change also makes it possible to go from kPlaying -> kPlaying because the audio source callback can be swapped correctly. Lastly, Open() is made more robust by failing early on an error state. BUG=19860,18217 TEST=none Review URL: http://codereview.chromium.org/173168 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23988 0039d316-1c4b-4281-b951-d872f2087c98