CRAS: need api for "map stream left and right to mono, then play that mono stream to the left and right speaker" |
||||||||||||
Issue descriptionFor accessibility we need a way to mix all channels of a stream, then play the resulting mono stream to all output channel. hychao, is the channel mapping api flexible enough to do this? It might be easier to have an option that can be set globally so the clients don't each need to set a channel map.
,
Mar 9 2016
I am the owner of issue 404701, can be added to this thread for discussion and update. hychao: where is cras_audio_area?
,
Mar 10 2016
At https://chromium.googlesource.com/chromiumos/third_party/adhd/+/master/cras/src/server/cras_audio_area.c It's used in CRAS server side for a more flexible audio mixing. Two functions are useful to understand how it is used: cras_audio_area_config_channels(), cras_audio_area_copy() Basically like Dylan suggested, we need to have a flag so that when it's set, server side will rewrite the channel bit sets from [ FL, FR] to [ FL|FR, FL|FR ].
,
Mar 10 2016
hychao, can you own adding that flag, or maybe a more general API for setting a downmix matrix for all output?
,
Mar 10 2016
Sure. Looks like we want to have this apply to affect all streams, maybe add a dbus method is suitable to configure this.
,
Mar 10 2016
sounds like the right idea to me. Please add a libcras API too so that we can use it from cheets systems.
,
Mar 10 2016
hychao, thanks, I see it is a different code base. Will this API be added to https://code.google.com/p/chromium/codesearch#chromium/src/third_party/cros_system_api/dbus/service_constants.h ?
,
Mar 11 2016
Dylan: I will create the same API in libcras. warx: Yes the new API will be added there, together with the methods under 'kCrasControlInterface', most of which are now called by src/chromeos/dbus/cras_audio_client.cc I will think about the interface detail and update on this issue.
,
Mar 14 2016
There is code in cras_fmt_conv can reuse for this purpose, using N * N float matrix to remix N-channel audio data.
In this case we just need to allocate a global 2*2 matrix.
[ 0.5 0.5 ]
[ 0.5 0.5 ]
Suggest the dbus API to be like.
dbus-send --system --type=method_call --print-reply \
--dest=org.chromium.cras /org/chromium/cras \
org.chromium.cras.Control.SetGlobalChannelRemix uint32:2 array:double:0.5,0.5,0.5,0.5
,
Mar 16 2016
hychao: Do you have a timeline about when it is landed?
,
Mar 17 2016
I have working patches already, will upload for review after some more testing today. Let's assume they got merged earlier next week, then I can add the new API to cros_system_api/dbus/service_constants.h
,
Mar 17 2016
Glad to hear it. Thanks.
,
Mar 17 2016
,
Mar 17 2016
@hychao, would this still make it into M51? If this change gets merged early next week, that seems like plenty of time to get it into M51 (feature freeze: Mar 25; branch: Apr 08).
,
Mar 21 2016
I am OK to merge to M51. How's the Chrome UI side change?
,
Mar 21 2016
hychao, We are OK to make it into M51 on 404701, once this API is ready.
,
Mar 22 2016
,
Mar 25 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/adhd/+/2cc79ec9a81d62c9741b489b26c1d2a6660131dd commit 2cc79ec9a81d62c9741b489b26c1d2a6660131dd Author: Hsin-Yu Chao <hychao@chromium.org> Date: Thu Mar 17 09:19:20 2016 CRAS: dbus_control - Add SetGlobalOutputChannelRemix method For accessibility purpose, we need to let user mix audio from all output channels and then write it to all channels of device. Expose dbus method to set the conversion matrix for global output channel remix, so that Chrome UI will use this API to let user configure how they want the audio to be remixed. BUG= chromium:593218 TEST=Play speaker test on YouTube, execute "dbus-send --system --type=method_call --print-reply --dest=org.chromium.cras /org/chromium/cras org.chromium.cras.Control.SetGlobalOutputChannelRemix int32:2 array:double:0.5,0.5,0.5,0.5" to verify all channels are mixed together. Change-Id: Ib58e133932aa9daa79642da9bcc5004bddc75ae1 Reviewed-on: https://chromium-review.googlesource.com/333252 Commit-Ready: Hsinyu Chao <hychao@chromium.org> Tested-by: Hsinyu Chao <hychao@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org> [modify] https://crrev.com/2cc79ec9a81d62c9741b489b26c1d2a6660131dd/cras/src/server/cras_dbus_control.c [modify] https://crrev.com/2cc79ec9a81d62c9741b489b26c1d2a6660131dd/cras/README.dbus-api
,
Mar 25 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/adhd/+/f4d68a96948ce913348cc35ba34d9202014a9bdb commit f4d68a96948ce913348cc35ba34d9202014a9bdb Author: Hsin-Yu Chao <hychao@chromium.org> Date: Wed Mar 16 10:45:10 2016 CRAS: client - API to config global remix BUG= chromium:593218 TEST=Play left/right speaker test on YouTube. "cras_test_client --config_global_remix 2:0.5,0.5,0.5,0.5" to verify that both channels are mixed. "cras_test_client --config_global_remix 2:0.1,0.9,0.9,0.1" to verify that both channels are switched. "cras_test_client --config_global_remix 2:1,0,0,1" to verify left/right channels are back to normal. Change-Id: I4386cc3e14a9645dfee3649243cce23a051a0b04 Reviewed-on: https://chromium-review.googlesource.com/333251 Commit-Ready: Hsinyu Chao <hychao@chromium.org> Tested-by: Hsinyu Chao <hychao@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org> [modify] https://crrev.com/f4d68a96948ce913348cc35ba34d9202014a9bdb/cras/src/tests/iodev_list_unittest.cc [modify] https://crrev.com/f4d68a96948ce913348cc35ba34d9202014a9bdb/cras/src/tests/iodev_unittest.cc [modify] https://crrev.com/f4d68a96948ce913348cc35ba34d9202014a9bdb/cras/src/tests/cras_test_client.c [modify] https://crrev.com/f4d68a96948ce913348cc35ba34d9202014a9bdb/cras/src/tests/rclient_unittest.cc [modify] https://crrev.com/f4d68a96948ce913348cc35ba34d9202014a9bdb/cras/src/libcras/cras_client.h [modify] https://crrev.com/f4d68a96948ce913348cc35ba34d9202014a9bdb/cras/src/server/audio_thread.c [modify] https://crrev.com/f4d68a96948ce913348cc35ba34d9202014a9bdb/cras/src/tests/audio_thread_unittest.cc [modify] https://crrev.com/f4d68a96948ce913348cc35ba34d9202014a9bdb/cras/src/server/audio_thread.h [modify] https://crrev.com/f4d68a96948ce913348cc35ba34d9202014a9bdb/cras/src/common/cras_messages.h [modify] https://crrev.com/f4d68a96948ce913348cc35ba34d9202014a9bdb/cras/src/server/cras_iodev.c [modify] https://crrev.com/f4d68a96948ce913348cc35ba34d9202014a9bdb/cras/src/libcras/cras_client.c [modify] https://crrev.com/f4d68a96948ce913348cc35ba34d9202014a9bdb/cras/src/server/cras_rclient.c
,
Mar 25 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/adhd/+/82bbc68832fccb257d83a56e35a4d50b5f82a173 commit 82bbc68832fccb257d83a56e35a4d50b5f82a173 Author: Hsin-Yu Chao <hychao@chromium.org> Date: Mon Mar 14 09:47:47 2016 CRAS: fmt_conv - Add channel remix support For accessibility use we need to mix all channels of output stream and then write to all output channels. Reuse cras_fmt_conv to remix channels of PCM data according to given conversion matrix. This new remix converter will be added to the end of output format conversion chain. fmt_conv1 stream1 ----------\ \ mix O ----------> O --------> device fmt_conv2 / channel remix stream2 ----------/ ... fmt_convN streamN ----------/ BUG= chromium:593218 TEST=unittest Change-Id: I79e66fa890c1b9736ba8c1b16a6261b97e50adb6 Reviewed-on: https://chromium-review.googlesource.com/333250 Commit-Ready: Hsinyu Chao <hychao@chromium.org> Tested-by: Hsinyu Chao <hychao@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org> [modify] https://crrev.com/82bbc68832fccb257d83a56e35a4d50b5f82a173/cras/src/tests/fmt_conv_unittest.cc [modify] https://crrev.com/82bbc68832fccb257d83a56e35a4d50b5f82a173/cras/src/server/cras_fmt_conv.c [modify] https://crrev.com/82bbc68832fccb257d83a56e35a4d50b5f82a173/cras/src/server/cras_fmt_conv.h
,
Mar 25 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform/system_api/+/452060bb03235f1241f5822f326f2abbc936e656 commit 452060bb03235f1241f5822f326f2abbc936e656 Author: Hsin-Yu Chao <hychao@chromium.org> Date: Fri Mar 25 11:14:30 2016 service_constants: Add SetGlobalOutputChannelRemix property The new dbus method will be used by Chrome UI to configure output remix for accessibility use. BUG= chromium:593218 TEST=None Change-Id: I7b90a98fecfb3a35f2133e40cf374ffbba96fb9c Reviewed-on: https://chromium-review.googlesource.com/335011 Commit-Ready: Hsinyu Chao <hychao@chromium.org> Tested-by: Hsinyu Chao <hychao@chromium.org> Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org> [modify] https://crrev.com/452060bb03235f1241f5822f326f2abbc936e656/dbus/service_constants.h
,
Mar 30 2016
,
Mar 30 2016
[Automated comment] We don't branch for M51 for another 9 days, was this request meant for M50?
,
Mar 30 2016
Oops, my mistake in the M-number. No need to merge to any release.
,
Aug 29 2016
,
Aug 31 2016
|
||||||||||||
►
Sign in to add a comment |
||||||||||||
Comment 1 by hychao@chromium.org
, Mar 9 2016