Skip to content

Samsung: publish display rotation for CS35L41 speaker-rotation fix - #50

Open
bod09 wants to merge 1 commit into
TrebleDroid:masterfrom
bod09:samsung-speaker-rotation
Open

Samsung: publish display rotation for CS35L41 speaker-rotation fix#50
bod09 wants to merge 1 commit into
TrebleDroid:masterfrom
bod09:samsung-speaker-rotation

Conversation

@bod09

@bod09 bod09 commented Jul 26, 2026

Copy link
Copy Markdown

Companion to TrebleDroid/device_phh_treble#87, following the approach you suggested there.

On Samsung tablets with four Cirrus CS35L41 speaker amps (Galaxy Tab S6, etc.) all four speakers can be driven, but the stereo image is wrong in landscape: with four corner speakers a correct left/right split is by column in portrait and by row in landscape, and the vendor HAL never re-maps this on rotation (its only lever is a plain L/R mirror). I could not find a setParameters that makes the HAL re-map these speakers (the rotation it already receives only feeds the SoundBooster DSP path, which is not active under a GSI), so this uses the property fallback you described.

This change registers a DisplayListener in the Samsung startup and publishes the display rotation (Surface.ROTATION_0..3) into persist.sys.phh.audio_rotation whenever it changes, plus once at boot. The device side (the linked PR) has a small one-shot, phh-spkrot.sh, triggered by that property, which sets the four amp channel-routing controls to match. No polling and no dumpsys.

It runs for all Samsung devices; the device-side helper no-ops on anything without the CS35L41 controls, so it is harmless elsewhere. Happy to gate it more tightly (model check) if you would prefer.

Verified end to end on a Galaxy Tab S6 (SM-T860, LineageOS 23.2 GSI): all four speakers play and a left-only test tone stays on the physical left through a full turn with auto-rotate on. Note: I have not compiled treble_app locally, so a build check would be good; the code follows the existing setParameters/SystemProperties patterns in this file.

On tablets with four CS35L41 amps (Galaxy Tab S6 etc.) the stereo image
is wrong in landscape because nothing re-maps the amp channel routing on
rotation. Register a DisplayListener and publish the display rotation to
persist.sys.phh.audio_rotation; the device-side phh-spkrot.sh helper
re-maps the amps to match. No-ops on devices without those controls.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant