Support speaker swapping in tablet mode, based on speaker position |
|
Issue descriptionRefer to https://issuetracker.google.com/70857082 On a device where speakers aren't aligned along one axis, the device has an "opinion" about which speaker is left/right in every orientation. While Chrome seems to swap speakers/channels when we rotate a device 180 degrees, this still means one of the 90 or 270 degree rotations may be wrong. More specifically: consider a device where 1 speaker is on the top-left and the other is on the bottom-right, in its default orientation. That works fine with: * 0 degrees: leave left/right as-is -- as expected * 180 degrees: speakers are physically swapped (and Chrome does the swapping) -- as expected And it also is OK by default with: * 90 degrees counter-clockwise: speakers are still left/right, and we see no swapping -- as expected But it doesn't work well with: * 90 degrees clockwise: speakers are now physically swapped, but Chrome does no swapping We probably need to communicate physical device parameters in some way. --- Per Jimmy: "what information do you suggest CRAS to pass ? We can put some flags in board.ini for CRAS, and pass that information to Chrome through dbus API." Per Conrad: "Yeah, we'll probably need board-specific config data for future-proofing" --- Side notes: Similar problems about physical device parameters may need to get resolved for bug 732628
,
Feb 12 2018
Agree with Dylan.
I think that should work.
Maybe an API like
SetOrientation(int)
And, we set different channel maps in board.ini like
For normal two-speaker case
0 ---1
| |
| |
x ---x
0 -> {0,1}
90 -> {0,1} (no much point to swap)
180 ->{1,0}
270 -> {0,1} (no much point to swap)
Four-speaker case:
0 ---1
| |
| |
2 ---3
0 -> {0,1,2,3}
90 -> {2,0,3,1}
180 -> {3,2,1,0}
270 -> {1,3,0,2}
For weird two-speaker case:
0 --- x
| |
| |
x --- 1
0 -> {0,1}
90 -> {1,0}
180 ->{1,0}
270 -> {0,1}
Since we don't have four speaker use case yet, we can still implemented this using existed swap_lr_plugin DSP.
Jenny, do you think this should work ?
Thanks!
,
Feb 15 2018
You mean add a Cras dbus API for chrome to tell cras the orientation of the internal display like: int GetInternalDisplayOrientation()? Then cras can decide if it needs to swap the internal speakers? Do I understand this correctly? If yes, this is certainly do-able. |
|
►
Sign in to add a comment |
|
Comment 1 by dgreid@chromium.org
, Feb 9 2018