Kodi

From Elvanör's Technical Wiki
Revision as of 16:13, 13 December 2024 by Elvanor (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Installation and Configuration

  • To restrict resolution and refresh rate while playing videos, you can use the configuration option in System -> Settings -> Display -> Whitelist. You can then whitelist a set of acceptable resolutions and refresh rates. This is very useful if you want to play 4K videos at a lower refresh rate (for instance because your HDMI cable does not support 4K correctly).
  • If audio and video are desynchronized, very often this can be fixed by adjusting the refresh rate. For instance if the video source uses 25 fps instead of 24 which is more standard, or 50/60 fps. A Raspberry Pi 4 cannot (yet) support 60Hz at 4K resolution (and some TVs don't support 60Hz 4K as well), so the resolution should be lowered to HD. To manually choose a different resolution and refresh rate, go to the Settings menu while watching the video, choose Select Resolution and you will be presented with a list of available resolutions. It can be useful to whitelist only certain resolutions: Settings -> System -> Display -> Whitelist. In this case only the chosen resolutions will be presented as choices.
  • In Settings -> Player -> Videos, the "Adjust the display refresh rate" option may be able to switch resolution automatically so should be set. I believe it will attempt to automatically change the display resolution (and refresh rate) so that it matches the source video, but I' not sure if this always work. If it doesn't, adjust the resolution and refresh rate manually.
  • Note that the "Sync playback to display" (which is different than "Adjust the display refresh rate", it does not change the display refresh rate but instead try to adapt the speed of the video playback) has been removed in LibreELEC 10.

Gentoo

  • Currently it's better to use the bundled version of ffmpeg rather than the system one, as Kodi can rely on (very) old versions of ffmpeg, which can prevent system upgrades to newer versions. Use -system-ffmpeg as USE flag.

Android

  • On Android, it's a bit difficult to add a source (content directory) that's located on the external SD card. It's possible though, you just need to manually add the path. Getting the internal path of the SD card is a bit difficult; it can be for instance /storage/0123-4567/movies.

Interface

  • To remove outdated thumbnails, you can just remove the thumbnails directories (in ~/.kodi/userdata/Thumbnails folder).

Movie playback

Subtitles

  • Subtitles in PGS format cannot be scaled by Kodi (version 19), as they correspond to pictures. So settings about subtitles size, font, color etc are just ignored. Note that smplayer/mpv can still scale them.
  • media-video/mediainfo can give out all needed information about the tracks of an MKV file.

Corrupted Media

  • If Kodi crashes while seeking in a movie, there is a high probability that one of the track (video or audio) is somehow corrupted. You can have a look at logs to confirm, but switching the problematic track if possible (for example an audio track) will usually solve the issue.

Known Issues

  • Kodi currently has some issues with TrueHD audio tracks (see this bug).
  • Kodi does not properly support Dolby Vision (proprietary format / algorithm) so don't download files using Dolby Vision.

Retroplayer

  • Kodi (starting with version 18) includes Retroplayer, a game player based on retrolib. You can install normal arcade ROMs (from MAME, Sega Genesis, SNES etc) and directly play them from Kodi (you only need to install the required retrolib cores as Kodi add-ons).
  • It uses the standard file interface of Kodi, which works very well but can be cumbersome for a large collection of games. Several add-ons can be installed to better manage your game collection, such as Advanced Emulator Launcher (AEL).
  • Play a game just as you would play a movie, then it will ask you which core to use for this ROM. Note that for ZIP archives, the default action in Kodi opens them, so you need to bring the contextual menu and choose Play rather than use the default "Enter" action.
  • There is even an add-on named Internet Archive Game Launcher (IAGL) that will automatically download ROMs from the Internet and allow you to launch them.

Issues with Retroplayer (Kodi 18)

  • On some cores, like the Sega Genesis one, multiple controllers are not supported. This is a strange issue as it works perfectly well on Retroarch (on same LibreELEC distribution), and on some cores it works as well on Retroplayer (like the SNES core). But this issue is a blocker for a lot of games.
  • It seems there are no add-ons for the MAME controller profiles, so controllers are not auto-configured on Retroplayer when using the MAME cores (which is a pain). This also does not happen with Retroarch on the same distribution.

Issues with Retroplayer (Kodi 19)

  • Situation has improved with Kodi 19 (in particular it's possible to play Streets of Rage 3 on Sega Genesis with two controllers), but there are still lots of issues. For instance configuration of PS4 controllers seems very buggy.

DLNA Server

  • Kodi can act as a media server / DLNA server, meaning it can stream media to clients. This is called UPnP in Kodi and can easily be activated via the interface (but can also be added in the XML configuration file). Note that you will need the upnp flag on Gentoo for the corresponding interface to be shown.
  • Once the UPnP option has been activated, you need to define the data sources in Kodi. These folders will then be accessible by UPnP clients.

Catch-up TV

  • This is an excellent add-on that allows you to watch French TV channels (and others). To install it, follow the instructions at the home site.
  • You will need to install kodi-inputstream-adaptive add-on for Catch-up TV to work. On Gentoo it's directly available as an ebuild.

LibreELEC

General

  • LibreELEC is a full Linux based Kodi distribution. It works on x86 but also ARM, it has for instance a Raspberry Pi image available. It works very well out of the box and is extremely easy to install and configure (5 minutes and you will be playing videos on Kodi).
  • On LibreELEC 9.2.6 and a Raspberry Pi 4, EmulationStation does not seem to work (yet).
  • You can install RetroArch on a LibreELEC distribution easily (via the gamestarter KODI add-on repository). There are several issues (default Ozone theme does not work and must be changed to XMB, framerates were very low). However, it's still better than using the built-in Retroplayer, since it has several blocker bugs and don't support as many cores.
  • PlayStation 4 controllers via Bluetooth are well supported on LibreELEC.
  • xrandr is not available on LibreELEC, but you can use tvservice which is a similar tool (in particular tvservice -s).
  • To configure the SSH password, go to Settings -> LibreELEC -> Services -> SSH. This is of course different that the Kodi HTTP password used to remotely control Kodi (via Kore for instance).
  • You can check the LibreELEC version by looking at the file /etc/os-release. Upgrading is easy by using the interface in Kodi (LibreELEC settings).

Debug Logs

  • When enabled with the interface (Settings -> System -> Logging), debug logs (stanard logs and crash logs) are at:
/storage/.kodi/temp

Raspberry Pi

  • There is a specific configuration file at /flash/config.txt. Look at this article to edit it.
  • The second HDMI port does not have sound output by default. The first port (the one that does have sound) is the one nearest to the USB-C power port.