Difference between revisions of "Android"

From MythTV Official Wiki
Jump to: navigation, search
(Device Specific Tips: Add v30 note)
(Change of download site)
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{User_Manual_TOC}}
 
{{User_Manual_TOC}}
 +
 +
{{Note box|The download site for Android packages has changed '''Again'''. See below.}}
  
 
== Overview ==
 
== Overview ==
There are many Android TV devices now available. Mythfrontend now has support, as from version 30, for Android and Android TV devices. The Nvidia Shield works well with MythTV. Hopefully we will test and get feedback on other devices and include the results here.
+
There are many Android TV devices now available. Mythfrontend now has a native client, from version 30, for Android and Android TV devices. The Nvidia Shield works well with MythTV. Hopefully we will test and get feedback on other devices and include the results here.
  
 
== Devices ==
 
== Devices ==
Line 19: Line 21:
 
|}
 
|}
  
[[Leanfront]], a MythTV client with native Android UI, supports 4K 60fps playback.
+
[[Leanfront]], a separate MythTV client with native Android UI, supports 4K 60fps playback.
 +
 
 +
Kodi can also be used as an alternative client along with the [https://kodi.wiki/view/Add-on:MythTV_PVR_Client MythTV PVR plugin].
  
 
== Operating System ==
 
== Operating System ==
Line 29: Line 33:
 
MythFrontend is not available in the play store at this time. You can download a package or build it yourself. To build it yourself see instructions at https://github.com/MythTV/packaging/tree/master/android.
 
MythFrontend is not available in the play store at this time. You can download a package or build it yourself. To build it yourself see instructions at https://github.com/MythTV/packaging/tree/master/android.
  
Download the package (apk file) from https://dl.bintray.com/bennettpeter/generic/ . There is a directory for each version (Currently only version 30) and under that directories for 32 bit and 64 bit versions. For Nvidia Shield select the 64 bit one.
+
Download the package (apk file) from https://drive.google.com/drive/folders/1LMf7dTK_fD_e1S3S2HgB1NEPsWI0MdyB . There is a directory for each version and under that directories for 32 bit and 64 bit versions. For Nvidia Shield select the 64 bit one.
 +
 
 +
The download site changed recently due to the fact that orangedox free version is being shut down in March 2024.
  
 
There are various ways of installing the apk on Android. If you have a browser on your android device you can simply download to there and let it install. You can also use a variety of Android apps to do this. However I recommend using adb as follows:
 
There are various ways of installing the apk on Android. If you have a browser on your android device you can simply download to there and let it install. You can also use a variety of Android apps to do this. However I recommend using adb as follows:
Line 90: Line 96:
  
 
If you install MythTV on a phone or a tablet, you may want to use the touch screen to control it. The touch screen support is rudimentary. See [[MythTV on Android]] for some information on gestures that can be used.
 
If you install MythTV on a phone or a tablet, you may want to use the touch screen to control it. The touch screen support is rudimentary. See [[MythTV on Android]] for some information on gestures that can be used.
 +
 +
=== Debugging ===
 +
 +
To obtain the mythfrontend log, run the following from your computer:
 +
<pre>
 +
adb connect ip_address
 +
adb logcat mfe:D *:S |& tee android.log
 +
</pre>
 +
 +
To change verbose logging options, first got into mythfrontend setup, remote control setup, and enable network remote control. Restart mythfrontend. Run the following from your computer:
 +
<pre>
 +
telnet ip_address 6546
 +
set verbose playback
 +
</pre>
  
 
==Device Specific Tips==
 
==Device Specific Tips==

Latest revision as of 23:30, 13 March 2024


Important.png Note: The download site for Android packages has changed Again. See below.

Overview

There are many Android TV devices now available. Mythfrontend now has a native client, from version 30, for Android and Android TV devices. The Nvidia Shield works well with MythTV. Hopefully we will test and get feedback on other devices and include the results here.

Devices

Device Comments
NVidia Shield TV Good support. MythTV has been optimized for this device.
4K videos can be played, but are scaled down to 1920x1080, even on 4K displays and TVs.
Amazon Fire TV Stick (not 4K) Not Recommended
Fair support. Video is jerky, some people are not worried by that.
4K is not supported.
It requires an amazon.com login.
Amazon Fire TV Stick 4K Good support.
4K does not work with MythTV at this time.
It requires an amazon.com login.

Leanfront, a separate MythTV client with native Android UI, supports 4K 60fps playback.

Kodi can also be used as an alternative client along with the MythTV PVR plugin.

Operating System

The Android package supports Android version 5.0 (Lollipop) or later. It comes in 32-bit and 64-bit packages. For Nvidia Shield, the 64-bit package is recommended; the 2019 "tube" version requires 32-bit.

Setup on Android

First you need to have a MythTV backend set up on your local network. The Android device will function as a remote frontend. It is best to use a wired connection, rather than wifi, especially if you are playing High Definition content.

MythFrontend is not available in the play store at this time. You can download a package or build it yourself. To build it yourself see instructions at https://github.com/MythTV/packaging/tree/master/android.

Download the package (apk file) from https://drive.google.com/drive/folders/1LMf7dTK_fD_e1S3S2HgB1NEPsWI0MdyB . There is a directory for each version and under that directories for 32 bit and 64 bit versions. For Nvidia Shield select the 64 bit one.

The download site changed recently due to the fact that orangedox free version is being shut down in March 2024.

There are various ways of installing the apk on Android. If you have a browser on your android device you can simply download to there and let it install. You can also use a variety of Android apps to do this. However I recommend using adb as follows:

  1. Enable installation of apps from unknown sources.
  2. Enable developer options on your android device as described in https://developer.android.com/studio/debug/dev-options.
  3. Enable USB Debugging in your android device. This will also enable debugging via the network (wifi or ethernet).
  4. Install adb on your Linux (or windows) computer. On Linux you can use your distribution package manager to install adb. On other environments, or if your distribution does not have adb, find it at https://developer.android.com/studio/releases/platform-tools.
  5. Find the ip address of your android device, either from the device itself or from your router. I recommend you set a reserved address in your router so that your device always gets the same ip address.
  6. On your computer, connect to the android device:
    adb connect ip_address
  7. On your computer, run the command to install:
    adb install -r package.apk
  8. After installation, if you do not see the application on the front screen, run it from the apps list in settings. After that it should show in your favorites.

If you previously installed a debug mythfrontend package or one signed by a different certificate, you will get an error. In that case you have to uninstall and reinstall mythfrontend.

Frontend Identifier

When you install mythfrontend an identifier is created for your frontend, in the format android-xxxxx where xxxxx is a random string of hexadecimal numbers. If you ever uninstall and reinstall mythfrontend, a different set will be created. This means your settings in the database will need to be recreated. You can avoid this problem by setting a custom id in the frontend. In Setup -> General -> Database Configuration ->Use Custom Identifier. Enter a name for the frontend here. Exit and restart for the setting to take effect. Any settings previously created for that name will be used after a restart.

Video Playback Profile

The "Mediacodec Normal" profile is best for most cases, however see below for selection of decoder. For a high-powered system such as a Shield, the OpenGL profiles can also be used if you have problems with Mediacodec, but in many cases they will impose too high a load and the playback will stutter.

There are three hardware decoder options available in the playback profile. These are "Android Mediacodec Acceleration (Decode Only)", "Android Mediacodec Acceleration" and "Standard". "Android Mediacodec Acceleration" will provide the best performance since this uses direct encoder to screen video mapping. If neither of the Mediacodec decoders works, you can use "Standard", which may provide worse performance but may in some cases solve playback problems. Note that you can set different decoder settings based of video type or size, so if a particular type of video needs standard decoding you can set it so that standard is used only for that type.

The "Mediacodec Normal" profile uses "Decode Only" so it is recommended to change the decoder to "Android Mediacodec Acceleration".

Audio

Audio options for android are OpenSLES and AudioTrack. OpenSLES only supports stereo output, although you may be able to get digital pass-through to work. AudioTrack supports all digital output formats that are supported by your android device. AudioTrack reverts to stereo when using time stretch. Note AudioTrack is only available on MythTV frontend version 31 and above. Currently Version 31 can be used with mythbackend prior versions.

If the audio stutters, try increasing the value in Video -> Playback -> Advanced ->Audio read ahead.

Digital Audio

This may work with OpenSLES, but OpenSLES does not officially support it and your results may vary. This is officially supported using AudioTrack.

If you have a sound system that can decode AC3, DTS, etc., digital audio can be passed through. To pass through digital audio, go into settings -> Display and Sound -> Advanced -> Surround Sound on the Android device, and select "Always" or "Automatic". Also go to setting -> Display and Sound -> Advanced -> Fixed volume and turn it on. Then go into MythTV Setup -> Audio -> Digital Audio Capabilities, and select the types of pass-through desired.

If you want to use multi-channel PCM, disable the "Stereo PCM Only" setting in audio -> Advanced.

Also, if you are using a Shield, go to settings -> Display and Sound -> Advanced -> Play comfort noise on HDMI and turn it off.

Remote Control

Android TV devices normally come with a remote. However you will need to setup your remote keys to activate appropriate actions in the frontend. Do this with Frontend Setup -> Edit Keys. Many actions will already work in the frontend, such as exit, arrow keys. There may be other remote keys that do not work as you expect. You can map keys to any action desired.

For limited remotes (i.e. remotes with very few buttons) such as the Nvidia Shield remote, there are some new features designed to help.

  • Long Press. You can set up to 16 keys to have two actions, a normal action that occurs when a key is pressed and a "long press" action for when the key is held down for a second. In Edit Keys you can add any keys you wish to context Long Press. Note that keys added here will lose any auto-repeat capability they have, so it is not advisable to set arrow keys to long press because that will slow down your browsing through lists of recordings, etc. After setting Long Press to a key, you have to exit Edit Keys and go in again before you can assign long press of that key to an action. I recommend you set Long Press Enter to Global Menu; it will appear as "Meta+Enter" This will mean you can always get to a menu, if your remote does not feature a Menu button.
On Shield, adding "Long Press" Back will seem to disable regular Back. To regain it, after adding "Long Press" Back and assigning it to a function, save the configuration and exit Edit Keys with "Long Press" Enter, then manually add "Back" to functions; I added it to Global | ESCAPE, and Main Menu | EXITPROMPT (or EXIT if you don't want to have to confirm).
  • OSD Navigation. In the TV Playback context there is a new action called OSDNAVIGATION. If you assign a key to this, then upon pressing that key during playback you will get an on screen navigation pane with the ability to jump, pause, fast forward, etc. We recommend you set the Enter button (normally a big button in the middle of the arrow navigation on the remote) to OSD Navigation.
  • Recording Groups. In the recording playback screen you normally have to use FWD and REW buttons to choose between recording groups. It can also be done using the Change Group Filter menu. In case there are no FWD and REW buttons on your remote, you can use the arrow keys to change group. To enable this you need to go into frontend setup -> Video -> Playback -> View Recordings -> Recording Groups and enable Change Recording Group using the arrow keys. This may require a change to the theme to work correctly. The MythCenter and Steppes Themes support this, others may not. Once you have changed the setting and installed a suitable theme, in the Watch Recordings page you can left arrow once or twice to get the list of recording groups focused, then navigate to the one you want. Then down arrow to get to the list of recording in that group.

On Nvidia Shield you can plug in a USB remote that simulates a keyboard, such as the Ortek remote, or even an actual keyboard. With the older Shield remote with the touch-sensitive volume slider which elsewhere in Shield pauses/resumes playback by tapping twice, the same functionality is available by adding the two taps as a keybinding in Edit Keys -> TV Playback -> PAUSE; it appears as "Media Play".

CEC

Some android TV devices include CEC support. This does not use the MythTV built in CEC support, but acts like a generic remote that simulates a keyboard. You can use your TV remote to control MythTV. Assign actions to keys using the Edit Keys settings, including Long Press if needed.

Operation

MythTV operation is the same as on other environments when using a remote or a keyboard to control it.

When exiting MythTV I recommend that you use the return button and reply to the Exit MythTV prompt. If you use the Android Home button, MythTV will prevent your backend from shutting down. This may change in future.

If you install MythTV on a phone or a tablet, you may want to use the touch screen to control it. The touch screen support is rudimentary. See MythTV on Android for some information on gestures that can be used.

Debugging

To obtain the mythfrontend log, run the following from your computer:

adb connect ip_address
adb logcat mfe:D *:S |& tee android.log

To change verbose logging options, first got into mythfrontend setup, remote control setup, and enable network remote control. Restart mythfrontend. Run the following from your computer:

telnet ip_address 6546
set verbose playback

Device Specific Tips

The following instruction might be specific for
v30
. Please update if it is outdated.

Nvidia Shield

Recommended Settings

Set these in Mythfrontend

Audio Setup Value
Audio -> Audio output device AudioTrack:
Audio -> Digital Audio Capabilities See note below
Audio -> Speaker Configuration Select the appropriate setting for your system.
Audio -> Upconvert Stereo Unchecked

If you select any of the Digital Audio Capabilities, you need to set the Surround Sound option in Android settings to "Always" or "Automatic"

Also go to settings -> Display and Sound -> Advanced -> Play comfort noise on HDMI and turn it off.

Setup -> Video -> Playback Value
Advanced Playback Settings ->
Enable new timestamp based playback speed (AVSync2)
checked
Advanced Playback Settings -> Allow YV12 unchecked
Advanced Playback Settings -> Allow UYVY checked
Add a new playback profile shield
shield -> Add New Entry Add two new entries
First entry -> Video Formats mpeg2video
First entry -> Decoder standard
First entry -> Max CPUs 4
First entry -> Video renderer opengl
First entry -> Primary deinterlacer Linear Blend (2x, HW-GL)
First entry -> Fallback deinterlacer Linear Blend (HW-GL)
Second entry -> Video Formats (blank)
Second entry -> Decoder Android MediaCodec decoder
Second entry -> Max CPUs 4
Second entry -> Video renderer opengl
Second entry -> Primary deinterlacer Linear Blend (2x, HW-GL)
Second entry -> Fallback deinterlacer Linear Blend (HW-GL)

Performance

You can use YV12 or UYVY playback. YV12 causes a green line at the bottom and right of the screen when the video is scaled. Avoid this by disabling YV12.

MPEG2 decoding suffers from pixellation when playing content from many USA TV stations. Avoid this by using standard decoder for MPEG2.

Deinterlace

The shield automatically deinterlaces content that is played using mediacodec decoder.

Amazon Fire TV Stick (not 4K)

This applies to the fire stick, not necessarily the 4K fire stick. The information may apply to other devices as well.

Recommended Settings

Set these in Mythfrontend.

Audio Setup Value
Audio -> Audio output device AudioTrack:
Audio -> Digital Audio Capabilities All unchecked
Audio -> Speaker Configuration Stereo
Audio -> Upconvert Stereo Unchecked

You may be able to use digital audio passthrough. This has not been tested.

Setup -> Video -> Playback Value
Advanced Playback Settings ->
Enable new timestamp based playback speed (AVSync2)
checked
Advanced Playback Settings -> Allow YV12 checked
Add a new playback profile firestick
firestick -> Add New Entry Add two new entries
First entry -> Video Formats mpeg2video
First entry -> Decoder standard
First entry -> Max CPUs 4
First entry -> Video renderer opengl
First entry -> Primary deinterlacer Linear Blend (HW-GL)
First entry -> Fallback deinterlacer Linear Blend (HW-GL)
Second entry -> Video Formats (blank)
Second entry -> Decoder Android MediaCodec decoder
Second entry -> Max CPUs 4
Second entry -> Video renderer opengl
Second entry -> Primary deinterlacer Linear Blend (HW-GL)
Second entry -> Fallback deinterlacer Linear Blend (HW-GL)

Internet Connection

To enable the device you need an internet connection and an amazon.com account.

If you subsequently operate without an internet connection, the home page will not display. It will only display a message to say it cannot reach amazon. In this situation, you can launch mythfrontend by selecting settings, applications, manage installed applications, mythfrontend. From there you can launch mythfrontend.

Performance

Video is somewhat jerky due to a limitation on how many frames per second can be played. For best results enable AVSync2.

You should enable YV12 playback (Mythfrontend -> Setup -> Video -> Playback -> Advanced Playback Settings -> Allow YV12). If you have YV12 disabled it will use UYVY and that setting causes a loss of resolution on the right hand side of the screen.

Deinterlace

Mediacodec on the fire stick does not detect interlaced content, and so the deinterlacer is not used. However software decoding of MPEG2 is fast enough. You can create a customized profile that uses software decoding for MPEG2 and mediacodec for others. This assumes that only MPEG2 video is interlaced.

Amazon Fire TV Stick 4K

Recommended Settings

Set these in Mythfrontend.

Audio Setup Value
Audio -> Audio output device AudioTrack:
Audio -> Digital Audio Capabilities All unchecked
Audio -> Speaker Configuration Stereo
Audio -> Upconvert Stereo Unchecked

You may be able to use digital audio passthrough. This has not been tested.

Setup -> Video -> Playback Value
Advanced Playback Settings ->
Enable new timestamp based playback speed (AVSync2)
checked
Advanced Playback Settings -> Allow YV12 checked
Advanced Playback Settings -> Extra stage checked
Add a new playback profile firestick
firestick -> Add New Entry Add two new entries
First entry -> Video Formats mpeg2video
First entry -> Decoder standard
First entry -> Max CPUs 4
First entry -> Video renderer opengl
First entry -> Primary deinterlacer Linear Blend (HW-GL)
First entry -> Fallback deinterlacer Linear Blend (HW-GL)
Second entry -> Video Formats (blank)
Second entry -> Decoder Android MediaCodec decoder
Second entry -> Max CPUs 4
Second entry -> Video renderer opengl
Second entry -> Primary deinterlacer Linear Blend (HW-GL)
Second entry -> Fallback deinterlacer Linear Blend (HW-GL)

Internet Connection

To enable the device you need an internet connection and an amazon.com account.

If you subsequently operate without an internet connection, the home page will not display. It will only display a message to say it cannot reach amazon. In this situation, you can launch mythfrontend by selecting settings, applications, manage installed applications, mythfrontend. From there you can launch mythfrontend.

Performance

You can use either YV12 or UYVY, whichever seems better to you. If you use UVYV you have to enable Extra Stage, otherwise you may see a blank screen instead of playback.

MPEG2 playback with mediacodec does not wprk, so you have to create a profile that uses standard decoding for MPEG2.