Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
kodi [2021/10/19 05:10] – [Fix internet access for Kodi] cleanup atarikodi [2023/03/31 22:56] (current) stvhay
Line 2: Line 2:
  
 If you haven’t heard already, **Kodi** is available with **Batocera**. It’s been preinstalled and configured for controller support. If you haven’t heard already, **Kodi** is available with **Batocera**. It’s been preinstalled and configured for controller support.
 +
 +<WRAP center round help>
 +Kodi is not available on oga/rk3326, orangepi-zero2, rpi1 and rpizero2-based images due to not being able to play videos well and a lack of rotation (most oga/rk3326 devices' screens are actually in portrait aspect ratio rotated 90 degrees). This may change in the future as developments are made.
 +</WRAP>
  
 ===== What is Kodi? ===== ===== What is Kodi? =====
  
 Kodi is a free and open-source media player software application developed by the XBMC Foundation, a non-profit technology consortium. Kodi is available for multiple operating systems and hardware platforms, with a software 10-foot user interface for use with televisions and remote controls or gamepads. It allows users to play and view most streaming media, such as videos, music, podcasts, and videos from the Internet. It supports all common digital media files from local and network storage media. Kodi is a free and open-source media player software application developed by the XBMC Foundation, a non-profit technology consortium. Kodi is available for multiple operating systems and hardware platforms, with a software 10-foot user interface for use with televisions and remote controls or gamepads. It allows users to play and view most streaming media, such as videos, music, podcasts, and videos from the Internet. It supports all common digital media files from local and network storage media.
- 
-{{ ::kodi_youtube.png?nolink&400 |}} 
  
 ===== Enable and use Kodi ===== ===== Enable and use Kodi =====
Line 14: Line 16:
  
   * Make sure Kodi is enabled in the **SYSTEM SETTINGS** -> **KODI SETTINGS** menu   * Make sure Kodi is enabled in the **SYSTEM SETTINGS** -> **KODI SETTINGS** menu
-  * From this menu, you can associate Kodi to the ''X'' button, or enable it at Batocera start. +  * From this menu, you can enable Kodi at Batocera start if you wish
-  * Then, when enabled and depending on the configuration options, you can launch Kodi with the ''X'' button, or the first entry in the main menu when you press the ''start'' button on your controller+  * Then, when enabled and depending on the configuration options, you can launch Kodi from the first entry in the **MAIN MENU**
-  * Once you are in the Kodi interface, to exit and get back to Batocera's game menu, you can press ''select'' and click on the **on/off** icon in the top left corner of the screenshot below, and select **exit** from this menu.+  * Once you are in the Kodi interface, to exit and get back to Batocera's game menu, you can press ''[SELECT]'' and click on the **on/off** icon in the top left corner of the screenshot below, and select **exit** from this menu.
  
-{{ ::kodi_weather.png?nolink&400 |}}+{{ :kodi_weather.png?nolink&600 |Using the weather widget in Kodi.}} 
 + 
 +===== Configure 5.1 surround sound ===== 
 + 
 +By default, Kodi will only output stereo sound via two channels, even if [[:audio_issues#not_all_of_my_speakers_are_being_used|Batocera is otherwise configured to use surround sound]]. This can be fixed by launching Kodi and going to the settings cog -> **System** -> **Audio** -> **Number of channels** and setting it to whatever the current amount of speakers are in your configuration (#.1 commonly refers to there being a subwoofer). 
 + 
 +{{:channel_number.png?nolink&600|}} 
 + 
 +Now all will rocks. 8-) 
 + 
 +===== Enabling Binary Add-ons ===== 
 + 
 +When you first run Kodi, many of the binary add-ons that ship with Kodi are not enabled. To view your add-ons, navigate to **Add-ons** then **My add-ons**, which will list all of your add-ons by category. Here is a list of some of the add-ons you might want to enable: 
 + 
 +^ Plugin Category  ^ Plugin Name           ^ Purpose                                                                    ^ 
 +| Image decoder    | HEIF image decoder    | This plugin will enable Kodi to read images from (probably) your iPhone.   | 
 +| Image decoder    | libraw image decoder  | This plugin will enable Kodi to read images from your RAW-shooting camera 
 +| Look and feel    | Screensaver           | There are a lot of these. Choose some fun ones.                            | 
 +| Look and feel    | Visualisation         | These are a lot of these too. Definitely check out ProjectM                | 
 +| PVR clients      | --                    | If you have a PVR, you can enable the add-on here.                         | 
 + 
 +This is not an exhaustive list of binary add-ons, but should get you off to a good start.  Also note that there are many, many other add-ons available for download from the Kodi repository.
  
 ===== Netflix ===== ===== Netflix =====
Line 26: Line 49:
 Workaround to force always the same ''machine-id'': Workaround to force always the same ''machine-id'':
  
-1. Log [[access_the_batocera_via_ssh|through SSH]] on your Batocera machine.+  - Log [[access_the_batocera_via_ssh|through SSH]] on your Batocera machine
 +  - Save permanently your current ''machine-id'' with the following commands: <code bash> 
 +cat /var/lib/dbus/machine-id > /userdata/system/machine-id 
 +ln -sf /userdata/system/machine-id /var/lib/dbus/machine-id 
 +batocera-save-overlay 
 +</code> 
 +  - Now, your UUID is saved in ''/userdata/system/machine-id'' and will not change on each reboot, and Netflix shouldn't ask for your credentials every time
  
-2. Save permanently your current ''machine-id'' with the following commands: +Caveat: you have to recreate the symbolic link and [[:modify_the_system_while_it_s_running|save the overlay after each Batocera upgrade/downgrade]].
-   # cat /var/lib/dbus/machine-id > /userdata/system/machine-id +
-   # ln -sf /userdata/system/machine-id /var/lib/dbus/machine-id +
-   # batocera-save-overlay +
- +
-3. Now, your UUID is saved in ''/userdata/system/machine-id'' and will not change on each reboot, and Netflix shouldn't ask for your credentials every time.  +
- +
-Caveat: you have to recreate the symbolic link and [[modify_the_system_while_it_s_running|save the overlay after each Batocera upgrade/downgrade]].+
  
 ===== Fix local network access for Kodi ===== ===== Fix local network access for Kodi =====
Line 41: Line 63:
 To fix local network access (such as NAS, networked TV devices, media servers, etc.) for Kodi on Batocera there is a very simple thing to do! To fix local network access (such as NAS, networked TV devices, media servers, etc.) for Kodi on Batocera there is a very simple thing to do!
  
-In Kodi, navigate to **Settings** -> **Services** -> **SMB client**+In Kodi, navigate to **Settings** -> **Services** -> **SMB client**.
      
 And change its two parameters: And change its two parameters:
Line 67: Line 89:
  
 <wrap lo>Source: [[https://kodi.wiki/view/Settings/Services/SMB_Client#Minimum_protocol_version]]</wrap> <wrap lo>Source: [[https://kodi.wiki/view/Settings/Services/SMB_Client#Minimum_protocol_version]]</wrap>
 +
 +===== Add the Youtube Kodi add-on =====
 +
 +<WRAP center round important>
 +Adding the Youtube add-on for Kodi requires a bit of manual work, and some knowledge on how Google services use API keys and application access rights. It's **NOT** easy to configure for anyone, unfortunately.
 +</WRAP>
 +
 +There's a Youtube plugin available for Kodi, but it requires a few install steps, from very easy to a bit complicated.
 +
 +  - Install the Youtube plugin from the Kodi Add-on repository. Go to the Settings (gear icon) -> Add-ons -> Install from repository -> Kodi Add-on repository -> Video add-ons -> Youtube (at the end of the list). It might also download dependencies, depending on the other add-ons you already installed.
 +  - Launch the Youtube Add-on, from the "Add-ons" menu.Click on "sign-in". The first time, you'll get a message box, telling you to log twice. Do as requested, and on a computer or smartphone with your, sign in with a web browser to the URL that is given to you from the plugin ''google.com/device'' and enter the code provided. Google will ask you to authenticate, with potentially MFA, depending on your Google setup. Then, Google will tell you that you can access Youtube on your TV. That seems easy enough.... but it's wrong, there's an additional step.
 +  - From your browser, go to ''https://console.developers.google.com/''. Create a project, let's call it **Youtube K-Addon** You will need to create for this project an ''API key'' (with no restriction when created) and an ''OAuth client ID'', and make sure you use **TV and limited input** type. This OAuth client ID, once generated, will give you access to a ''client ID'' and ''client secret''.
 +  - Go back to the Youtube plugin, **Settings** (last option in the list), select **API** on the left-hand side menu and put:
 +    - ''API Key'': <your api key>
 +    - ''API Id'': <your client ID>
 +    - ''API Secret'': <your client secret>
 +    - ''Allow developer keys'': turn it "ON" <WRAP center round tip>
 +These keys are very long, but there is an option to help you with copy/paste: toggle the ''Enable API configuration page'' and then you can enter the three fields above if you point your browser to [[http://<batocera_ip>:50152/api]].
 +</WRAP>
 +  - Redo step 2 you'll be prompted with a new code, but then you'll be able to use the Youtube Add-on.
 +
 +{{:youtube-sign-in.png?nolink&600|Code entry.}}
 +
 +And that's it, you'll now have Youtube running in Kodi in Batocera. Enjoy it until Google once again changes how this API works!
 +
 +{{:kodi_youtube.png?nolink&600|The Youtube add-on running in Kodi.}}
 +
 +===== Wait for NAS connection before start =====
 +
 +Batocera can check for if a network server (e.g. NAS, SQL server, etc.) is available or not before starting Kodi. This can avoid situations such as where Kodi might be set to start on boot and starts before the network connection is available, causing a variety of issues (videos not playing, shares not loading correctly, crashing issues, etc.)
 +
 +Open ''batocera.conf'' and scroll down to the following commented out line:
 +
 +<code>
 +#kodi.network.waithost=192.168.0.50
 +</code>
 +
 +There will be a short summary explaining it and its related key settings. Fill out the values appropriately and uncomment the lines, then save the document. An example might end up looking like this:
 +
 +<code>
 +kodi.network.waithost=192.168.0.10
 +kodi.network.waittime=10
 +kodi.network.waitmode=wish
 +</code>
 +
 +The first two settings are self-explanatory. The third setting, ''waitmode'', has three options:
 +  * ''noping'' -> Do not ping. Start Kodi immediately. This is the default.
 +  * ''required'' -> Wait up to the specified time for the host to respond. Start Kodi only if the host responds.
 +  * ''wish'' -> Wait up to the specified time for the host to respond. Start Kodi if the host responds or the waittime is reached.
  
  • kodi.1634613051.txt.gz
  • Last modified: 2 years ago
  • by atari