Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: media/audio/mac/audio_low_latency_input_mac.cc

Issue 1017683002: Fixes audio issue on Mac for USB headsets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/audio/mac/audio_low_latency_input_mac.h" 5 #include "media/audio/mac/audio_low_latency_input_mac.h"
6 6
7 #include <CoreServices/CoreServices.h> 7 #include <CoreServices/CoreServices.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 // Receive audio from the AUHAL from the output scope of the Audio Unit. 489 // Receive audio from the AUHAL from the output scope of the Audio Unit.
490 OSStatus result = AudioUnitRender(audio_input->audio_unit(), 490 OSStatus result = AudioUnitRender(audio_input->audio_unit(),
491 flags, 491 flags,
492 time_stamp, 492 time_stamp,
493 bus_number, 493 bus_number,
494 number_of_frames, 494 number_of_frames,
495 audio_input->audio_buffer_list()); 495 audio_input->audio_buffer_list());
496 if (result) { 496 if (result) {
497 UMA_HISTOGRAM_SPARSE_SLOWLY("Media.AudioInputCbErrorMac", result); 497 UMA_HISTOGRAM_SPARSE_SLOWLY("Media.AudioInputCbErrorMac", result);
498 OSSTATUS_DLOG(ERROR, result) << "AudioUnitRender() failed "; 498 OSSTATUS_DLOG(ERROR, result) << "AudioUnitRender() failed ";
499 audio_input->HandleError(result); 499 if (result != kAudioUnitErr_TooManyFramesToProcess) {
500 // We avoid stopping the stream for kAudioUnitErr_TooManyFramesToProcess
501 // since it has been observed that some USB headsets can cause this error
502 // but only for a few initial frames at startup and then then the stream
DaleCurtis 2015/03/18 22:09:06 Since you explicitly mention that this returns to
no longer working on chromium 2015/03/18 22:15:01 It is a bit hard to define the threshold since it
503 // returns to a stable state again.
504 // See b/19524368 for details.
505 audio_input->HandleError(result);
506 }
500 return result; 507 return result;
501 } 508 }
502 509
503 // Deliver recorded data to the consumer as a callback. 510 // Deliver recorded data to the consumer as a callback.
504 return audio_input->Provide(number_of_frames, 511 return audio_input->Provide(number_of_frames,
505 audio_input->audio_buffer_list(), 512 audio_input->audio_buffer_list(),
506 time_stamp); 513 time_stamp);
507 } 514 }
508 515
509 OSStatus AUAudioInputStream::Provide(UInt32 number_of_frames, 516 OSStatus AUAudioInputStream::Provide(UInt32 number_of_frames,
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 kAudioDevicePropertyScopeInput, 693 kAudioDevicePropertyScopeInput,
687 static_cast<UInt32>(channel) 694 static_cast<UInt32>(channel)
688 }; 695 };
689 OSStatus result = AudioObjectIsPropertySettable(input_device_id_, 696 OSStatus result = AudioObjectIsPropertySettable(input_device_id_,
690 &property_address, 697 &property_address,
691 &is_settable); 698 &is_settable);
692 return (result == noErr) ? is_settable : false; 699 return (result == noErr) ? is_settable : false;
693 } 700 }
694 701
695 } // namespace media 702 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698