Controlling a custom tv_input

620 views
Skip to first unread message

Christophe Dongieux

unread,
Nov 27, 2014, 9:15:57 AM11/27/14
to android-...@googlegroups.com
Hi,

I'm working on a custom tv_input HAL module, and I can't figure out how to implement correctly a TvInputService/HardwareSession to control it.
My tv_input module is made for controlling a DVB tuner and using the TV_STREAM_TYPE_INDEPENDENT_VIDEO_SOURCE/sideband feature.

On the HAL side, my module declares a device with its device_id and type (TV_INPUT_TYPE_TUNER), and a tv_stream_config_t with a stream_id and TV_STREAM_TYPE_INDEPENDENT_VIDEO_SOURCE type.
On the Java side, I create a class extending TvInputService which overrides onHardwareAdded() for returning a TvInputInfo based on the TvInputHardwareInfo, and creating a HardwareSession in the onCreateSession() method. The HardwareSession returns (in getHardwareInputId()) the hardware input id detected by TvInputHal.

When I enable debug in logs in all the TV framework classes, I see TvInputService complaining about my input hardware id is invalid since the input is not a passthrough.
And if I change the tv input type of the HAL module to TV_INPUT_TYPE_OTHER_HARDWARE, createSessionInternalLocked() in TvInputManagerService is called in loop, which leads to a system restart.

Do you have any suggestion or idea about that?

Best regards,
Christophe.

Christophe Dongieux

unread,
Dec 1, 2014, 3:59:29 AM12/1/14
to android-...@googlegroups.com
Ok, it was really tricky :)
- the session has to extend Session and not HardwareSession
- the session has to call acquireTvInputHardware() on the TvInputManager instance with the hardware device_id declared in the tv_input
- with the acquired hardware session, you can call setSurface() which calls open_stream() in the tv_input.

So I am wondering what is the purpose of the HardwareSession class, since that session can only be a Passthrough one, thus not allowing to use a tv_input which is declared as a TV_INPUT_TYPE_TUNER. Maybe some explanation are missing in the documentation.

Best regards,
Christophe.

Raven Dou

unread,
Feb 15, 2015, 2:29:21 AM2/15/15
to android-...@googlegroups.com
HDMI  is Passthrough, so it can not be a type of TV_INPUT_TYPE_TUNER , I guess.

http://source.android.com/devices/tv/index.html#passthrough_input_example

在 2014年12月1日星期一 UTC+8下午4:59:29,Christophe Dongieux写道:

Narrator

unread,
Mar 11, 2015, 10:20:47 AM3/11/15
to android-...@googlegroups.com
Hi Christophe,

I'm trying to implement tv_input app for tuner and my problem is while overriding onHardwareAdded() in TvInputService, I'm getting error like "TvInputHardwareInfo cannot be resolved to a type"
i have included the v17-leanback suppport library to my project in eclipse, I still face the same problem but I'm not getting any error for TvInputInfo , TvInputService etc types which means that support library is added to my project. 

Am I missing something??

Christophe Dongieux

unread,
Mar 11, 2015, 12:35:52 PM3/11/15
to android-...@googlegroups.com
Hi,

onHardwareAdded() and some bunch of other methods are hidden methods ("@hide"). So these methods are not available when using Android SDK.
So you have 2 choices:
- you use reflection to access these methods,
- you develop your app within the android platform.

And FYI, v17-leanback suppport library is not related to this at all.

Good luck with your dev.

Cheers.

--
You received this message because you are subscribed to a topic in the Google Groups "android-platform" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-platform/_zv3xoxPBng/unsubscribe.
To unsubscribe from this group and all its topics, send an email to android-platfo...@googlegroups.com.
To post to this group, send email to android-...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-platform.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages