summaryrefslogtreecommitdiffstats
path: root/media/audio
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Remove the folding define macro.ajwong@chromium.org2009-08-201-7/+0
| | | | | | | | | | | It will never be disabled anyways and just leaves a block of code open for bitrot. BUG=none TEST=none Review URL: http://codereview.chromium.org/171017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23852 0039d316-1c4b-4281-b951-d872f2087c98
* Bump kNumBuffers to 3fbarchard@chromium.org2009-08-202-16/+22
| | | | | | | | BUG=17940 TEST=This vid should not stutter http://fbarchard-v64.ad.corp.google.com/testmatrix/color/color2.mp4 Review URL: http://codereview.chromium.org/174134 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23849 0039d316-1c4b-4281-b951-d872f2087c98
* Enabled mono playback support for Linux.scherkus@chromium.org2009-08-202-5/+20
| | | | | | | | | | BUG=19788 TEST=try playing any mono audio source, should just work! Review URL: http://codereview.chromium.org/173109 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23846 0039d316-1c4b-4281-b951-d872f2087c98
* Possible deadlock in PCM audio Start() methodcpu@chromium.org2009-08-182-6/+47
| | | | | | | | | | | | | - Implement Alpha's idea of pausing the device while we queue the first two packets. - This way we don't risk the chance to enter the callback from two threads at the same time. TEST=unit test added BUG=19276 Review URL: http://codereview.chromium.org/173022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23668 0039d316-1c4b-4281-b951-d872f2087c98
* AudioRendererHost send ViewMsg_AudioStreamStatehclam@chromium.org2009-08-111-9/+0
| | | | | | | | | | | | | AudioRendererHost should use ViewMsg_AudioStreamState to notify renderer of its state instead of AudioOutputStream::State. The enum of AudioOutputStream::State is not used anywhere, thus removed. TEST=unit_tests --gtest_filter=Audio* Review URL: http://codereview.chromium.org/165255 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23061 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a leak in AudioRendererBaseTest::OneCompleteReadCyclehclam@chromium.org2009-08-061-1/+2
| | | | | | | | | | | | | | | | We should a local reference of the input buffer, so that buffer gets cleanup after it is out of scope. Also disabled AudioUtilTest.FoldChannels_s16_benchmark because it is running too long. It shold be run locally instead of on the build bots. TEST=media_unittests --gtest_filter=AudioRendererBaseTest.OneCompleteReadCycle TBR=scherkus Review URL: http://codereview.chromium.org/165087 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22671 0039d316-1c4b-4281-b951-d872f2087c98
* Reimplement the AlsaPcmOutputStream and fix the threading issues.ajwong@chromium.org2009-08-048-512/+1136
| | | | | | | | Changes the threading model from one thread per stream to one shared thread. Also, redoes the alsa reading/buffering logic to assume an asynchronous data source, and respect the different packet sizes. The Alsa device is set to non-blocking now. State transitions are cleaned up, and the threading semantics are reworked. Now linux audio will no longer crash on shutdown, seek, pause, or tab close. This implementation does still leak though. :( The leak will be fixed in another CL. Review URL: http://codereview.chromium.org/160497 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22414 0039d316-1c4b-4281-b951-d872f2087c98
* Surround Sound handling by folding 5 channels down to stereo.fbarchard@chromium.org2009-07-255-5/+207
| | | | | | | | | BUG=16026 TEST=play a movie trailer with 5.1 audio. It should sound roughly the same as quicktime. Review URL: http://codereview.chromium.org/155894 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21613 0039d316-1c4b-4281-b951-d872f2087c98
* Software volume control hook-up in linux.ajwong@chromium.org2009-07-252-3/+14
| | | | | | | | | BUG=17709 TEST=None Review URL: http://codereview.chromium.org/159380 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21602 0039d316-1c4b-4281-b951-d872f2087c98
* Refactoring to share MockAudioOutputStream implementations across 3 platformshclam@google.com2009-07-2218-191/+189
| | | | | | | | | | | | | Re-trying the previous CL. The last change got reverted because of valgrind failure. TBR=scherkus Original CL: http://codereview.chromium.org/155471 Review URL: http://codereview.chromium.org/159167 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21242 0039d316-1c4b-4281-b951-d872f2087c98
* Revert r21137 to fix Chromium mac valgrindhclam@chromium.org2009-07-2117-188/+190
| | | | | | | | TBR=scherkus Review URL: http://codereview.chromium.org/159122 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21154 0039d316-1c4b-4281-b951-d872f2087c98
* Refactoring to share MockAudioOutputStream implementations across 3 platformshclam@chromium.org2009-07-2117-190/+188
| | | | | | Review URL: http://codereview.chromium.org/155471 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21137 0039d316-1c4b-4281-b951-d872f2087c98
* Software volume adjustment by changing samples.fbarchard@chromium.org2009-07-205-26/+178
| | | | | | | | | BUG=16500 TEST=play youtube in different window. play another video with video tag and mute sound and make sure it does not affect youtube. Review URL: http://codereview.chromium.org/159092 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21091 0039d316-1c4b-4281-b951-d872f2087c98
* Allow 6 channel to pass thru to driver.fbarchard@chromium.org2009-07-161-2/+11
| | | | | | Review URL: http://codereview.chromium.org/155525 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20823 0039d316-1c4b-4281-b951-d872f2087c98
* Put some hard limits on the low level audio apicpu@google.com2009-07-013-0/+50
| | | | | | | | | | | | | | - Max number of channels (2) - Bits per sample (64) - Sampling rate (256kHz) - Queue audio buffer (64MB x 2) BUG=none TEST= WinAudioTest.SanityOnMakeParams Review URL: http://codereview.chromium.org/151093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19695 0039d316-1c4b-4281-b951-d872f2087c98
* Changing overstrict CHECKs to just setting the object into an invalid state.ajwong@chromium.org2009-06-201-5/+17
| | | | | | | | BUG: 13287 Review URL: http://codereview.chromium.org/140033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18882 0039d316-1c4b-4281-b951-d872f2087c98
* Setting svn:eol-style LF for media source files.scherkus@chromium.org2009-06-174-78/+79
| | | | | | | | | | | Removed some trailing whitespace as well and fixed some style nits. No code change. TEST=none BUG=none TBR=hclam Review URL: http://codereview.chromium.org/125225 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18577 0039d316-1c4b-4281-b951-d872f2087c98
* Changed to use PushSource for the intermediate bufferhclam@chromium.org2009-06-052-0/+41
| | | | | | | | | | | | | | | between the IPC layer and the audio hardware interface. We have completely moved away from being blocking in AudioRendererHost. Since we'll be using PushSource for a longer period of buffering. It's necessary to have Play/Pause functionality in the AudioOutputStream, this is simulated by start/stop the AudioOutputStream multiple times. Review URL: http://codereview.chromium.org/114069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17707 0039d316-1c4b-4281-b951-d872f2087c98
* Fix build bustage due to media_testshclam@chromium.org2009-06-042-44/+45
| | | | | | | | | | | | It's not the right time to move SineWaveAudioSource to a common unit test yet since linux doesn't have mock audio stream implemented. TBR=cpu, willchan Review URL: http://codereview.chromium.org/118286 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17691 0039d316-1c4b-4281-b951-d872f2087c98
* Allow PushSource to have smaller write size than read size (packet size)hclam@chromium.org2009-06-044-56/+132
| | | | | | | | | | The change actually supports arbitrary write size but write size greater than read size (packet size) is prohibited by an explicit check. Review URL: http://codereview.chromium.org/118170 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17686 0039d316-1c4b-4281-b951-d872f2087c98
* Change default audio device from "plug:default" to "default".ajwong@chromium.org2009-05-273-4/+5
| | | | | | Review URL: http://codereview.chromium.org/113923 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17040 0039d316-1c4b-4281-b951-d872f2087c98
* Non blocking audio sourcecpu@google.com2009-05-233-6/+241
| | | | | | | | | | | | | | - New interface PushAudioOutput for push model source - New adapter class PushSource which converts from pull model to push model - A test audio file (made by me using freeware program WavePad) - A new test TEST=unit test included. Review URL: http://codereview.chromium.org/115223 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16825 0039d316-1c4b-4281-b951-d872f2087c98
* Third attempt at http://codereview.chromium.org/115276ajwong@chromium.org2009-05-215-4/+790
| | | | | | Review URL: http://codereview.chromium.org/115645 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16639 0039d316-1c4b-4281-b951-d872f2087c98
* Revert r16622estade@chromium.org2009-05-215-790/+4
| | | | | | | | TBR=ajwong Review URL: http://codereview.chromium.org/115641 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16626 0039d316-1c4b-4281-b951-d872f2087c98
* Reapply http://codereview.chromium.org/115276ajwong@chromium.org2009-05-215-4/+790
| | | | | | Review URL: http://codereview.chromium.org/115638 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16622 0039d316-1c4b-4281-b951-d872f2087c98
* Revert http://codereview.chromium.org/115276ajwong@chromium.org2009-05-215-790/+4
| | | | | | Review URL: http://codereview.chromium.org/115624 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16584 0039d316-1c4b-4281-b951-d872f2087c98
* This iteration creates one message loop per audio output stream that is ↵ajwong@chromium.org2009-05-215-4/+790
| | | | | | | | responsible for buffering data from the data source, and writing the buffers to the output device. This design blocks while waiting for data to be retrieved from the data source, which can lead to unnecessary buffer underruns in the audio device. This will be solved later after the non-blocking AudioSource interface is written. Review URL: http://codereview.chromium.org/115276 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16583 0039d316-1c4b-4281-b951-d872f2087c98
* Third installement of low level audio for maccpu@chromium.org2009-04-302-14/+130
| | | | | | | | | | | - Finally audio playback wired - Takes into account initial buffer fill change of last week - Two 'can you hear this?' unit tests added Review URL: http://codereview.chromium.org/92131 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15017 0039d316-1c4b-4281-b951-d872f2087c98