Skip to content

Instantly share code, notes, and snippets.

@det-peralta
Created January 20, 2020 19:14
Show Gist options
  • Save det-peralta/eab8c1ffbc0263c9dcd9359ccbdedd45 to your computer and use it in GitHub Desktop.
Save det-peralta/eab8c1ffbc0263c9dcd9359ccbdedd45 to your computer and use it in GitHub Desktop.
TCL TV - android adb command - Home Assistant
entity_id: media_player.tcl_tv
command: "am start -n com.tcl.tv/.TVActivity"
@DevSrSouza
Copy link

change the HDMI: am start -a android.intent.action.VIEW -d content://com.tcl.tvpassthrough/.TvPassThroughService/HDMI100004 -n com.tcl.tv/.TVActivity -f 0x10000000

@byte4geek
Copy link

byte4geek commented Feb 22, 2022

Hi have a trubble when i change on HDMI on TCL TV but this command not work for me:

am start -a android.intent.action.VIEW -d content://com.tcl.tvpassthrough/.TvPassThroughService/HDMI100004 -n com.tcl.tv/.TVActivity -f 0x10000000

this is the logcat when i change on HDMI1 with the remote:

02-22 10:05:16.803  2018  2018 I chromium: [2018:2018:INFO:metrics_stat_logger.cc(55)] Metrics stat for the past 60 secs : total=3
02-22 10:05:16.803  2018  2018 I chromium: [metrics_stat_logger] Cast.Discovery.Mdns.ResponderPing=1
02-22 10:05:16.803  2018  2018 I chromium: [metrics_stat_logger] Cast.Discovery.Mdns.SocketPing=1
02-22 10:05:16.803  2018  2018 I chromium: [metrics_stat_logger] Cast.System.Time.Heartbeat=1
02-22 10:05:17.888   634   745 V EventHub: /dev/input/event0 got: time=36142.840972, type=1, code=403, value=1
02-22 10:05:17.888   634   745 V EventHub: event time 36142840972000, now 36142841053420
02-22 10:05:17.888   634   745 V EventHub: /dev/input/event0 got: time=36142.840972, type=0, code=0, value=0
02-22 10:05:17.888   634   745 V EventHub: event time 36142840972000, now 36142841053420
02-22 10:05:17.888   634   745 D InputReader: lxxl  **0** deviceId:65534 type:1 scancode:403 keycode:-1 vlaue:1 flags:-1 count is 2
02-22 10:05:17.888   634   745 D InputReader: lxxl  **1** deviceId:65534 type:0 scancode:0 keycode:16 vlaue:0 flags:32 count is 2
02-22 10:05:17.889   634   745 D WindowManager: interceptKeyTq keycode=167 interactive=true keyguardActive=false policyFlags=22000000
02-22 10:05:17.891   634   744 D WindowManager: interceptKeyTi keyCode=167 down=true repeatCount=0 keyguardOn=false mHomePressed=false canceled=false
02-22 10:05:17.933   634   717 D TvInputManagerService: ===yums=== setSurface1
02-22 10:05:17.933   634   717 D TvInputManagerService: ===yums=== return sessionState
02-22 10:05:17.933   634   717 D TvInputManagerService: ===yums=== setSurface2
02-22 10:05:17.933   634   717 D TvInputManagerService: ===yums=== getSessionLocked session is not null!
02-22 10:05:17.933   634   717 D TvInputManagerService: ===yums=== setSurface4 finally
02-22 10:05:17.934   634  1656 D TvInputManagerService: ===yums=== return sessionState
02-22 10:05:17.934   634  1656 D TvInputManagerService: ===yums=== getSessionLocked session is not null!
02-22 10:05:17.935   634   717 E TvInputHal: nativeRemoveStream,call tvInputHal->removeStream
02-22 10:05:17.935   634   717 E TvInputHal: JTvInputHal::removeStream deviceId:1413744384
02-22 10:05:17.935   634   717 E TvInputHal: streamId:1413744384
02-22 10:05:17.935   634   717 E Surface : [setSidebandStream 118] Surface(0x8632e800) NativeHandle stream=0x0, stream->handle=0x0
02-22 10:05:17.935   634   717 E         : [setSidebandStream 616] HpGraphicBufferProducer(0x84cf4ce0) NativeHandle stream=0x0
02-22 10:05:17.935   634   717 E         : [setSidebandStream 338] IGraphicBufferProducer(0x84cf4e00) NativeHandle stream=0x0
02-22 10:05:17.935   634   717 E         : [setSidebandStream 356] NativeHandle stream is empty, write false
02-22 10:05:17.935   312  1179 E         : [onTransact 904] get stream config empty
02-22 10:05:17.935   312  1179 E         : [onTransact 906] BnGraphicBufferProducer(0xb559e630) NativeHandle stream=0x0
02-22 10:05:17.935   312  1179 E BufferQueueProducer: [] [setSidebandStream 1322] stream=0x0
02-22 10:05:17.935   312  1179 E BufferQueueProducer: [] [setSidebandStream 1324]set sidebande stream:0x0, call onSidebandStreamChanged
02-22 10:05:17.935   312  1179 E BufferLayerConsumer: call listener(0xb3f78c7c) onSidebandStreamChanged
02-22 10:05:17.935   312  1179 E BufferLayer: [onSidebandStreamChanged 796]mSidebandStreamChanged:false
02-22 10:05:17.935   634  1656 D TvInputManagerService: releaseSession(sessionToken=android.os.Binder@5e40d9c)
02-22 10:05:17.935   634  1656 D TvInputManagerService: ===yums=== return sessionState
02-22 10:05:17.935   634  1656 D TvInputManagerService: ===yums=== return sessionState
02-22 10:05:17.935   634  1656 D TvInputManagerService: ===yums=== getSessionLocked session is not null!
02-22 10:05:17.936   634  1656 D TvInputManagerService: mainSessionToken=null
02-22 10:05:17.938   312   312 E BufferLayer: mSidebandStreamChanged, mSidebandStream=0x0, get mSidebandStream and set to hwc layer
02-22 10:05:17.940   634   717 E TvInputHal: JTvInputHal::removeStream connection.mSourceHandle clear
02-22 10:05:17.943   312  1179 E SurfaceFlinger: remove layer (SurfaceView - com.tcl.tv/com.tcl.tv.TVActivity#1)[3738].
02-22 10:05:17.943   312  1179 E SurfaceFlinger: remove layer (SurfaceView - com.tcl.tv/com.tcl.tv.TVActivity#1)[3133](0)(0x0xb3f77000).
02-22 10:05:17.943   312  1179 E SurfaceFlinger: remove layer (SurfaceView - com.tcl.tv/com.tcl.tv.TVActivity#1)[3141](1920, 1080).
02-22 10:05:17.943   312  1179 E SurfaceFlinger: remove layer (SurfaceView - com.tcl.tv/com.tcl.tv.TVActivity#1)[3145].
02-22 10:05:17.943   312  1179 E SurfaceFlinger: remove layer (SurfaceView - com.tcl.tv/com.tcl.tv.TVActivity#1)[3155].
02-22 10:05:17.943   312  1179 E SurfaceFlinger: remove layer (SurfaceView - com.tcl.tv/com.tcl.tv.TVActivity#1)[3161].
02-22 10:05:17.943   312  1179 E SurfaceFlinger: last remove layer (SurfaceView - com.tcl.tv/com.tcl.tv.TVActivity#1)[3176].
02-22 10:05:17.944   312  1179 E SurfaceFlinger: remove layer (SurfaceView - com.tcl.tv/com.tcl.tv.TVActivity#1)[3760].
02-22 10:05:17.944   312   341 E SurfaceFlinger: remove layer (Background for -SurfaceView - com.tcl.tv/com.tcl.tv.TVActivity#1)[3738].
02-22 10:05:17.944   312   341 E SurfaceFlinger: remove layer (Background for -SurfaceView - com.tcl.tv/com.tcl.tv.TVActivity#1)[3133](0)(0x0xb24d0000).
02-22 10:05:17.944   312   341 E SurfaceFlinger: remove layer (Background for -SurfaceView - com.tcl.tv/com.tcl.tv.TVActivity#1)[3141](1920, 1080).
02-22 10:05:17.944   312   341 E SurfaceFlinger: remove layer (Background for -SurfaceView - com.tcl.tv/com.tcl.tv.TVActivity#1)[3145].
02-22 10:05:17.944   312   341 E SurfaceFlinger: remove layer (Background for -SurfaceView - com.tcl.tv/com.tcl.tv.TVActivity#1)[3155].
02-22 10:05:17.944   312   341 E SurfaceFlinger: remove layer (Background for -SurfaceView - com.tcl.tv/com.tcl.tv.TVActivity#1)[3161].
02-22 10:05:17.944   312   341 E SurfaceFlinger: last remove layer (Background for -SurfaceView - com.tcl.tv/com.tcl.tv.TVActivity#1)[3176].
02-22 10:05:17.946   312   341 E SurfaceFlinger: remove layer (Background for -SurfaceView - com.tcl.tv/com.tcl.tv.TVActivity#1)[3760].
**02-22 10:05:17.948   634  1656 D TvInputManagerService: createSessionInternalLocked(inputId=com.tcl.tvpassthrough/.TvPassThroughService/HW1413744128)**
02-22 10:05:17.952   634  1968 D TvInputHardwareManager: surface is null, active config is null, just return true
02-22 10:05:17.953   634   634 D HdmiControlService: deviceSelect--fuli---deviceId:0
02-22 10:05:17.953   634   634 D HdmiCecLocalDeviceTv: deviceSelect--fuli--deviceId: 0
02-22 10:05:17.954   634   634 D HdmiCecLocalDeviceTv: ===fuli=== deviceSelect targetDevice:CEC: logical_address: 0x00 device_type: 0 vendor_id: 7173227 display_name: BeyondTV2 power_status: -1 physical_address: 0x0000 port_id: -1
02-22 10:05:17.957   275   362 D RTKHWC2 : psDisplay:0xa8ead1e0 validate_display flip:582612
02-22 10:05:17.957   275   362 D RTKHWC2 : idx 0: id:192 handle:0xa8ea32c0 ptr:0xa8ed8280 type:2 side:0x0 flag:0x800000
02-22 10:05:17.957   275   362 D RTKHWC2 : visibleRegion 0:0:1920:1080
02-22 10:05:17.957   275   362 D RTKHWC2 : sourceCrop 0.000000:0.000000:1280.000000:720.000000
02-22 10:05:17.957   275   362 D RTKHWC2 : displayFrame 0:0:1920:1080 zOrder=0
02-22 10:05:17.957   275   362 D RTKHWC2 : damage 0:0:0:0
02-22 10:05:17.957   275   362 D RTKHWC2 : idx 1: id:193 handle:0xa8ea2a80 ptr:0xa8ed86e0 type:2 side:0x0 flag:0x800000
02-22 10:05:17.958   275   362 D RTKHWC2 : visibleRegion 0:0:1920:1080
02-22 10:05:17.958   275   362 D RTKHWC2 : sourceCrop 0.000000:0.000000:1920.000000:1080.000000
02-22 10:05:17.958   275   362 D RTKHWC2 : displayFrame 0:0:1920:1080 zOrder=1
02-22 10:05:17.958   275   362 D RTKHWC2 : damage 0:0:0:0
02-22 10:05:17.954   634   634 D HdmiCecLocalDeviceTv: ===fuli=== targetAddress :0
02-22 10:05:17.958   634   634 D HdmiCecLocalDeviceTv: ===fuli=== handleSelectInternalSource

and tried this command:

am start -a android.intent.action.VIEW -d content://com.tcl.tvpassthrough/.TvPassThroughService/HW1413744128 -n com.tcl.tv/.TVActivity -f 0x10000000

but nothing happened.
Someone can helpme?

@and7ey
Copy link

and7ey commented Jan 11, 2023

@byte4geek have you found a solution?

@byte4geek
Copy link

I solved with a firestiktv4k attached on hdmi1, when I send command poweron to FireTV it send the cec command to TCL that switch to hmdi1, but no solution to switch directly from adb command.

@and7ey
Copy link

and7ey commented Jan 13, 2023

just in case somebody will be looking for solution, here are the working for me commands - https://community.home-assistant.io/t/android-tv-hdmi/234411/48

@OM-3kChcBjgFR2COfP
Copy link

Good afternoon, how can I change the backlight brightness on TCL TV?
com.tcl.settings.viewmodel.picture.BacklightSeekbarLayoutVM
how to call this method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment