Saturday 18 August 2018

How to cast movies from Kodi to Chromecast on a PC

There are lots of guides out there showing how to cast media from an android device via Kodi to Chromecast, but just a few for how to cast from a PC.

After doing some research, I found that I can cast from Kodi to Chromecast by using VLC media player as an external player. Note that you will need VLC v3.0+ for this to work, since Chromecast support was added after this version.

The steps below show how I did it on my Ubuntu laptop, but same procedure should work on ther Linux distros as well. Also, same logic should apply on Windows machines.


Steps

  • Install latest version of Kodi
  • Install latest version of VLC media player (v3.0+)
  • Copy the following content and create this file in your home folder .kodi/userdata/playercorefactory.xml . This is basically saying to Kodi to use VLC to playback the media content instead of its built in player.Please modify any settings according to your specific setup.
  • Open Kodi and start a movie.
  • Wait for VLC to open, it should start the playback shortly.
  • In order to cast to Chromecast, use Playback , Renderer , Chromecast Device


Before this method, I was using Google Chrome to do the playback, by using its "cast tab" option, but the playback was very choppy compared to VLC.


Saturday 11 August 2018

Xorg unable to detect screens in CentOS7

Summary

On a machine with  2 graphics card, one on-board Intel graphics and one NVidia graphics, Xorg is not able to properly detect the 2 screens connected to NVidia card. As a result of this, GUI login screen (GDM) does not show up. 


Some background

BIOS is configured to use NVidia card as the primary graphics card however Xorg is unable to detect the screens. The following lines are logged at the end of the /var/log/Xorg.0.log file ...

[    22.885] (EE) No devices detected.
[    22.902] 
Fatal server error:
[    22.902] no screens found
[    22.902] 
Please consult the The X.Org Foundation support 
         at http://wiki.x.org
 for help. 
[    22.902] Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[    22.902]


The reason

This behaviour occurs due to the fact that the machine has 2 graphics card. Somehow the onboard Intel card takes priority over the NVidia card, even though the latter is set as the primary card in BIOS.As a result of this, Xorg is unable to detect the monitors, which are connected to NVidia card.


The solution

The solution for me was to create the following file /etc/X11/xorg.conf.d/10-nvidia.conf and add the following lines..

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BusID          "PCI:1:0:0"
EndSection

By doing this you are basically telling Xorg to use NVidia card as the primary card. One thing to note is the BusID line. You should find the correct bus id entry for your card. You can do so by using the following command...

# lspci | grep VGA

00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller (rev 06)
01:00.0 VGA compatible controller: NVIDIA Corporation GM107GL [Quadro K620] (rev a2)

Also, note that the format is slightly different in 10-nvidia.conf,  (1:0:0) instead of (01:00.0).