Skip to content

Add TV audio output switch and USB storage visibility#8

Draft
BigShoots wants to merge 2 commits into
LineageOS-TV-x86:lineage-21.0from
BigShoots:codex/audio-output-usb-routing
Draft

Add TV audio output switch and USB storage visibility#8
BigShoots wants to merge 2 commits into
LineageOS-TV-x86:lineage-21.0from
BigShoots:codex/audio-output-usb-routing

Conversation

@BigShoots

Copy link
Copy Markdown

Summary

This adds an Android TV audio output selector and fixes public USB storage visibility for the x86_64 TV product.

Changes:

  • Add AudioOutputSwitch, a privileged system_ext app that handles com.android.tv.settings.SOUND.
  • Use Android audio policy routing APIs to set/clear the preferred media output strategy.
  • Persist the selected route and reapply it after boot.
  • Filter unsafe/bogus telephony and bus output routes discovered during testing on Intel TV hardware.
  • Add the required privapp permission allowlist and hidden API sysconfig allowlist.
  • Mark USB/usbdisk vold-managed public storage entries encryptable=userdata.
  • Set persist.sys.adoptable=force_on so public USB storage is visible to apps on Android TV.

Testing

Tested as an image patch against lineage-21.0-20260331-UNOFFICIAL-x86_64_tv-signed.iso on an Intel 7th gen mini PC / ThinkCentre M710q class device.

  • Verified ADB root access and route manipulation with a shell harness.
  • Verified bad telephony route selection caused media playback failures, then filtered that route.
  • Verified System default clears the preferred media route.
  • Verified USB flash drive becomes app-visible at /storage/1512-1D39 after the vold/adoptable visibility change.
  • Verified Material Files can access the flash drive when root-only mode is disabled.

Note: the HDMI/DisplayPort audio policy fix used during local ISO testing appears to belong to the audio HAL/policy source rather than this device repository, so it is intentionally not included in this PR.

@hmtheboy154

Copy link
Copy Markdown
Member

Should've splitted into a commit related to audio settings + a commit related to USB

Comment thread properties/system.prop
persist.bluetooth.enablenewavrcp=true

# Make public USB storage app-visible on Android TV x86.
persist.sys.adoptable=force_on

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is like..... turning any external storage into adoptable, not trying to make USB storage "app-visible".

You need DocumentUI to make it "app-visible", but I already included it in

Comment thread device.mk
$(eval PRODUCT_COPY_FILES += $(f):$(TARGET_COPY_OUT_SYSTEM_EXT)/etc/permissions/$(notdir $f)))

PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/sysconfig/hiddenapi-package-whitelist-org.lineageos.tv.audiooutput.xml:$(TARGET_COPY_OUT_SYSTEM_EXT)/etc/sysconfig/hiddenapi-package-whitelist-org.lineageos.tv.audiooutput.xml

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better use Android.mk (or .bp) instead of this

Comment thread fstab.internal.x86

/devices/*/block/sr* auto auto defaults voldmanaged=cdrom:auto
/devices/*/usb*/* auto auto defaults voldmanaged=usb:auto,noemulatedsd
/devices/*/usb*/* auto auto defaults voldmanaged=usb:auto,noemulatedsd,encryptable=userdata

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All storage here does not set encryptable=userdata label because I found out that it generate folders like Android, Alarms, Music, DCIM, etc

@@ -0,0 +1,16 @@
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use Android.bp instead for future-proofing ?

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.

2 participants