SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Clients Development
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Clients Development This forum is for discussions relating to SageTV Open Source Clients Development.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-10-2015, 07:06 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Android/AndroidTV Placeshifter client (Discussion)



My goal is to build a fully functioning MiniClient (ie, HD300 like) app for Android for use on Phones, Tablets, and especially Android TV.

NEW: Indiegogo Campaign


This project will likely unfold in a couple of milestones.

Milestone 1 (Progressing)
  • Placeshifter can render a SageTV ui, and performance is good.
  • We can now see and interact with the SageTV UI on Android devices (tablets, phones, tv)
  • There are some rendering glitches, but they'll be solved over time.
  • Screen flickers from time to time

Milestone 2 (Progressing)
  • Video playback (Working using ExoPlayer and IJKPlayer -- see notes below about each player)
  • FF, REW, pause and play are working.
  • brewston created a simple video showing the performance on a Nexus Player.

As for Jan 2016 the major functional parts of the MiniClient are complete. The Beta Release will be used to clean up the user experience, and stabilize the client.

Milestone 3 (Not Started)
- Build a "simple" desktop placeshifter using the same base code, but pulling in vlc4j. This would get rid of the mplayer dependency and enable it to work on 32/64bit clients, including Mac.

Milestone 4 (Not Started)
- Depending how (or if) the iOS version is progressing, I might take a stab at using Java on iOS to build an iOS version of the placeshifter. This is possible, since I've already done this with another app. You read my comments about Java on ios here.

Internal Players'
ExoPlayer
- AC3 passthrough (only)
- MPEG2 hardware decoding if the device supports it
- H264 hardware decoding
- H265 hardware decoding if the device supports it
- NO support for MPEG2-PS
- NO support for AVI
- Will play MKV, MP4, FLV, TS (mpegts), MPG containers
- If it has to transcode a file, it will not play (sagetv sends MPEG2-PS stream)

IJKPlayer
- Plays any file type
- NO MPEG2 hardware decoding support, even if the device supports it
- Hardware decoding for h264
- Hardware decoding for h265 (if the device supports it)
- NO AC3 passthrough (it will be decoded and played)

If this all works, then I think that AndroidTV units could be a viable placeshifter/extender supporting all the same features as our HD100-300 extenders.

From an Android Phone perspective, if this works, then I see no need for me to update/enhance the Android apps that I've already done., since this would offer more functionality.

One thing that we would need to consider though, is a "Mobile Friendly' SageTV theme. ie, the existing Themes are likely good for TV, but on a phone they might not be so great, so it would be awesome if someone worked on a Mobile theme (that won't be me )

Wired vs Wireless
This client works over both, but in my experience when wired the UI is as fluid as it would be on an HD300, except that in the client, the UI is rendered at native resolution, whereas the HD300 renders at 1280x720 (I think). Because the UI resolution is likely higher for this client, then it takes more memory, and network bandwidth to create a smooth UI experience. On WiFi the UI works well, but it works much better wired. Likewise, for video playback, wired will most likely provide a better experience. When comparing with the HD300, you should be comparing wired connections in both cases.

Navigation
Tablet/Phone
  • Swipe Left/Right/Up/Down on the screen is a LEFT/RIGHT/UP/DOWN keypress
  • Touch anywhere on the screen is Mouse Focus
  • Double Tap is SELECT/ENTER
  • 3 Finger Swipe UP - OPTIONS
  • 3 Finger Swipe Left/Right - REW/FF
  • Swipe in from LEFT edge will show a menu of buttons for on screen navigation (includes up, down, left, right, home, options, and media controls)
  • Swipe in from the RIGHT edge should show overlay of Android Buttons. The Back button will send "BACK" command.
  • Back Button sends "BACK" command (also used to exit on screen navigation)

AndroidTV
  • UP/DOWN/LEFT/RIGHT - standard navigation
  • Middle Button - SELECT/ENTER
  • Middle Button LONG PRESS - Bring up on screen navigation (or OPTIONS - determined by preferences)
  • MEDIA Pause/Play - Pause/Play
  • MEDIA FF/REW - FF/REW
  • MEDIA STOP - STOP
  • Controller A - SELECT/ENTER
  • Controller B - ESCAPE
  • Controller X - STOP
  • Controller Y - PAUSE/PLAY
  • Back Button sends "BACK" command (also exits on screen navigation, or if video is playing, will stop the video)
  • Long Press Center Button - OPTIONS or On Screen Navigation (depending on preferences)

If you have Smart Remote enabled in the preferences, then when a video is playing/paused, then the following remote buttons will be in effect.
  • LEFT/RIGHT - Skip Back / Skip Forward
  • Middle Button - Pause/Play
  • MEDIA Pause/Play - Pause/Play
  • MEDIA FF/REW - FF/REW
  • MEDIA STOP - STOP
  • BACK will stop the video playback


