summaryrefslogtreecommitdiffstats
path: root/media/audio/pulse
Commit message (Collapse)AuthorAgeFilesLines
* Always use the native sample rate for Pulse.dalecurtis@chromium.org2014-06-231-4/+1
| | | | | | | | | | | Lets see if this resolves the glitching issues. BUG=366433 TEST=none Review URL: https://codereview.chromium.org/339583005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279170 0039d316-1c4b-4281-b951-d872f2087c98
* Modifies AudioInputCallback::OnData and use media::AudioBus instead of plain ↵henrika@chromium.org2014-06-194-10/+18
| | | | | | | | | | | | | | byte vector (Relanding). Second attempt to land https://codereview.chromium.org/314713002/ which has been reverted. TBR=dalecurtis BUG=375155 TEST=WebRTC and WebSpeech demos Review URL: https://codereview.chromium.org/344583002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278345 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 277794 "Modifies AudioInputCallback::OnData and use media..."macourteau@chromium.org2014-06-174-18/+10
| | | | | | | | | | | | | | | | > Modifies AudioInputCallback::OnData and use media::AudioBus instead of plain byte vector > > BUG=375155 > TEST=WebRTC and WebSpeech demos > > Review URL: https://codereview.chromium.org/314713002 R=henrika@chromium.org TBR=henrika@chromium.org Review URL: https://codereview.chromium.org/335343004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277814 0039d316-1c4b-4281-b951-d872f2087c98
* Modifies AudioInputCallback::OnData and use media::AudioBus instead of plain ↵henrika@chromium.org2014-06-174-10/+18
| | | | | | | | | | | byte vector BUG=375155 TEST=WebRTC and WebSpeech demos Review URL: https://codereview.chromium.org/314713002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277794 0039d316-1c4b-4281-b951-d872f2087c98
* generate_stubs: Allow // comments as well as the existing #.rsesek@chromium.org2014-06-131-6/+6
| | | | | | | | | | BUG=none TEST=generate_stubs_unittest.py R=ajwong@chromium.org Review URL: https://codereview.chromium.org/332823003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276925 0039d316-1c4b-4281-b951-d872f2087c98
* add audio-buffer-size command line flag support to the input audio for all ↵xians@chromium.org2014-05-201-2/+7
| | | | | | | | | | | | | the platforms. This is required to do some experiments with low buffer size for input audio. BUG=363958 TEST=manual test with audio-buffer-size flag Review URL: https://codereview.chromium.org/285233005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271673 0039d316-1c4b-4281-b951-d872f2087c98
* Use larger buffer sizes for lower power on Linux.dalecurtis@chromium.org2014-04-171-3/+8
| | | | | | | | | | | | | | | | | | | HTML5 playback on Linux ALSA, Pulse, and ChromeOS will now use a buffer size of 1024+ for media playback. On my Z620 this takes pulseaudio daemon CPU usage from a solid 3-4% down to 1%. Likely there are savings in the Chrome process as well, but those are harder to measure against process noise. I suspect we'll see greater savings on Chromebooks. BUG=362261 TEST=Audio sounds the same always. CPU usage down. NOTRY=true Review URL: https://codereview.chromium.org/235723003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264443 0039d316-1c4b-4281-b951-d872f2087c98
* Remove unnecessary output spam from pulse audioenne@chromium.org2014-04-121-4/+4
| | | | | | | | BUG=none Review URL: https://codereview.chromium.org/233083010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263489 0039d316-1c4b-4281-b951-d872f2087c98
* Clean up histogram'd media enum max values.rileya@chromium.org2014-02-281-3/+1
| | | | | | | | | | | | | | | This adds a PRESUBMIT test to src/media/ which enforces the following when using UMA_HISTOGRAM_ENUMERATION: - The max enum value should be suffixed with 'MAX' or 'Max' (and it should be equal to the largest valid entry ever logged). - One should be added to that max value when used in the UMA_HISTOGRAM_ENUMERATION macro. To handle past misuses of UMA_HISTOGRAM_ENUMERATION for non-enums a comment of '// IGNORE_PRESUBMIT_UMA_MAX' was added to silence the presubmit check. BUG=165553 TBR=danakj Review URL: https://codereview.chromium.org/148553003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254209 0039d316-1c4b-4281-b951-d872f2087c98
* Implement hook to change audio output device for PulseAudio.grunell@chromium.org2014-02-136-9/+27
| | | | | | | | BUG=331305 Review URL: https://codereview.chromium.org/129793012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251165 0039d316-1c4b-4281-b951-d872f2087c98
* Reland 153623004: Remove the unified IO code on the browserxians@chromium.org2014-02-134-396/+6
| | | | | | | | | | | | | | Remove the unified IO code on the browser. Unified IO is not used any more and it should be removed. TBR=dalecurtis@chromium.org BUG=337096 TEST=bots, and nothing breaks. Review URL: https://codereview.chromium.org/163343002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251018 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 249790 "Remove the unified IO code on the browser."skobes@google.com2014-02-074-6/+396
| | | | | | | | | | | | | | | | | | | | | | | | http://build.chromium.org/p/chromium.chromiumos/builders/ChromiumOS%20%28amd64%29/builds/14117 chromeos-chrome-34.0.1829.0_alpha-r1: ../../../../../../../home/chrome-bot/chrome_root/src/media/audio/linux/audio_manager_linux.cc: In function 'media::AudioManager* media::CreateAudioManager(media::AudioLogFactory*)': chromeos-chrome-34.0.1829.0_alpha-r1: ../../../../../../../home/chrome-bot/chrome_root/src/media/audio/linux/audio_manager_linux.cc:33:50: error: cannot allocate an object of abstract type 'media::AudioManagerCras' chromeos-chrome-34.0.1829.0_alpha-r1: return new AudioManagerCras(audio_log_factory); chromeos-chrome-34.0.1829.0_alpha-r1: ^ > Remove the unified IO code on the browser. > > Unified IO is not used any more and it should be removed. > > > BUG=337096 > TEST=bots, and nothing breaks. > > Review URL: https://codereview.chromium.org/153623004 TBR=xians@chromium.org Review URL: https://codereview.chromium.org/136233005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249811 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the unified IO code on the browser.xians@chromium.org2014-02-074-396/+6
| | | | | | | | | | | | Unified IO is not used any more and it should be removed. BUG=337096 TEST=bots, and nothing breaks. Review URL: https://codereview.chromium.org/153623004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249790 0039d316-1c4b-4281-b951-d872f2087c98
* Build fix when use_alsa=0.joone.hur@intel.com2014-02-061-0/+4
| | | | | | | | | | | | | | | | When use_alsa=0, there is a link error as follows: ../../media/audio/pulse/audio_manager_pulse.cc:81: error: undefined reference to 'media::AudioManagerAlsa::ShowLinuxAudioInputSettings()' collect2: error: ld returned 1 exit status ninja: build stopped: subcommand failed. This patch allows to add a guard to alsa related code to fix this link error. BUG=none Review URL: https://codereview.chromium.org/150573017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249361 0039d316-1c4b-4281-b951-d872f2087c98
* Replace MessageLoopProxy with SingleThreadTaskRunner for the rest of media/.scherkus@chromium.org2014-01-072-16/+16
| | | | | | | | | | BUG=315922 R=dalecurtis@chromium.org TBR=jam Review URL: https://codereview.chromium.org/66183002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243390 0039d316-1c4b-4281-b951-d872f2087c98
* Remove an unused OnClose() method from AudioInputCallback.tommi@chromium.org2013-12-181-3/+1
| | | | | | | | BUG=328357 Review URL: https://codereview.chromium.org/107093010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241703 0039d316-1c4b-4281-b951-d872f2087c98
* Enable platform echo cancellation through the AudioRecord path.ajm@chromium.org2013-12-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Re-land https://codereview.chromium.org/99033003/ with a CrOS build fix. TBR=tommi Including the original CL description here: Add a platform effects mask member to AudioParameters. This allows the availability of platform effects (currently AEC) to be plumbed up to MediaStreamDependencyFactory, where they can be reconciled with the media constraints to determine if the effects should be enabled. When this is the case, the constraints will be modified to disable the corresponding software effect in PeerConnection. The availability is controlled by a whitelist of device models in AudioManagerAndroid, which for AEC, currently consists of Nexus 5 and Nexus 7. AudioManagerAndroid will use the AudioRecord path iff the platform AEC is enabled. TESTED=Using apprtc on a N5 and N7 (whitelisted): - The AudioRecord input path is used. - The platform AEC is enabled and the software AEC (in PeerConnection) is disabled. - Calls have good echo cancellation quality. Using apprtc with ?audio=googEchoCancellation=false on a N5 and N7: - The OpenSLES input path is used. - Both the platform and software AEC are disabled. Using apprtc on Nexus 4 (non-whitelisted): - The OpenSLES input path is used. - The platform AEC is disabled and the software AEC is enabled. Using apprtc on Galaxy S2 (running ICS): - The OpenSLES input path is used. audio_android_unittest.cc passes on N5, N7 and Galaxy S2 Review URL: https://codereview.chromium.org/115413002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240787 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 240548 "Enable platform echo cancellation through the Aud..."hashimoto@chromium.org2013-12-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Causing compile failure on Chromium OS bots: chromeos-chrome-33.0.1738.0_alpha-r1: media/audio/cras/audio_manager_cras.cc:126:10: error: no matching constructor chromeos-chrome-33.0.1738.0_alpha-r1: for initialization of 'media::AudioParameters' chromeos-chrome-33.0.1738.0_alpha-r1: return AudioParameters( Logs: http://build.chromium.org/p/chromium.chromiumos/builders/ChromiumOS%20%28x86%29/builds/18585 http://build.chromium.org/p/chromium.chromiumos/builders/ChromiumOS%20%28amd64%29/builds/12929 http://build.chromium.org/p/chromium.chromiumos/builders/ChromiumOS%20%28daisy%29/builds/14979 http://build.chromium.org/p/chromium.memory/builders/Chromium%20OS%20%28amd64%29%20ASAN/builds/8140 http://build.chromium.org/p/chromium.memory/builders/Chromium%20OS%20%28x86%29%20ASAN/builds/7509 > Enable platform echo cancellation through the AudioRecord path. > > Add a platform effects mask member to AudioParameters. This allows the > availability of platform effects (currently AEC) to be plumbed up to > MediaStreamDependencyFactory, where they can be reconciled with the > media constraints to determine if the effects should be enabled. When > this is the case, the constraints will be modified to disable the > corresponding software effect in PeerConnection. > > The availability is controlled by a whitelist of device models in > AudioManagerAndroid, which for AEC, currently consists of Nexus 5 and > Nexus 7. > > AudioManagerAndroid will use the AudioRecord path iff the platform > AEC is enabled. > > TESTED=Using apprtc on a N5 and N7 (whitelisted): > - The AudioRecord input path is used. > - The platform AEC is enabled and the software AEC (in PeerConnection) > is disabled. > - Calls have good echo cancellation quality. > > Using apprtc with ?audio=googEchoCancellation=false on a N5 and N7: > - The OpenSLES input path is used. > - Both the platform and software AEC are disabled. > > Using apprtc on Nexus 4 (non-whitelisted): > - The OpenSLES input path is used. > - The platform AEC is disabled and the software AEC is enabled. > > Using apprtc on Galaxy S2 (running ICS): > - The OpenSLES input path is used. > > audio_android_unittest.cc passes on N5, N7 and Galaxy S2 > > TBR=jschuh > > Review URL: https://codereview.chromium.org/99033003 TBR=ajm@chromium.org Review URL: https://codereview.chromium.org/110303003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240592 0039d316-1c4b-4281-b951-d872f2087c98
* Enable platform echo cancellation through the AudioRecord path.ajm@chromium.org2013-12-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a platform effects mask member to AudioParameters. This allows the availability of platform effects (currently AEC) to be plumbed up to MediaStreamDependencyFactory, where they can be reconciled with the media constraints to determine if the effects should be enabled. When this is the case, the constraints will be modified to disable the corresponding software effect in PeerConnection. The availability is controlled by a whitelist of device models in AudioManagerAndroid, which for AEC, currently consists of Nexus 5 and Nexus 7. AudioManagerAndroid will use the AudioRecord path iff the platform AEC is enabled. TESTED=Using apprtc on a N5 and N7 (whitelisted): - The AudioRecord input path is used. - The platform AEC is enabled and the software AEC (in PeerConnection) is disabled. - Calls have good echo cancellation quality. Using apprtc with ?audio=googEchoCancellation=false on a N5 and N7: - The OpenSLES input path is used. - Both the platform and software AEC are disabled. Using apprtc on Nexus 4 (non-whitelisted): - The OpenSLES input path is used. - The platform AEC is disabled and the software AEC is enabled. Using apprtc on Galaxy S2 (running ICS): - The OpenSLES input path is used. audio_android_unittest.cc passes on N5, N7 and Galaxy S2 TBR=jschuh Review URL: https://codereview.chromium.org/99033003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240548 0039d316-1c4b-4281-b951-d872f2087c98
* Plumb AudioLog support into AudioManager.dalecurtis@chromium.org2013-12-042-6/+7
| | | | | | | | | | | | | | | | AudioManager is now also an AudioLogFactory. Changing the constructor of AudioManager isn't viable due to its psuedo-singleton behavior, so MediaInternal's AudioLogFactory must be injected after construction. The next step after this CL is to have AudioOutputDispatcherImpl objects own an AudioLog instance. BUG=260005 TEST=none, just plumbing. Review URL: https://codereview.chromium.org/99733004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238637 0039d316-1c4b-4281-b951-d872f2087c98
* Support use_alsa==0 on Linuxspang@chromium.org2013-11-281-2/+2
| | | | | | | | | | | | | | | | | | | | This moves the ALSA audio code from media/audio/linux to media/audio/alsa and splits Linux's CreateAudioManager() into a new file. This function chooses which AudioManager subclass to use on Linux. When use_alsa==0 on Linux, the fallback audio manager is changed from ALSA to a new fake implementation that always has an empty set of devices and will only return fake streams. This allows us to compile with no audio support on Linux. In particular, we can compile for targets that don't have the ALSA libraries available. Obviously, it's not (yet) possible to play audio in this configuration. BUG=318315, 318413 Review URL: https://codereview.chromium.org/89793003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237696 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the last vestiges of audio_util.dalecurtis@chromium.org2013-10-011-1/+0
| | | | | | | | | | | | | | | | | - Removes GetHighLatencyOutputBufferSize() since we no longer have any high latency users. Fallback uses a minimum 2048 buffer size in AudioOutputResampler. - Moves NumberOfWaveOutBuffers() to AudioManagerWin. Documents existing broken unit test edge case for Vista. - Moves GetUserBufferSize() to AudioManagerBase as a protected method. BUG=120319 TEST=compiles Review URL: https://codereview.chromium.org/25133002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226131 0039d316-1c4b-4281-b951-d872f2087c98
* Implement GetAudioOutputDevices for remaining platforms, consolidate tests.joi@chromium.org2013-09-161-4/+4
| | | | | | | | | | | | | | | | | | | | For Android and Cras, returning just the default device matches current behavior for input devices, although this may need to be improved in the future. For OpenBSD, the current code seems to rely on the device names list being empty, so just removing the NOTREACHED() in AudioManagerBase's empty implementation does the trick there. Note that audio_input_device_unittest.cc really should be named audio_manager_unittest.cc since AudioManager is the interface it tests. I will do this rename in a separate follow-up change to better preserve change history. TBR=vrk@chromium.org BUG=276894 Review URL: https://chromiumcodereview.appspot.com/23475037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223342 0039d316-1c4b-4281-b951-d872f2087c98
* Add AudioManager::GetAudioOutputDeviceNames and implement for pulseaudio.joi@chromium.org2013-09-052-17/+31
| | | | | | | | | TBR=vrk@chromium.org BUG=276894 Review URL: https://chromiumcodereview.appspot.com/23453022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221484 0039d316-1c4b-4281-b951-d872f2087c98
* Add the necessary scaffolding to allow creation of non-default audio output ↵tommi@chromium.org2013-09-032-1/+9
| | | | | | | | | | | | | devices. The implementation still assumes an empty device id (aka the default device), so this is only updating virtual methods and call sites. BUG=276894 R=henrika@chromium.org Review URL: https://codereview.chromium.org/23452009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@220927 0039d316-1c4b-4281-b951-d872f2087c98
* Prevent sending 0 as volume to AGC at the beginning of the audio stream.xians@chromium.org2013-08-011-2/+4
| | | | | | | | | | | We are using a timer and query the volume every 1 second, but since we don't have the correct volume at the beginning of the audio stream, we send 0 up to AGC, which will starting raising the volume from 0. This makes WebRtc audio barely usable since the volume is always set to around 0 at the beginning of the call. BUG=266048 TEST=Open http://webrtc.googlecode.com/svn/trunk/samples/js/demos/html/pc1.html, make a call, verity that the volume is not set to 0 at the beginning. Review URL: https://chromiumcodereview.appspot.com/21114004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215012 0039d316-1c4b-4281-b951-d872f2087c98
* Implement the HasAudioOutputDevices() and HasAudioInputDevices() for Pulse ↵xians@chromium.org2013-08-013-13/+40
| | | | | | | | | | | | | | | to make it correct for unittests. Some of our bots are running pulse, and out AudioManagerPulse::HasAudioOutput/InputDevices() are hard coded to be true. This will fail some of our unittests since we are expecting a non-empty list of devices from our enumeration APIs. This patch fixes the problem by implementing those two APIs instead of returning a hard-coded true. BUG=263760 TEST=content_unittests --gtest_filter="*AudioInputDevice*" Review URL: https://chromiumcodereview.appspot.com/21061003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214937 0039d316-1c4b-4281-b951-d872f2087c98
* Update include paths in media/audio for base/process changes.rsesek@chromium.org2013-07-231-1/+0
| | | | | | | | | BUG=242290 R=tommi@chromium.org Review URL: https://codereview.chromium.org/19792016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213096 0039d316-1c4b-4281-b951-d872f2087c98
* Use a direct include of the message_loop header in media/.avi@chromium.org2013-07-182-2/+2
| | | | | | | | | | BUG=260807 TEST=none TBR=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/19622002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212247 0039d316-1c4b-4281-b951-d872f2087c98
* Use a direct include of time headers in media/.avi@chromium.org2013-06-282-2/+2
| | | | | | | | | | BUG=254986 TEST=none TBR=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/18052007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209109 0039d316-1c4b-4281-b951-d872f2087c98
* Add some error information to Pulse startup failure.dalecurtis@chromium.org2013-06-081-8/+5
| | | | | | | | | | | | | While sheriffing I noticed AudioManagerPulse spewing a failure to connect context error. This change adds some additional logging so we can track down what's going on. BUG=none TEST=compiles. Review URL: https://chromiumcodereview.appspot.com/16668003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205036 0039d316-1c4b-4281-b951-d872f2087c98
* Privitize WaitTillDataReady() and DataReady().dalecurtis@chromium.org2013-06-053-4/+1
| | | | | | | | | | | | | | | | | | | | | | There's no reason for these to be called all over the code base when we know the limited circumstances under which they must be called. Making these private allows for a considerable cleanup of code. The one sketchy part about this CL is removing PollAndStartIfDataReady() for OSX. I believe stream startup times are long enough that data will always be ready though. If this is not the case and our OSX stats for DataReady() plummet, we can find a simpler solution then polling. This change also fixes inaccuracy with the UMA histogram since previously we were reporting DataReady() after WaitTilDataReady() had already been called. BUG=none TEST=audio plays w/o glitching on mac, win, linux. Review URL: https://chromiumcodereview.appspot.com/16103007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204172 0039d316-1c4b-4281-b951-d872f2087c98
* Try relanding this CL, the original CL passed the try bots but failed the ↵xians@chromium.org2013-06-034-11/+20
| | | | | | | | | | | | | | | | | | | | mac 10.7 bot because the oroginal CL queried the device info while there is no device on the bot. Hook up the device selection to the WebAudio live audio. WebAudio live audio needs to pass the session_id to the browser process so that Chrome can open the correct input device for unitfied IO. This CL looks big because it touches quite some interfaces from the render to the browser. But the change is simple and basically adding a session_id/device_id to the classes. All the changes some together and it is very hard to break it down. It also makes the media output code more similar to the media input code as well, and it will be easier to merge them for the future. TBR=henrika@chormium.org BUG=147327 TEST=http://chromium.googlecode.com/svn/trunk/samples/audio/visualizer-live.html Change the device using the camera icon on the right of the omnibox, then reload. Verify the sound is coming from the correct input device. Review URL: https://codereview.chromium.org/15979015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203695 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 203686 "Trying relanding this CL, the original CL passed ..."xians@chromium.org2013-06-034-20/+11
| | | | | | | | | | | | | | | | | | | | | | | | > Trying relanding this CL, the original CL passed the try bots but failed the mac 10.7 bot, I am keeping an eye on the bots and will revert it if it fails the bot again. > > Hook up the device selection to the WebAudio live audio. > WebAudio live audio needs to pass the session_id to the browser process so that Chrome can open the correct input device for unitfied IO. > > This CL looks big because it touches quite some interfaces from the render to the browser. But the change is simple and basically adding a session_id/device_id to the classes. All the changes some together and it is very hard to break it down. > It also makes the media output code more similar to the media input code as well, and it will be easier to merge them for the future. > > TBR=henrika@chormium.org > > BUG=147327 > TEST=http://chromium.googlecode.com/svn/trunk/samples/audio/visualizer-live.html > Change the device using the camera icon on the right of the omnibox, then reload. Verify the sound is coming from the correct input device. > > Review URL: https://codereview.chromium.org/15836006 TBR=xians@chromium.org Review URL: https://codereview.chromium.org/16325002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203690 0039d316-1c4b-4281-b951-d872f2087c98
* Trying relanding this CL, the original CL passed the try bots but failed the ↵xians@chromium.org2013-06-034-11/+20
| | | | | | | | | | | | | | | | | | | | mac 10.7 bot, I am keeping an eye on the bots and will revert it if it fails the bot again. Hook up the device selection to the WebAudio live audio. WebAudio live audio needs to pass the session_id to the browser process so that Chrome can open the correct input device for unitfied IO. This CL looks big because it touches quite some interfaces from the render to the browser. But the change is simple and basically adding a session_id/device_id to the classes. All the changes some together and it is very hard to break it down. It also makes the media output code more similar to the media input code as well, and it will be easier to merge them for the future. TBR=henrika@chormium.org BUG=147327 TEST=http://chromium.googlecode.com/svn/trunk/samples/audio/visualizer-live.html Change the device using the camera icon on the right of the omnibox, then reload. Verify the sound is coming from the correct input device. Review URL: https://codereview.chromium.org/15836006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203686 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 203427 "Hook up the device selection to the WebAudio live..."justinlin@chromium.org2013-05-314-20/+11
| | | | | | | | | | | | | | | | | | | | | | Possibly caused content_browsertests to fail on Mac. > Hook up the device selection to the WebAudio live audio. > WebAudio live audio needs to pass the session_id to the browser process so that Chrome can open the correct input device for unitfied IO. > > This CL looks big because it touches quite some interfaces from the render to the browser. But the change is simple and basically adding a session_id/device_id to the classes. All the changes some together and it is very hard to break it down. > It also makes the media output code more similar to the media input code as well, and it will be easier to merge them for the future. > > > BUG=147327 > TEST=http://chromium.googlecode.com/svn/trunk/samples/audio/visualizer-live.html > Change the device using the camera icon on the right of the omnibox, then reload. Verify the sound is coming from the correct input device. > > Review URL: https://chromiumcodereview.appspot.com/15721002 TBR=xians@chromium.org Review URL: https://codereview.chromium.org/15725013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203434 0039d316-1c4b-4281-b951-d872f2087c98
* Hook up the device selection to the WebAudio live audio.xians@chromium.org2013-05-314-11/+20
| | | | | | | | | | | | | | | | WebAudio live audio needs to pass the session_id to the browser process so that Chrome can open the correct input device for unitfied IO. This CL looks big because it touches quite some interfaces from the render to the browser. But the change is simple and basically adding a session_id/device_id to the classes. All the changes some together and it is very hard to break it down. It also makes the media output code more similar to the media input code as well, and it will be easier to merge them for the future. BUG=147327 TEST=http://chromium.googlecode.com/svn/trunk/samples/audio/visualizer-live.html Change the device using the camera icon on the right of the omnibox, then reload. Verify the sound is coming from the correct input device. Review URL: https://chromiumcodereview.appspot.com/15721002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203427 0039d316-1c4b-4281-b951-d872f2087c98
* Improved AGC update scheme for the audio backend in Chrome.henrika@chromium.org2013-05-282-5/+8
| | | | | | | | | | | | | | | This CL serves two purposes: 1) Improve the existing "mic-volume-checking"-scheme by ensuring that we no longer calls native audio functions from the core capture thread. 2) Prepare for adding AGC to the live-audio backend. TBR=tommi@chromium.org BUG=none TEST=WebRTC loopback tests in Chrome where I monitor the microphone volume while speaking into the mic. Review URL: https://codereview.chromium.org/15563004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202538 0039d316-1c4b-4281-b951-d872f2087c98
* Allow sample rate pass through on Linux.dalecurtis@google.com2013-05-242-4/+8
| | | | | | | | | | | | | | | | | | | | | Requiring the native output sample rate to avoid glitching appears to have just been an issue with a poor tlength choice. xians and I resolved this prior to turning PulseAudio on by default, but left the native sample rate requirement in at the time. Since "native sample rate" can change on the fly with PulseAudio our approach of specifying FIX_RATE was incorrect. Allowing Pulse to handle resampling lets us remove the FIX_RATE flag. It also improves CPU usage in cases where Pulse can configure the output device to match the requested sample rate. BUG=229918 TEST=extensive manual checks for glitching. R=xians@chromium.org Review URL: https://codereview.chromium.org/15957002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202233 0039d316-1c4b-4281-b951-d872f2087c98
* Add vector_math::FMUL. Replace audio_util::AdjustVolume.dalecurtis@chromium.org2013-04-082-6/+2
| | | | | | | | | | | | | | | | | | | | | | Removes the integer based volume adjustment code from the melting pot that is audio_util in favor of an AudioBus::AdjustVolume() method which works on float. The driver behind the method is a new vector_math::FMUL method which is SSE optimized. Benchmarks put it in line with the vector_math::FMAC() method. Benchmarking 200000 iterations: FMUL_C took 1962.52ms. FMUL_SSE (unaligned size) took 493.03ms; which is 3.98x faster than FMUL_C. FMUL_SSE (aligned size) took 491.79ms; which is 3.99x faster than FMUL_C and 1.00x faster than FMUL_SSE (unaligned size). BUG=120319, 171540, 226447 TEST=new media_unittests. Review URL: https://chromiumcodereview.appspot.com/13726011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192905 0039d316-1c4b-4281-b951-d872f2087c98
* Rewrite scoped_array<T> to scoped_ptr<T[]> in media/ and webkit/.dcheng@chromium.org2013-04-072-2/+2
| | | | | | | | | | This changelist was automatically generated using a clang tool. BUG=171111 Review URL: https://codereview.chromium.org/13752002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192779 0039d316-1c4b-4281-b951-d872f2087c98
* Added the unified IO on Linux.xians@chromium.org2013-03-288-194/+606
| | | | | | | | | | | | | This patch uses PulseAudio threaded mainloop to add a unified input and output implementation to Linux. The implementation is used only by webaudio live audio. BUG=145092 TEST=http://www.corp.google.com/~henrika/no_crawl/mic_effect_send_to_peer.html http://chromium.googlecode.com/svn/trunk/samples/audio/visualizer-live.html Review URL: https://chromiumcodereview.appspot.com/13031007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191247 0039d316-1c4b-4281-b951-d872f2087c98
* Linux: add an option to link pulseaudio directly (DT_NEEDED).phajdan.jr@chromium.org2013-03-261-1/+6
| | | | | | | | | | Useful for Linux distros. BUG=none Review URL: https://codereview.chromium.org/12634033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190692 0039d316-1c4b-4281-b951-d872f2087c98
* Fixed the media_unittests for pulseaudio.xians@chromium.org2013-03-262-15/+16
| | | | | | | | | | | | | We should remove the thread check on pulse_input.cc since the unittest will create the input stream on another thread rather than the AudioManager thread. And the SetVolume() is asynchrnous on Pulse so we have to handle it in our AudioInputVolumeTest. BUG=221992 TEST=media_unittests Review URL: https://codereview.chromium.org/12729011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190677 0039d316-1c4b-4281-b951-d872f2087c98
* Remove unused parameter to OnError()jrummell@chromium.org2013-03-232-6/+5
| | | | | | | | | | | | This change removes the error_code parameter to OnError() calls as the parameter is not used when ending up in AudioRendererHost. BUG=218641 Review URL: https://chromiumcodereview.appspot.com/12611030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190087 0039d316-1c4b-4281-b951-d872f2087c98
* Reland r186180 after fixing the --audio-buffer-size flag and cras issue.xians@chromium.org2013-03-072-17/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | In addition to relanding r186180, this patch gets back the --audio-buffer-size flag support and also fixed the audio issue in cras. The review for r186180 is https://codereview.chromium.org/12316131/ Moved AudioUtil static functions: GetAudioHardwareSampleRate GetAudioInputHardwareSampleRate GetAudioHardwareBufferSize GetAudioInputHardwareChannelLayout to AudioManager interfaces: GetDefaultOutputStreamParameters() GetDefaultInputStreamParameters(const std::string& device_id) By doing this, we remove the messy ifdef statements in AudioUtil, allow getting the native sample rate for Pulse, each AudioManager is responsible for providing the optimal audio params to achieve the best audio performance, for example, cras can raise the buffer size to reduce CPU consumption without affecting other Linux products. TBR=dalecurtis@chromium.org BUG=178142, 137326, 120319 TEST=media_unittests, content_unittests Review URL: https://codereview.chromium.org/12602002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186698 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 186180 "Moved AudioUtil static functions:"hshi@chromium.org2013-03-072-39/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | > Moved AudioUtil static functions: > GetAudioHardwareSampleRate > GetAudioInputHardwareSampleRate > GetAudioHardwareBufferSize > GetAudioInputHardwareChannelLayout > to AudioManager interfaces: > GetDefaultOutputStreamParameters() > GetDefaultInputStreamParameters(const std::string& device_id) > > By doing this, we remove the messy ifdef statements in AudioUtil, allow getting the native sample rate for Pulse, each AudioManager is responsible for providing the optimal audio params to achieve the best audio performance, for example, cras can raise the buffer size to reduce CPU consumption without affecting other Linux products. > > > BUG=178142, 137326, 120319 > TEST=media_unittests, content_unittests > > Review URL: https://chromiumcodereview.appspot.com/12316131 BUG=180682 TBR=xians@chromium.org TBR=dalecurtis@chromium.org Review URL: https://codereview.chromium.org/12440008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186566 0039d316-1c4b-4281-b951-d872f2087c98
* Fix some minor issues on pulse input before enabling pulse by default.xians@chromium.org2013-03-062-4/+6
| | | | | | | | | | We need to destroy the pulse objects after Shutdown(). Also change one DLOG(WARNING) to DVLOG(1) because it seems to happen quite often. Review URL: https://chromiumcodereview.appspot.com/12542004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186531 0039d316-1c4b-4281-b951-d872f2087c98
* Moved AudioUtil static functions:xians@chromium.org2013-03-052-18/+39
| | | | | | | | | | | | | | | | | | | | GetAudioHardwareSampleRate GetAudioInputHardwareSampleRate GetAudioHardwareBufferSize GetAudioInputHardwareChannelLayout to AudioManager interfaces: GetDefaultOutputStreamParameters() GetDefaultInputStreamParameters(const std::string& device_id) By doing this, we remove the messy ifdef statements in AudioUtil, allow getting the native sample rate for Pulse, each AudioManager is responsible for providing the optimal audio params to achieve the best audio performance, for example, cras can raise the buffer size to reduce CPU consumption without affecting other Linux products. BUG=178142,137326,120319 TEST=media_unittests, content_unittests Review URL: https://chromiumcodereview.appspot.com/12316131 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186180 0039d316-1c4b-4281-b951-d872f2087c98
* Always fully fill PulseAudio's requested buffer. Allow larger initial requests.dalecurtis@chromium.org2013-03-011-41/+37
| | | | | | | | | | | | | | | | | Instead of forcing PulseAudio to always call us with a buffer size matching our requested size, let it automatically choose its initial buffers and only ask for our requested size in steady state. Doing this requires using a WaitTillDataReady() for those times when we need to fill a larger buffer than we expect. BUG=32757 NOTRY=true TEST=no more PulseAudio glitching when using native sample rate. Review URL: https://chromiumcodereview.appspot.com/12328097 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185593 0039d316-1c4b-4281-b951-d872f2087c98