badaix / snapdroid

Snapcast client for Android
GNU General Public License v3.0
124 stars 25 forks source link

Enable support for Android TV #3

Open badaix opened 6 years ago

badaix commented 6 years ago

From @voltagex on April 28, 2018 6:33

image

Could you please enable Android TV support in the Store version of the app? I'll probably recompile it for my TV but it'd be nice to be able to just install it.

Copied from original issue: badaix/snapcast#392

badaix commented 6 years ago

please move this issue to snapdroid

ghost commented 6 years ago

Oops, thanks for moving this.

koalajoe23 commented 5 years ago

Works with sideloaded APK on Nvidia shield TV!

cyberbix commented 4 years ago

Works well on FireTV, sideloaded via adblink. Had to give an extra delay of 100ms on my Philips TV.

foxy82 commented 3 years ago

This doesn't seem to work for playing audio when side loaded on to a Google TV dongle (https://store.google.com/gb/product/chromecast_google_tv?hl=en-GB) however I can see the list of clients.

When I hit play I get a constantly appearing/disappearing/reappearing message at the bottom of the screen that reads: "Error in socket shutdown: Transport endpoint is not connected"

toffee commented 2 years ago

On my Philips TV (model PUS8505/12) with Android 9 installing snapcast (version 0.26.0.0) via sideloading is possible and is working. To access the Snapcast application you need to install from Google play a "Sideload Launcher" app.

Anyway, there are some caveats:

XeOS1977 commented 2 years ago

First of.... a massive thanks for your work, entire house was running on snapcast a while back without a hitch in combination with Home Assistant. Unfortunately after the update of my Nvidia Shield to Android 11 the (Snapdroid) snapcast client became unavailable as an output source. The app is working and I can control other instances but no more sound on the surround system. Also purchased a new TV recently with Android TV (Android 11) as well. Same issue. It would be awesome if we could use snapcast clients again on Android/Google TV again

chatziko commented 1 year ago

WIth some minor troubles, I managed to make the snapcast client work on a Chromecast with Google TV. Here's how for anyone who's interested.

I first sideloaded the apk (found in the releases page):

adb connect <chromecast-IP>
adb install Snapcast_0.26.0.apk

The only problem after the installation is that the app won't show anywhere, not even in the full list of installed apps. But it is nevertheless installed, and can be launched with:

adb shell monkey -p de.badaix.snapcast -c android.intent.category.LAUNCHER 1

After this, everything works as expected, the app detects the server, and we just have to press the Play button (a bit tricky with the remote, we first need to focus the button, but it's doable). Then Chromecast appears in the list of snapcat clients and plays audio (even simultaneously with other apps).

Finally, we can select three dots / Settings / Auto start Snapclient. This way snapclient loads automatically on boot, and we never have to interact with the UI again (we can control the sound from any snapcast controller).

PS1. Of course, some proper support for Android TV would be hugely welcome. Since the main functionality is working, I guess it shouldn't be too hard.

PS2. Thanks for this awesome project!

jagjordi commented 1 year ago

I am also running snapdroid sideloaded on android TV. However I notice that when snapcast is playing the screensaver wont start. Have any of you noticed that? And any ideas on how to solve it?

jagjordi commented 1 year ago

My workarround as of now is to trigger screensaver through home assistant with an automation:

service: androidtv.adb_command
data:
  command: adb shell am start -n "com.android.systemui/.Somnambulator"
target:
  entity_id: media_player.android_tv
SantiagoSotoC commented 6 months ago

I have the project modified so it can be launched from android tv, I have to fix the banner and make it a pull request, most likely for tomorrow. I know little about android development, we can go see the problems little by little.

pmec commented 2 months ago

I made a PR to solve this.

XeOS1977 commented 1 day ago

Thanks @SantiagoSotoC and @pmec for the modifications, it shows up in my apps. Way easier than having to try and start it from settings->apps etc. I still have the problem though that it doesn't show as a player/client and therefore doesn't give sound. Everything else works as expected, it finds the server and I see all other players etc. etc. This happens on a Nvidia Shield tube 2019. It stopped working ever since the upgrade to Android 11, same goes for my Android TV (also version 11). Please advice on how to debug this or is this is known behavior and it only works on old Android TV versions?