Hardware that Works - I've Tested
If it's in this list, then I've verified that the app does run
  • Nexus 5 - ARMv7 - Android M (6.0)
  • Nexus Player - ARMv7 - 32bit - Developer Edition - Android 5.0
  • NVidia Shield TV

Hardware that Works - User Feedback
This is a list of hardware where people have had success in getting the app to function
Hardware that will not Work (yet)
If it's in the list then someone has said "It doesn't work"
Submitting Issues
https://github.com/OpenSageTV/sagetv-miniclient/issues

Source Code
https://github.com/OpenSageTV/sagetv-miniclient

Last edited by stuckless; 01-30-2016 at 08:32 PM.
Reply With Quote
  #2  
Old 09-10-2015, 07:12 AM
dinki's Avatar
dinki dinki is offline
Sage Expert
 
Join Date: Mar 2006
Posts: 682
Very excited about this possibility. Do you think, and I know it's early, that this would work on an Amazon FireTV Stick?
__________________
Intel Core i5-2500, 16GB RAM, OMV Linux 4.17, 3 TB of Data
SageTV 9 Docker, Open DCT Docker
Silicondust HDHomeRun Duo + Quatro
Sage Mini Client on Amazon Fire Sticks and Android TVs
Reply With Quote
  #3  
Old 09-10-2015, 08:12 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by dinki View Post
Very excited about this possibility. Do you think, and I know it's early, that this would work on an Amazon FireTV Stick?
I don't see why not. The only android specific part of this will be the MediaPlayer and the initial start screen, and I suspect both of those would work on the FireTV. I'm pretty sure with the latest firmware, the FireTV is android 5 API compatible, so it should work.
Reply With Quote
  #4  
Old 09-10-2015, 08:24 AM
dinki's Avatar
dinki dinki is offline
Sage Expert
 
Join Date: Mar 2006
Posts: 682
Great news! I'm pretty thrifty/frugal/cheap. A SageTV client for under $40 is a very attractive thing to me (and perhaps others) especially for kid's rooms, kitchen, etc.

I'm available for testing whenever you get to that stage. I've got a handful of Android devices running various OS versions.
__________________
Intel Core i5-2500, 16GB RAM, OMV Linux 4.17, 3 TB of Data
SageTV 9 Docker, Open DCT Docker
Silicondust HDHomeRun Duo + Quatro
Sage Mini Client on Amazon Fire Sticks and Android TVs
Reply With Quote
  #5  
Old 09-10-2015, 08:33 AM
dranockcir dranockcir is offline
Sage Advanced User
 
Join Date: Jul 2004
Location: Jupiter, FL
Posts: 137
Awesome. I have two Android MX2's gathering dust. They aren't AndroidTV but run Kit Kat. I used to use them for XBMC/Kodi and Plex clients. I would donate one to you Sean if you needed for development or whatever. I have no coding skills to help but I sure would love to see an Android Placeshifter!
Reply With Quote
  #6  
Old 09-10-2015, 08:59 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by dranockcir View Post
Awesome. I have two Android MX2's gathering dust. They aren't AndroidTV but run Kit Kat. I used to use them for XBMC/Kodi and Plex clients. I would donate one to you Sean if you needed for development or whatever. I have no coding skills to help but I sure would love to see an Android Placeshifter!
Thanks... I have a couple Android TV developer editions that Google sent me... I was using it to create a native SageTV app, but I think the placeshifter is a better way to go.
Reply With Quote
  #7  
Old 09-10-2015, 09:25 AM
cncb cncb is offline
Sage Icon
 
Join Date: Jul 2006
Posts: 1,271
Quote:
Originally Posted by stuckless View Post
If this all works, then I think that AndroidTV units could be a viable placeshifter/extender supporting all the same features as our HD100-300 extenders.
I hope this works out because I just ordered a Shield TV and this could be the ultimate Sage extender since it also includes native streaming apps (Netflix, etc.) like many of us always wanted in the HD300.
__________________
-Craig
Reply With Quote
  #8  
Old 09-10-2015, 09:28 AM
cncb cncb is offline
Sage Icon
 
Join Date: Jul 2006
Posts: 1,271
Quote:
Originally Posted by dinki View Post
Do you think, and I know it's early, that this would work on an Amazon FireTV Stick?
Do you have 1080i MPEG2 tv signals? When I tried the Fire TV (box) it really struggled with MPEG2 playback/deinterlacing.
__________________
-Craig
Reply With Quote
  #9  
