Friday, March 25, 2016

Live TV DVB-T2 with VDR Addons on OpenELEC

I have Geniatech DVB-T2 Stick T220.
I use OpenELEC to play Live TV with it.

Current version of OpenELEC is 6.0.3.

First install services add-ons VDR PVR Backend.
Goto: System -> Settings -> Add-ons -> Install from repository -> OpenELEC Add-ons (offical) -> Services -> VDR PVR Backend

Install VDR PVR Backend

After Installed. Go back to PVR clients.

Install VDR VNSI Client (If VDR VNSI Client is not installed)

Select Configure of VDR VNSI Client.

Enable create channel groups automatically on the server And OK.

Next Goto Home -> Programs -> VDR Configuration

Select Channel scanner Configuration

Start scanning TV channel.
  • Tuner Type: DVB-T
  • Country: <your location>
  • Cleanup all
And Start

After scan completed. Select Close.

Enable TV menu on OpenELEC
Goto: Home -> System -> Settings -> TV

Select Enable:  General -> Enabled and Synchronis channel groups with backend(s)

Go back to Home and Select TV

Now already to watch Live TV from DVB-T2 Device and recording.

Have a good day. :)


VDR PVR Backend has other plugins to use.
You can enable on configure menu.

Goto: Home -> System -> Settings -> Add-ons -> Install from repository -> OpenELEC Add-ons (offical) -> Services -> VDR PVR Backend

Select Configure.

You can enable other plugins if you want to use.

VDR - The Video Disk Recorder

VDR Wiki

Thursday, March 24, 2016

Add custom keyboard layout to OpenELEC image

OpenELEC system partition on Raspberry PI is read-only filesystem (squash filesystem or squashfs).
I cannot change anything of system partition or add custom keyboard layout.

If you want to change something on this filesystem, you should unpack and repack squashfs image.

I use Ubuntu 15.10 for repack squashfs image.

First install squashfs-tools for re-create squashfs image.
$ sudo apt-get update
$ sudo apt-get install squashfs-tools

Download OpenELEC Image and extract compress file.

Backup original and copy to new image file.

$ cp OpenELEC_original.img OpenELEC_custom.img

Mount image file to loop device (/dev/loop0)
$ sudo losetup -P /dev/loop0 OpenELEC_custom.img

option -P for create a partitioned loop device (/dev/loop0p1, /dev/loop0p2)

Check partitioned loop device with fdisk.
$ sudo fdisk -l /dev/loop0
Disk /dev/loop0: 548 MiB, 574619648 bytes, 1122304 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x3902d568
Device       Boot   Start     End Sectors  Size Id Type
/dev/loop0p1 *       2048 1050624 1048577  512M  c W95 FAT32 (LBA)
/dev/loop0p2      1052672 1118208   65537   32M 83 Linux

It created /dev/loop0p1 and /dev/loop0p2.

Create boot and system directory
$ mkdir boot system

Mount  first loop partition (/dev/loop0p1) to boot partition.
$ mount -t vfat /dev/loop0p1 boot

Check all file on boot partition.
$ ls boot
bcm2708-rpi-b.dtb       bootcode.bin  fixup.dat   start.elf
bcm2708-rpi-b-plus.dtb  cmdline.txt   kernel.img  SYSTEM
bcm2708-rpi-cm.dtb      config.txt    overlays

It found SYSTEM file (OpenELEC system filesystem).

Mount SYSTEM file to system partition.
$ mount -t squashfs boot/SYSTEM system

Check all file on system partition.
$ ls -F system
bin/  etc/    lib/    opt/   run/   storage/  tmp/  var/
dev/  flash/  media@  proc/  sbin/  sys/      usr/

Create temporary directory for copy all file on system partition and add custom keyboard layout.
$ mkdir tmpsystem

Copy all file of system to temporary directory
$ sudo cp -Rpf system/. tmpsystem

After copy all file to temporary directory.
Unmount system filesystem.
$ sudo umount system

OK. Now you can change everything on temporary directory.

Location Kodi system data on OpenELEC: /usr/share/kodi

Kodi keyboard layout directory on OpenELEC (/usr/share/kodi/system/keyboardlayouts)
You can add custom keyboard layout or change exists keyboard layout on this directory.

Now: tmpsystem/usr/share/kodi/system/keyboardlayouts

Example. I want to add Thai keyboard layout (thai.xml) to this directory.
Copy thai.xml to tmpsystem/usr/share/kodi/system/keyboardlayouts
$ sudo cp thai.xml tmpsystem/usr/share/kodi/system/keyboardlayouts

OK. Now you finished to change temporary directory.

I will re-create system filesystem  (SYSTEM file) from temporary directory with mksquashfs.

$ sudo mksquashfs tmpsystem SYSTEM -noappend -comp gzip

Now. I have new SYSTEM file.

Delete SYSTEM file on boot partition.

$ sudo rm boot/SYSTEM

Copy new SYSTEM file to boot partition.

$ sudo cp SYSTEM boot

Unmount boot partition.

$ sudo umount boot

Deattach loop device from OpenELEC image.

$ sudo losetup -d /dev/loop0

Delete temporary directory

$ sudo rm -Rf tmpsystem

OK. Now. OpenELEC image (OpenELEC_custom.img) has changed.

Try to write image to sdcard for test it.

Goto  System -> Settings -> Appearance -> International -> Keyboard layouts
Select Thai keyboard layout.


You can add font to Kodi on system font path: /usr/share/kodi/media/Fonts.