|
|
Chromium Code Reviews|
Created:
3 years, 10 months ago by DaleCurtis Modified:
3 years, 10 months ago CC:
chromium-reviews, feature-media-reviews_chromium.org, mac-reviews_chromium.org Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionUse preferred channel layout on macOS instead of total channel count.
The old GetDeviceChannels() method returns the total number of channels
on a device, not necessarily how many its configured to use. For devices
which allocate ranges of channels to different behaviors (mirroring, etc)
this is completely broken.
Instead use kAudioDevicePropertyPreferredChannelLayout, which seems to
give us the right information in both the input and output cases. This
sometimes requires us to make an additional call to convert the given
information into something we can easily parse.
BUG=671308
TEST=manual; configure 6 channel virtual device as stereo.
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Review-Url: https://codereview.chromium.org/2695633006
Cr-Commit-Position: refs/heads/master@{#453023}
Committed: https://chromium.googlesource.com/chromium/src/+/d0beea4e2d9c11e6ab4f94eea91c4b6b87104a56
Patch Set 1 #Patch Set 2 : Fix discrete layouts. #Patch Set 3 : Fix compilation issues. #
Messages
Total messages: 27 (11 generated)
Description was changed from ========== Use preferred channel layout on macOS instead of total channel count. The old GetDeviceChannels() method returns the total number of channels on a device, not necessarily how many its configured to use. For devices which allocate ranges of channels to different behaviors (mirroring, etc) this is completely broken. Instead use kAudioDevicePropertyPreferredChannelLayout, which seems to give us the right information in both the input and output cases. This sometimes requires us to make an additional call to convert the given information into something we can easily parse. BUG=671308 TEST=manual; configure 6 channel virtual device as stereo. ========== to ========== Use preferred channel layout on macOS instead of total channel count. The old GetDeviceChannels() method returns the total number of channels on a device, not necessarily how many its configured to use. For devices which allocate ranges of channels to different behaviors (mirroring, etc) this is completely broken. Instead use kAudioDevicePropertyPreferredChannelLayout, which seems to give us the right information in both the input and output cases. This sometimes requires us to make an additional call to convert the given information into something we can easily parse. BUG=671308 TEST=manual; configure 6 channel virtual device as stereo. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel ==========
dalecurtis@chromium.org changed reviewers: + hongchan@chromium.org
+hongchan again for review. I've tested this with a virtual 5.1 device, but it'd be neat if you could configure your 16 channel unit for stereo or something and verify it plays correctly.
The CQ bit was checked by dalecurtis@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: chromeos_daisy_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL) chromium_presubmit on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL) linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL) linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL) linux_chromium_compile_dbg_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL) linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL) linux_chromium_tsan_rel_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL) linux_optional_gpu_tests_rel on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL)
dalecurtis@chromium.org changed reviewers: + tommi@chromium.org
+tommi too since this affects the input side too, but should only be a positive change (famous last words!)
lgtm CF
On 2017/02/16 19:38:25, tommi (krómíum) wrote: > lgtm > > CF Ugh, my virtual keyboard added that...
On 2017/02/16 19:39:15, tommi (krómíum) wrote: > On 2017/02/16 19:38:25, tommi (krómíum) wrote: > > lgtm > > > > CF > > Ugh, my virtual keyboard added that... I just tried this patch with the link on the bug, and got no sound. For testing, I used FCA1616 (16 outs) and configured the speaker setup to |stereo|. Even when I tried the same link with 7.1 surround setup, I got no sound. (This works fine on the stable version m56.) So this patch does not seem to be working as intended. What should we do?
On 2017/02/16 at 22:01:37, hongchan wrote: > On 2017/02/16 19:39:15, tommi (krómíum) wrote: > > On 2017/02/16 19:38:25, tommi (krómíum) wrote: > > > lgtm > > > > > > CF > > > > Ugh, my virtual keyboard added that... > > I just tried this patch with the link on the bug, and got no sound. > For testing, I used FCA1616 (16 outs) and configured the speaker > setup to |stereo|. > > Even when I tried the same link with 7.1 surround setup, I got no > sound. (This works fine on the stable version m56.) > > So this patch does not seem to be working as intended. What > should we do? Interesting! Which link? This link? http://storage.googleapis.com/dalecurtis/mse.html?src=sync1.mp3&type=mp3 - what does chrome://media-internals say about the input/output streams.
On 2017/02/16 at 22:03:14, DaleCurtis wrote: > On 2017/02/16 at 22:01:37, hongchan wrote: > > On 2017/02/16 19:39:15, tommi (krómíum) wrote: > > > On 2017/02/16 19:38:25, tommi (krómíum) wrote: > > > > lgtm > > > > > > > > CF > > > > > > Ugh, my virtual keyboard added that... > > > > I just tried this patch with the link on the bug, and got no sound. > > For testing, I used FCA1616 (16 outs) and configured the speaker > > setup to |stereo|. > > > > Even when I tried the same link with 7.1 surround setup, I got no > > sound. (This works fine on the stable version m56.) > > > > So this patch does not seem to be working as intended. What > > should we do? > > Interesting! Which link? This link? http://storage.googleapis.com/dalecurtis/mse.html?src=sync1.mp3&type=mp3 - what does chrome://media-internals say about the input/output streams. Err output controller and output streams.
On 2017/02/16 22:03:23, DaleCurtis wrote: > On 2017/02/16 at 22:03:14, DaleCurtis wrote: > > On 2017/02/16 at 22:01:37, hongchan wrote: > > > On 2017/02/16 19:39:15, tommi (krómíum) wrote: > > > > On 2017/02/16 19:38:25, tommi (krómíum) wrote: > > > > > lgtm > > > > > > > > > > CF > > > > > > > > Ugh, my virtual keyboard added that... > > > > > > I just tried this patch with the link on the bug, and got no sound. > > > For testing, I used FCA1616 (16 outs) and configured the speaker > > > setup to |stereo|. > > > > > > Even when I tried the same link with 7.1 surround setup, I got no > > > sound. (This works fine on the stable version m56.) > > > > > > So this patch does not seem to be working as intended. What > > > should we do? > > > > Interesting! Which link? This link? > http://storage.googleapis.com/dalecurtis/mse.html?src=sync1.mp3&type=mp3 - what > does chrome://media-internals say about the input/output streams. > > Err output controller and output streams. I tried this: https://t.co/9897j9sfY7
On 2017/02/16 22:04:05, hongchan wrote: > On 2017/02/16 22:03:23, DaleCurtis wrote: > > On 2017/02/16 at 22:03:14, DaleCurtis wrote: > > > On 2017/02/16 at 22:01:37, hongchan wrote: > > > > On 2017/02/16 19:39:15, tommi (krómíum) wrote: > > > > > On 2017/02/16 19:38:25, tommi (krómíum) wrote: > > > > > > lgtm > > > > > > > > > > > > CF > > > > > > > > > > Ugh, my virtual keyboard added that... > > > > > > > > I just tried this patch with the link on the bug, and got no sound. > > > > For testing, I used FCA1616 (16 outs) and configured the speaker > > > > setup to |stereo|. > > > > > > > > Even when I tried the same link with 7.1 surround setup, I got no > > > > sound. (This works fine on the stable version m56.) > > > > > > > > So this patch does not seem to be working as intended. What > > > > should we do? > > > > > > Interesting! Which link? This link? > > http://storage.googleapis.com/dalecurtis/mse.html?src=sync1.mp3&type=mp3 - > what > > does chrome://media-internals say about the input/output streams. > > > > Err output controller and output streams. > > I tried this: https://t.co/9897j9sfY7 # setup - PS3 - FCA 1616 - Speaker config: 7.1 surround 1. layout test crashes immediately: chromium/src/third_party/WebKit/ManualTests/webaudio/multichannel.html crashes at: https://cs.chromium.org/chromium/src/content/renderer/renderer_blink_platform... 2. The test audio file above produces the stereo (ch#1, ch#2). 3. chrome://media-internals says the channel layout is stereo and the channel count is 2.
On 2017/02/21 19:19:26, hongchan wrote: > On 2017/02/16 22:04:05, hongchan wrote: > > On 2017/02/16 22:03:23, DaleCurtis wrote: > > > On 2017/02/16 at 22:03:14, DaleCurtis wrote: > > > > On 2017/02/16 at 22:01:37, hongchan wrote: > > > > > On 2017/02/16 19:39:15, tommi (krómíum) wrote: > > > > > > On 2017/02/16 19:38:25, tommi (krómíum) wrote: > > > > > > > lgtm > > > > > > > > > > > > > > CF > > > > > > > > > > > > Ugh, my virtual keyboard added that... > > > > > > > > > > I just tried this patch with the link on the bug, and got no sound. > > > > > For testing, I used FCA1616 (16 outs) and configured the speaker > > > > > setup to |stereo|. > > > > > > > > > > Even when I tried the same link with 7.1 surround setup, I got no > > > > > sound. (This works fine on the stable version m56.) > > > > > > > > > > So this patch does not seem to be working as intended. What > > > > > should we do? > > > > > > > > Interesting! Which link? This link? > > > http://storage.googleapis.com/dalecurtis/mse.html?src=sync1.mp3&type=mp3 - > > what > > > does chrome://media-internals say about the input/output streams. > > > > > > Err output controller and output streams. > > > > I tried this: https://t.co/9897j9sfY7 > > > # setup > - PS3 > - FCA 1616 > - Speaker config: 7.1 surround > > 1. layout test crashes immediately: > chromium/src/third_party/WebKit/ManualTests/webaudio/multichannel.html > crashes at: > https://cs.chromium.org/chromium/src/content/renderer/renderer_blink_platform... > > 2. The test audio file above produces the stereo (ch#1, ch#2). > > 3. chrome://media-internals says the channel layout is stereo and the channel > count is 2. I patched the crash by commenting out 'NOTREACHED()', but now it crashes on a different spot: https://cs.chromium.org/chromium/src/media/audio/audio_output_device.cc?q=aud... [24656:775:0221/130200.540715:FATAL:audio_output_device.cc(94)] Check failed: params.IsValid(). 0 libbase.dylib 0x000000010660adae base::debug::StackTrace::StackTrace(unsigned long) + 174 1 libbase.dylib 0x000000010660ae4d base::debug::StackTrace::StackTrace(unsigned long) + 29 2 libbase.dylib 0x000000010660929c base::debug::StackTrace::StackTrace() + 28 3 libbase.dylib 0x00000001066a4280 logging::LogMessage::~LogMessage() + 80 4 libbase.dylib 0x00000001066a1d85 logging::LogMessage::~LogMessage() + 21 5 libmedia.dylib 0x000000012c03326a media::AudioOutputDevice::Initialize(media::AudioParameters const&, media::AudioRendererSink::RenderCallback*) + 378 6 libcontent.dylib 0x0000000122efa7a6 content::RendererWebAudioDeviceImpl::start() + 742 7 libblink_platform.dylib 0x000000013309d4b7 blink::AudioDestination::start() + 119 8 libblink_modules.dylib 0x000000013e92cf21 blink::DefaultAudioDestinationHandler::setChannelCount(unsigned long, blink::ExceptionState&) + 689 9 libblink_modules.dylib 0x000000013e8c55b4 blink::AudioNode::setChannelCount(unsigned long, blink::ExceptionState&) + 68 10 libblink_modules.dylib 0x000000013df1668d blink::AudioNodeV8Internal::channelCountAttributeSetter(v8::Local<v8::Value>, v8::FunctionCallbackInfo<v8::Value> const&) + 317 11 libblink_modules.dylib 0x000000013df1651d blink::V8AudioNode::channelCountAttributeSetterCallback(v8::FunctionCallbackInfo<v8::Value> const&) + 461 12 libv8.dylib 0x000000011a1ec792 v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) + 450 13 libv8.dylib 0x000000011a2c760a v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) + 970 14 libv8.dylib 0x000000011a2c65f1 v8::internal::Builtins::InvokeApiFunction(v8::internal::Isolate*, bool, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*, v8::internal::Handle<v8::internal::HeapObject>) + 1041 15 libv8.dylib 0x000000011a8b85cf v8::internal::Object::SetPropertyWithAccessor(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::Object::ShouldThrow) + 607 16 libv8.dylib 0x000000011a8c9aca v8::internal::Object::SetPropertyInternal(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::LanguageMode, v8::internal::Object::StoreFromKeyed, bool*) + 634 17 libv8.dylib 0x000000011a8c9767 v8::internal::Object::SetProperty(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::LanguageMode, v8::internal::Object::StoreFromKeyed) + 71 18 libv8.dylib 0x000000011a7e310a v8::internal::StoreIC::Store(v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Name>, v8::internal::Handle<v8::internal::Object>, v8::internal::Object::StoreFromKeyed) + 810 19 libv8.dylib 0x000000011a7e9473 v8::internal::__RT_impl_Runtime_StoreIC_Miss(v8::internal::Arguments, v8::internal::Isolate*) + 803 20 ??? 0x0000254977204209 0x0 + 40997461443081
Hmm, can you change the DVLOG(1)'s in AMMac to LOG(ERROR) and see what reported channel values are coming back? Is this the first time you've tried the 16 channel device in a debug/dcheck_on build?
On 2017/02/21 21:22:51, DaleCurtis wrote: > Hmm, can you change the DVLOG(1)'s in AMMac to LOG(ERROR) and see what reported > channel values are coming back? Is this the first time you've tried the 16 > channel device in a debug/dcheck_on build? In short, the report channel count is 16 which is correct. Here's the stack trace: [25478:775:0223/101026.097605:ERROR:audio_manager_mac.cc(331)] Output total channels: 16 [25610:775:0223/101026.101558:FATAL:audio_output_device.cc(94)] Check failed: params.IsValid(). 0 libbase.dylib 0x000000010a23bb5e base::debug::StackTrace::StackTrace(unsigned long) + 174 1 libbase.dylib 0x000000010a23bbfd base::debug::StackTrace::StackTrace(unsigned long) + 29 2 libbase.dylib 0x000000010a23a05c base::debug::StackTrace::StackTrace() + 28 3 libbase.dylib 0x000000010a2d5040 logging::LogMessage::~LogMessage() + 80 4 libbase.dylib 0x000000010a2d2b45 logging::LogMessage::~LogMessage() + 21 5 libmedia.dylib 0x000000012e6d34fa media::AudioOutputDevice::Initialize(media::AudioParameters const&, media::AudioRendererSink::RenderCallback*) + 378 6 libcontent.dylib 0x0000000125522086 content::RendererWebAudioDeviceImpl::start() + 742 7 libblink_platform.dylib 0x0000000135787ef7 blink::AudioDestination::start() + 119 8 libblink_modules.dylib 0x000000014101a801 blink::DefaultAudioDestinationHandler::setChannelCount(unsigned long, blink::ExceptionState&) + 689 9 libblink_modules.dylib 0x0000000140fb2e94 blink::AudioNode::setChannelCount(unsigned long, blink::ExceptionState&) + 68 10 libblink_modules.dylib 0x0000000140602f2d blink::AudioNodeV8Internal::channelCountAttributeSetter(v8::Local<v8::Value>, v8::FunctionCallbackInfo<v8::Value> const&) + 317 11 libblink_modules.dylib 0x0000000140602dbd blink::V8AudioNode::channelCountAttributeSetterCallback(v8::FunctionCallbackInfo<v8::Value> const&) + 461 12 libv8.dylib 0x0000000108d280a2 v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) + 450 13 libv8.dylib 0x0000000108e02f4a v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) + 970 14 libv8.dylib 0x0000000108e01f31 v8::internal::Builtins::InvokeApiFunction(v8::internal::Isolate*, bool, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*, v8::internal::Handle<v8::internal::HeapObject>) + 1041 15 libv8.dylib 0x00000001093f676f v8::internal::Object::SetPropertyWithAccessor(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::Object::ShouldThrow) + 607 16 libv8.dylib 0x000000010940821a v8::internal::Object::SetPropertyInternal(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::LanguageMode, v8::internal::Object::StoreFromKeyed, bool*) + 634 17 libv8.dylib 0x0000000109407eb7 v8::internal::Object::SetProperty(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::LanguageMode, v8::internal::Object::StoreFromKeyed) + 71 18 libv8.dylib 0x0000000109320dfa v8::internal::StoreIC::Store(v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Name>, v8::internal::Handle<v8::internal::Object>, v8::internal::Object::StoreFromKeyed) + 810 19 libv8.dylib 0x0000000109327163 v8::internal::__RT_impl_Runtime_StoreIC_Miss(v8::internal::Arguments, v8::internal::Isolate*) + 803 20 ??? 0x0000315ba9f84204 0x0 + 54269763404292
The CQ bit was checked by dalecurtis@chromium.org
hongchan@ verified offline that this is now working correctly after http://crrev.com/452672 so sending to the CQ now. Thanks!
The patchset sent to the CQ was uploaded after l-g-t-m from tommi@chromium.org Link to the patchset: https://codereview.chromium.org/2695633006/#ps40001 (title: "Fix compilation issues.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
late lgtm. Thanks for this fix!
CQ is committing da patch.
Bot data: {"patchset_id": 40001, "attempt_start_ts": 1487975790013530,
"parent_rev": "3e76d48cd877318c04d16f1b5552d6499141857b", "commit_rev":
"d0beea4e2d9c11e6ab4f94eea91c4b6b87104a56"}
Message was sent while issue was closed.
Description was changed from ========== Use preferred channel layout on macOS instead of total channel count. The old GetDeviceChannels() method returns the total number of channels on a device, not necessarily how many its configured to use. For devices which allocate ranges of channels to different behaviors (mirroring, etc) this is completely broken. Instead use kAudioDevicePropertyPreferredChannelLayout, which seems to give us the right information in both the input and output cases. This sometimes requires us to make an additional call to convert the given information into something we can easily parse. BUG=671308 TEST=manual; configure 6 channel virtual device as stereo. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel ========== to ========== Use preferred channel layout on macOS instead of total channel count. The old GetDeviceChannels() method returns the total number of channels on a device, not necessarily how many its configured to use. For devices which allocate ranges of channels to different behaviors (mirroring, etc) this is completely broken. Instead use kAudioDevicePropertyPreferredChannelLayout, which seems to give us the right information in both the input and output cases. This sometimes requires us to make an additional call to convert the given information into something we can easily parse. BUG=671308 TEST=manual; configure 6 channel virtual device as stereo. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Review-Url: https://codereview.chromium.org/2695633006 Cr-Commit-Position: refs/heads/master@{#453023} Committed: https://chromium.googlesource.com/chromium/src/+/d0beea4e2d9c11e6ab4f94eea91c... ==========
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/d0beea4e2d9c11e6ab4f94eea91c... |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