Old 09-10-2015, 09:56 AM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Quote:
Originally Posted by cncb View Post
Do you have 1080i MPEG2 tv signals? When I tried the Fire TV (box) it really struggled with MPEG2 playback/deinterlacing.
Part of the advantage of going the placeshifter route is the transcoding. All the android/ios client would ever have to decode is (currently) MPEG4, and the server would be left to transcode whatever material to that. I'm hoping at some point we can move to a newer ffmpeg on the server to transition to h.264 video instead, which would certainly improve quality.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #10  
Old 09-10-2015, 09:59 AM
dinki's Avatar
dinki dinki is offline
Sage Expert
 
Join Date: Mar 2006
Posts: 682
Quote:
Originally Posted by cncb View Post
Do you have 1080i MPEG2 tv signals? When I tried the Fire TV (box) it really struggled with MPEG2 playback/deinterlacing.
Yes I do have 1080i ATSC signals and did have trouble with this on my MX2 running Android. Another user on the Matricom forum said he was able to play these without problem using mplayer (I think) but the internal Kodi player had problems with it. I flashed my MX2 with a Linux distro and still had the problem in Kodi but found that reducing my output resolution to 720p fixed the problem for 1080i playback. Note that 720p and 480p did not cause any problems with the MX2 but 1080i did until changing that output resolution.

With all that said, I have not tried playing any 1080i content on the FireTV stick. What were you using to play these files?
__________________
Intel Core i5-2500, 16GB RAM, OMV Linux 4.17, 3 TB of Data
SageTV 9 Docker, Open DCT Docker
Silicondust HDHomeRun Duo + Quatro
Sage Mini Client on Amazon Fire Sticks and Android TVs
Reply With Quote
  #11  
Old 09-10-2015, 10:06 AM
cncb cncb is offline
Sage Icon
 
Join Date: Jul 2006
Posts: 1,271
Quote:
Originally Posted by dinki View Post
With all that said, I have not tried playing any 1080i content on the FireTV stick. What were you using to play these files?
I was using Kodi too.
__________________
-Craig
Reply With Quote
  #12  
Old 09-10-2015, 10:10 AM
cncb cncb is offline
Sage Icon
 
Join Date: Jul 2006
Posts: 1,271
Quote:
Originally Posted by Fuzzy View Post
Part of the advantage of going the placeshifter route is the transcoding. All the android/ios client would ever have to decode is (currently) MPEG4, and the server would be left to transcode whatever material to that.
I assume direct streaming is possible if the client can handle it?
__________________
-Craig
Reply With Quote
  #13  
Old 09-10-2015, 10:13 AM
Taddeusz Taddeusz is offline
SageTVaholic
 
Join Date: Nov 2004
Location: Yukon, OK
Posts: 3,919
In general ARM devices don't have the necessary licenses to decode MPEG2 in hardware. In those cases it has to be done in software. Unless you have a really powerful ARM processor that's likely to be a problem.
__________________
Server: i5 8400, ASUS Prime H370M-Plus/CSM, 16GB RAM, 15TB drive array + 500GB cache, 2 HDHR's, SageTV 9, unRAID 6.6.3
Client 1: HD300 (latest FW), HDMI to an Insignia 65" 1080p LCD and optical SPDIF to a Sony Receiver
Client 2: HD200 (latest FW), HDMI to an Insignia NS-LCD42HD-09 1080p LCD
Reply With Quote
  #14  
Old 09-10-2015, 10:22 AM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Quote:
Originally Posted by cncb View Post
I assume direct streaming is possible if the client can handle it?
Yes, direct streaming is possible via the placeshifter system, but if there are issues with media content playback, it seems just that much 'simpler' to transcode on the server. Also the pass through ffmpeg ensures that the less tolerant decoding systems on most mobile platforms are not botched up by a screwed up timeline, or other recording glitch.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #15  
Old 09-10-2015, 10:27 AM
cncb cncb is offline
Sage Icon
 
Join Date: Jul 2006
Posts: 1,271
Quote:
Originally Posted by Taddeusz View Post
In general ARM devices don't have the necessary licenses to decode MPEG2 in hardware. In those cases it has to be done in software. Unless you have a really powerful ARM processor that's likely to be a problem.
Which is why I ordered the Shield TV: apparently it can already do MPEG2 hardware decoding in Kodi. I also think I read that the Nexus player will be able to do this in the next version of Android TV but I'm not sure.
__________________
-Craig
Reply With Quote
  #16  
Old 09-10-2015, 12:55 PM
Narflex's Avatar
Narflex Narflex is online now
Sage
 
Join Date: Feb 2003
Location: Redondo Beach, CA
Posts: 6,349
If you do transcoding...there's a few downsides:

