Is it possible to auto-switch to a source on boot?

by bjeanes

I have a Xiaomi Mi 150 UST projector (the international version with Android TV).

I don't use Android TV on it (instead preferring my Shield) because it has atrocious inherent audio lag that can't be compensated for (videos from Plex or YT on the projector has 80-100ms of audio lag). It's unclear if this is a flaw of this model of projector or just my unit.

So, despite the projector having CEC settings, source switching DOES NOT WORK. However, the projector does power on when a source is activated, so I've been trying to find a way to auto-switch source when it boots.

Does anybody have any experience doing something like this or have any other suggestions. I'm OK with rooting the device, I am also OK with building my own Android app if this is somethign that could be done. I am a software developer but have never done any Android development and can't seem to find a clear indication that there is an API that a user-space app could use to do this, but I am hoping somebody here will tell me different...

Also, if you have this device and do NOT have input lag, please also let me know that because maybe the easiest thing here is to just replace the projector...

harolddan2003

I suppose you could use "Launch on boot" to change to the app that is used for managing sources 🤨? https://play.google.com/store/apps/details?id=news.androidtv.launchonboot

rebootyourbrainstem

The projector turns on when you turn on the Shield, but it doesn't switch to the Shield as a source? That's weird. Does it always boot to Android TV home screen or something, even if there is a source active, or does it always select a default source? Please clarify what it's doing.

Here's how I would go about debugging this:

  • Make sure the projector's software is up to date
  • Try a different HDMI cable, CEC uses a separate pin and in theory this might matter. Seems very unlikely though.
  • See if there is a default source option on the projector anywhere
  • Test the projector's behavior with a different HDMI source. The Shield may just be sending the "I'm awake" signal, but not the "I'm playing video" signal.
  • Log into either or both devices with `adb` and see if there are any CEC related messages in the output of `logcat`. This may or may not require rooting the device (usually it doesn't, but it might require enabling a "developer" option somewhere)
  • If you have a newer Raspberry Pi, you can use cecutils to debug the CEC behavior of the projector by sending raw requests and looking at the raw responses.

The last two options assume you are a little bit technical and know how to type commands into a Linux shell prompt and Google the details, if that's not the case they probably won't help you much anyway. I'm happy to explain more if you want, but just saying, some basic level of proficiency is needed for these steps to have any chance of being a good use of your time.

If the projector really refuses to behave properly you can try to make it switch to a different AV source yourself, but I don't have any immediate tips for this as I was always able to solve similar problems without having to resort to that.