summaryrefslogtreecommitdiffstats
path: root/media/audio
Commit message (Collapse)AuthorAgeFilesLines
* Allow unit tests to use a mock audio input controller.satish@chromium.org2010-08-104-3/+179
| | | | | | | | | | | This is modelled after chrome/common/net/test_url_fetcher_factory.h. Using this mock unit tests can stub out the audio recording part and test the consumer of the audio data. I have also added a new media_test_support target to media.gyp, this will be used in subsequent CLs for testing speech input code. BUG=none TEST=none, this code will get used in future unit tests Review URL: http://codereview.chromium.org/3148003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55627 0039d316-1c4b-4281-b951-d872f2087c98
* FBTF: Remove unneeded headers from base/ (part 5)thestig@chromium.org2010-08-071-2/+0
| | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/3041049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55349 0039d316-1c4b-4281-b951-d872f2087c98
* base: rename Environment::HasEnv to Environment::HasVar.tfarina@chromium.org2010-08-041-1/+1
| | | | | | | | | | | | This is the part 2 of this series. More two comming. Splitting this into small parts, so it is more easy to review and reduce the size of the CL. BUG=None TEST=trybots Review URL: http://codereview.chromium.org/3035050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54996 0039d316-1c4b-4281-b951-d872f2087c98
* base: Rename EnvVarGetter to Environment.tfarina@chromium.org2010-08-032-3/+2
| | | | | | | | | | | | | | | Now EnvVarGetter do much more than getting environment variables. Per suggestion from Pawel in http://codereview.chromium.org/3043018/. BUG=None TEST=trybots Signed-off-by: Thiago Farina <tfarina@chromium.org> Review URL: http://codereview.chromium.org/3052034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54696 0039d316-1c4b-4281-b951-d872f2087c98
* Uninitialized member in AudioInputController.finnur@chromium.org2010-08-021-0/+1
| | | | | | | | | | BUG=None TEST=None CID=11839 Review URL: http://codereview.chromium.org/3078012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54546 0039d316-1c4b-4281-b951-d872f2087c98
* GTTF: more FRIEND_TEST_ALL_PREFIXESphajdan.jr@chromium.org2010-07-271-21/+24
| | | | | | | | | TEST=compile BUG=44549 Review URL: http://codereview.chromium.org/3064007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53793 0039d316-1c4b-4281-b951-d872f2087c98
* Add an AudioInputController to help with audio recording.satish@chromium.org2010-07-163-0/+406
| | | | | | | | | | | This is similar to the existing AudioOutputController class used for playback. Also adds a unit test which uses the new fake audio input stream, so this patch is dependant on http://codereview.chromium.org/2909015 TEST=no new user visible change to test, just some backend recording additions which are unused at the moment. BUG=none Review URL: http://codereview.chromium.org/2905010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52617 0039d316-1c4b-4281-b951-d872f2087c98
* Audio pause and seek betterhclam@chromium.org2010-07-152-19/+69
| | | | | | | | | | | | | BUG=39885 Pause for audio is now in effect in less than 200ms. Seek for audio is also much better as we play also very short amount after seek. Review URL: http://codereview.chromium.org/2931014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52560 0039d316-1c4b-4281-b951-d872f2087c98
* AudioController sets volume to 1.0 by defaulthclam@chromium.org2010-07-151-1/+1
| | | | | | | | | | | | | | NaCl audio stop working because the demo NaCl plugin doesn't set volume. We revert to the original behavior of AudioController by setting volume to 1.0 by default. TBR=neb BUG=49807 TEST=NaCl audio plays Review URL: http://codereview.chromium.org/2966014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52548 0039d316-1c4b-4281-b951-d872f2087c98
* Add a fake audio input stream for testing purposes.satish@chromium.org2010-07-156-1/+198
| | | | | | | | | | This will be used by unit tests in subsequent patches. BUG=none TEST=no new features added and nothing new to test Review URL: http://codereview.chromium.org/2909015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52464 0039d316-1c4b-4281-b951-d872f2087c98
* Fixed ended event when playing audio on linux.sergeyu@chromium.org2010-07-143-43/+3
| | | | | | | | | | | AudioRendererBase::FillBuffers() sends ended event only when playback_delay == 0, but with ALSA output the delay was never set to 0 because it includes hardware delay. Changed ALSA output to include only internal buffers in the delay value: this matches windows and mac versions. BUG=45074 TEST=<audio> fires ended event when necessary Review URL: http://codereview.chromium.org/2978005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52407 0039d316-1c4b-4281-b951-d872f2087c98
* Add recording capability to AudioManager, and implemented on windows using ↵satish@chromium.org2010-07-1413-5/+693
| | | | | | | | | | | | | the WaveIn APIs. Implementation for other platforms will follow in future patches. Also includes a unit test. BUG=none TEST=no user visible change yet, just adding audio recording backend. Review URL: http://codereview.chromium.org/2966005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52292 0039d316-1c4b-4281-b951-d872f2087c98
* Rename a header and some methods to make way for subsequent audio recording ↵satish@chromium.org2010-07-1225-151/+157
| | | | | | | | | | | | | additions. Renaming audio_output.h to audio_io.h as future patches will add audio recording code to this file. Also renamed a couple of methods to make it clear that these are for audio playback/output and similar methods will be added for audio capture/recording soon. BUG=none TEST=no change in functionality. Review URL: http://codereview.chromium.org/2962006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52125 0039d316-1c4b-4281-b951-d872f2087c98
* Renamed AudioController to AudioOutputController.satish@chromium.org2010-07-093-107/+122
| | | | | | | | | | This is in preparation to add an AudioInputController for audio recording in subsequent changes. BUG=none TEST=no functional change Review URL: http://codereview.chromium.org/2964005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52015 0039d316-1c4b-4281-b951-d872f2087c98
* Rewrite AudioRendererHost to use AudioControllerhclam@chromium.org2010-07-073-14/+31
| | | | | | | | | | | | | | | | | | | | | | | | This change will move all the audio device methods calls to AudioController so we can move all the audio related methods calls off the IO thread. This change will let AudioRendererHost to use the AudioController API. This involves rewriting the whole AudioRendererHost. After this patch we can implement proper pause operations that is only possible if they are hosted on a separated thread due to their blocking nature. Normal latency mode is fully covered by unit tests, including audio control operations and data conversation. Low latency mode using SyncSocket is tested only for stream creation and still need to handle cases during shutdown when we want SyncSocket to return immediately. TEST=unit_tests --gtest_filter=AudioRendererTest.* BUG=39885 Review URL: http://codereview.chromium.org/2850016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51743 0039d316-1c4b-4281-b951-d872f2087c98
* 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