1) Reduces quality (although with high enough bitrate H264, this would be negligible)
2) Latency in transport controls (i.e. skipping around is not as fast because the transcoder needs to restart each time you do this)
3) No Smooth Fast Forward or Rewind (technically this could be achieved, but it's very complicated to do it and would require lots of effort)
__________________
Jeffrey Kardatzke
Google
Founder of SageTV
Reply With Quote
  #17  
Old 09-10-2015, 01:10 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by Narflex View Post
If you do transcoding...there's a few downsides:

1) Reduces quality (although with high enough bitrate H264, this would be negligible)
2) Latency in transport controls (i.e. skipping around is not as fast because the transcoder needs to restart each time you do this)
3) No Smooth Fast Forward or Rewind (technically this could be achieved, but it's very complicated to do it and would require lots of effort)
On an HD300 today... are there cases where you transcode? I've played MKV, MP4, AVI and TS file, and it's always super snappy skipping around... so I'm guessing it's not transcoding.

From a placeshifter point of view, does sagetv know when to transcode, or it is up to the placeshifter to ask for a transcoded stream?
Reply With Quote
  #18  
Old 09-10-2015, 01:12 PM
Taddeusz Taddeusz is offline
SageTVaholic
 
Join Date: Nov 2004
Location: Yukon, OK
Posts: 3,919
Quote:
Originally Posted by stuckless View Post
On an HD300 today... are there cases where you transcode? I've played MKV, MP4, AVI and TS file, and it's always super snappy skipping around... so I'm guessing it's not transcoding.

From a placeshifter point of view, does sagetv know when to transcode, or it is up to the placeshifter to ask for a transcoded stream?
Yeah, I was curious if there is some kind of device capabilities parameter for the MiniClient. If I do an Apple TV app it should be able to play progressive H.264. But MPEG2 and interlaced content are probably out.
__________________
Server: i5 8400, ASUS Prime H370M-Plus/CSM, 16GB RAM, 15TB drive array + 500GB cache, 2 HDHR's, SageTV 9, unRAID 6.6.3
Client 1: HD300 (latest FW), HDMI to an Insignia 65" 1080p LCD and optical SPDIF to a Sony Receiver
Client 2: HD200 (latest FW), HDMI to an Insignia NS-LCD42HD-09 1080p LCD
Reply With Quote
  #19  
Old 09-10-2015, 01:18 PM
Narflex's Avatar
Narflex Narflex is online now
Sage
 
Join Date: Feb 2003
Location: Redondo Beach, CA
Posts: 6,349
Quote:
Originally Posted by stuckless View Post
On an HD300 today... are there cases where you transcode? I've played MKV, MP4, AVI and TS file, and it's always super snappy skipping around... so I'm guessing it's not transcoding.

From a placeshifter point of view, does sagetv know when to transcode, or it is up to the placeshifter to ask for a transcoded stream?
The HD300 will not transcode if its playing back something on your LAN. When it's remotely connected; it uses bandwidth statistics to determine if it needs to go into transcode mode or not.

Quote:
Originally Posted by Taddeusz View Post
Yeah, I was curious if there is some kind of device capabilities parameter for the MiniClient. If I do an Apple TV app it should be able to play progressive H.264. But MPEG2 and interlaced content are probably out.
Yes there are. The protocol has the client send back the full list of audio/video codecs and container formats that it supports. Then the server uses this to determine compatibility and whether or not transcoding is required. NOTE however, that we haven't fully verified if this works properly in all cases. We did various special cases in there along the way..BUT the whole logic around this is definitely present so if there are issues, they should not be hard to resolve.
__________________
Jeffrey Kardatzke
Google
Founder of SageTV
Reply With Quote
  #20  
Old 09-10-2015, 04:44 PM
MattHelm MattHelm is offline
Sage Icon
 
Join Date: Jun 2005
Location: Chicago, IL
Posts: 1,209
Quote:
Originally Posted by Narflex View Post
If you do transcoding...there's a few downsides:

1) Reduces quality (although with high enough bitrate H264, this would be negligible)
2) Latency in transport controls (i.e. skipping around is not as fast because the transcoder needs to restart each time you do this)
3) No Smooth Fast Forward or Rewind (technically this could be achieved, but it's very complicated to do it and would require lots of effort)
It's also a waste of power, as it runs most CPUs all cores at 100%., were as streaming only uses about 2% of 1 core, with the clock turned way down.
__________________
Server #1= AMD A10-5800, 8G RAM, F2A85-M PRO, 12TB, HDHomerun Prime, HDHR, Colossus (Playback - HD-200)
Server #2= AMD X2 3800+, 2G RAM, M2NPV-VM, 2TB, 3x HDHR OTA (Playback - HD-200)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Finally, a fully functional SageTV client on android and iphone! mkanet SageTV v7 Customizations 12 01-12-2013 12:22 AM
SageTV Placeshifter for Android nyle SageTV Placeshifter 5 12-31-2011 10:40 AM
Sage should get an android client running on this Deacon Crusher Hardware Support 1 09-29-2010 11:30 AM
Android client? equalize SageTV Placeshifter 1 07-22-2010 09:37 AM


All times are GMT -6. The time now is 11:14 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.