user guide - RDK Central Wiki

RDK HDP – Raspberry Pi
USER GUIDE
Confidential - Any unauthorized disclosure is strictly prohibited
Version 1.0
1
RDK HDP – Raspberry Pi
TABLE OF CONTENTS
LIST OF TABLES ................................................................................................................................. 2
1 Introduction ................................................................................................................................. 2
2 Purpose ....................................................................................................................................... 3
3 Required Equipment ..................................................................................................................... 3
4 System Set-up ............................................................................................................................. 4
5 HDP CONFIGURATION .................................................................................................................. 5
5.1
Image Flashing ...................................................................................................................... 5
6
7
5.2
Modify partition size ............................................................................................................... 7
5.3
Launching WPE browser ......................................................................................................... 9
5.4
Media Population on the image for streaming ........................................................................ 10
Linear Channel Playback ............................................................................................................. 11
6.1
Raspberry Pi Media Client ..................................................................................................... 11
6.2
VLC Client Request .............................................................................................................. 11
6.3
RMFApp request .................................................................................................................. 11
Cloud Based EPG Playback Support ............................................................................................. 12
7.1
Youtube .............................................................................................................................. 12
7.2
HTML5 based URLs .............................................................................................................. 12
APPENDIX A: MPEG-2 License for Raspberry Pi .................................................................................. 14
No table of figures entries found.
LIST OF TABLES
No table of figures entries found.
1 INTRODUCTION
Raspberry Pi series are low cost credit card sized single board computers. The Raspberry Pi models
feature a Broadcom SoC that includes an and an on chip (GPU). Raspberry Pi uses SD card that
facilitates users to swap out different versions of the operating system or software updates, hence,
speeding the development and testing process. This is a great way to develop new
applications/software and show these to customers in remote locations or at trade shows.
Confidential - Any unauthorized disclosure is strictly prohibited
Version 1.0
2
RDK HDP – Raspberry Pi
The RDK media client software runs on the Raspberry Pi 2 and 3 devices and provides all the
features and functionality of an emulator along with an enhanced WPE browser.
Please contact us at info@RDKcentral.com for more information.
2 PURPOSE
This document contains set-up and other information to run the RDK-V gateway stack on a
Raspberry Pi 2 and Raspberry Pi 3 devices.
3 REQUIRED EQUIPMENT
The equipment listed below is required for complete functionality of the standalone environment.
The only devices that are tested to work properly in this solution are the specific brands and models
listed below. Support for other types of equipment is not available at this time.
1.
Two Raspberry Pi 2 or Raspberry Pi 3 device
2.
Standard USB keyboard
3.
Television set/monitor with HDMI input
4.
Ethernet cable
5.
SD Card
6.
TSOP4838 GPIO IR receiver
7.
Xfinity-XR2 Remote Control
Confidential - Any unauthorized disclosure is strictly prohibited
Version 1.0
3
RDK HDP – Raspberry Pi
4 SYSTEM SET-UP
1. Connect TV/Monitor to HDMI Video Output
2. Connect Ethernet cable to LAN port.
a. The other end of the Ethernet cable should be connected to the
network where DHCP server is running so that the Raspberry Pi device
gets assigned an IP address on boot-up.
b. Ensure that Raspberry Pi having hybrid image flashed, is also in the
same network.
c. Connectivity to Internet is required only if you want to play OTT content
such as videos from YouTube.
3. Connect Standard Keyboard to one of USB ports
4. Connect your IR receiver to the board per the diagram displayed below.
a. Pin 1 is DATA, connect it to GPIO 18 (Pin 12) on Raspberry-Pi
b. Pin 2 is GND, connect it to GROUND (Pin 6) on Raspberry-Pi
c. Pin 3 is POWER, connect it to 5V (Pin 1) on Raspberry-Pi
Confidential - Any unauthorized disclosure is strictly prohibited
Version 1.0
4
RDK HDP – Raspberry Pi
5. Insert the SD card into Micro SD Card Slot
6. Connect Power cable to Micro USB power Input
5 HDP CONFIGURATION
5.1 Image Flashing
1. Linux:


Insert an SD card in either the SD card port of the laptop or the USB SD card
reader.
Verify that the SD card has been detected by executing either of the commands
listed below:
◦ # lsblk
Confidential - Any unauthorized disclosure is strictly prohibited
Version 1.0
5
RDK HDP – Raspberry Pi
◦
# sudo fdisk –l
Notes: Remember to look at the size of the device to be sure that you have identified
the device number associated with your SD card. We use “dd” command to write the
generated image on the SD card, thus an incorrect identification may delete data from
your hard drive or other device of importance. In most case, the hard disk drive will be
at /dev/sda.

Type the following command to ensure that the partitions, if present, on the SD
card are not mounted
◦ # mount

Repeat the below command to unmount all the mounted partition present on
the SD card.
◦ # unmount <partition-mountpoint>

Execute the following command to flash the image on the SD card
◦ # sudo dd if=<r-pi sdimg> of=<SD card device> bs=1M
for ex:
# sudo dd if=rdk-mc-rpi.sdimg of=/dev/sdb bs=1M

Repeat the below command to unmount all the mounted partition present on
the SD card.
◦ # unmount <partition-mountpoint>

Remove the SD card and insert it to the Raspberry Pi SD card slot

Similarly flash the hybrid image on another SD Card and insert it to another
Raspberry Pi SD Card slot

Bring up both the devices
2. Mac

Follow the instructions provided in the link below to flash the image:
3. Windows

Follow the instructions provided in the link below to flash the image:
Confidential - Any unauthorized disclosure is strictly prohibited
Version 1.0
6
RDK HDP – Raspberry Pi
5.2 Modify partition size
Increase size of “ext3” File system based partition of SDCard. The increased partition is
required to copy media files for streaming. Any tools/utilities can be used to alter partition
size. The explanations captured below are using “Gparted” a linux-based tool to alter
partition size.
Follow instruction given below:-

Install ‘Gparted’ using below instruction:$ sudo apt-get install gparted

Once Gparted installed successfully. Open ‘Gparted’ with root privileges:-
“Gparted” graphical window shall appear.

Select “ext3” File System based partition of SDCard to alter partition size:-
Confidential - Any unauthorized disclosure is strictly prohibited
Version 1.0
7
RDK HDP – Raspberry Pi
In the above snapshot, the SDCard partition “/dev/mmcblk0p2” is of “ext3” File
system based partition, selected to modify the size. Click on “Resize/Move the
selected partition” option.

Enter new partition size in MBs. It is recommended to enter 2048MB at least.
In the above snapshot, the “New Size” of selected partition is 4096 MB.
Confidential - Any unauthorized disclosure is strictly prohibited
Version 1.0
8
RDK HDP – Raspberry Pi

Click on “apply all operations” to modify the size:-
Once the operation is completed. The SDCard can be inserted into Raspberry Pi
for image bring up.
5.3 Launching WPE browser





Insert the micro SD card with the flashed RDK hybrid image in the SD card slot of
Raspberry Pi.
Plug in the power cable to boot up the Raspberry Pi device
Type “root” when the login prompt is displayed
Check network connectivity.
Run following to launch XG1 guide
# WPELauncher http://<Hybrid image RPI ip
address>:8082/ui/guide.html
Confidential - Any unauthorized disclosure is strictly prohibited
Version 1.0
9
RDK HDP – Raspberry Pi
For ex:
# WPELauncher http://10.213.51.109:8082/ui/guide.html
5.4 Media Population on the image for streaming
The hybrid implementation on Raspberry Pi emulates QAM source using media files on the
file system. These media files should be placed in proper location at Raspberrypi and make
necessary configuration related changes before tuning a channel from headed gateway or
a client.
Rerun the „rmfStreamer‟ just after making all the changes as suggested:-

Copy your SPTS media files to /opt/www directory on Raspberry Pi:-
As per the snapshot, two media files present at recommended location at
Raspberry pi.

Modify config file /usr/bin/tune.config to reflect the actual path and name of
media files copied in above step:$ vi /usr/bin/tuner.config

Map 'sourceid' (ocap locator) present in /usr/bin/sidb.xml with corresponding
media file entry present in /usr/bin/tune.config by mapping similar value of
'modulation_mode' and 'frequency' as shown below:-

Rerun the rmfStreamer with modified configuration:$ kill -9 <rmfStreamer Pid>
$ /usr/bin/rmfStreamer –config /opt/rmfconfig.ini –
debugconfig /etc/debug.ini
Confidential - Any unauthorized disclosure is strictly prohibited
Version 1.0
10
RDK HDP – Raspberry Pi
6 LINEAR CHANNEL PLAYBACK
Linear Channel playback is main functionality support by RaspberryPi Gateway device.
RaspberryPi as Gateway device shall receive Linear Channel playback request from either
MediaClient RaspberryPi device or any other client application such as VLC Player, RDK
inbuilt application rmfApp etc.
6.1 Raspberry Pi Media Client
Note: This Section will be updated once Wizardkit application shall be merged into CMF repository.
6.2 VLC Client Request
Linear Channel playback is main functionality support by RaspberryPi Gateway device. RaspberryPi
as Gateway device shall receive channel tuning request from other either RaspberryPi acting as
Media Client or any media client application such as VLC Player, RDK inbuilt application rmfApp etc.
VLC player can act as Media Client to send linear channel playback request to RaspberryPi
(Gateway).
Open VLC from same network where Raspberry Pi (Gateway) connected and generate channel
playback request. Use following format as below:http://<IP Address of Gateway Raspberry Pi>:8080/vldms/tuner?ocap_locator=ocap://<Source ID in
Hexa>
Eg.
http://10.213.51.116:8080/vldms?tuner?ocap_locator=ocap://0xa2 //0xa2 is Hexa convertion of
ocap locator 162
VLC should get IP Streaming over the network and should start the playback.
6.3 RMFApp request
RMFApp, an RDK inbuilt application, can also be used to send Linear Channel playback request to
Gateway Device.
Find below steps to use rmfApp to send linear channel playback request:$ cd /usr/bin
$ export USE_GENERIC_GSTREAMER_TEE=TRUE
$ ./rmfApp
$ rmfApp-> play http://<Ip Address of Gateway
Device>:8080/vldms/tuner?ocap_locator=ocap://<Hexa ocap locator>
Eg.
Confidential - Any unauthorized disclosure is strictly prohibited
Version 1.0
11
RDK HDP – Raspberry Pi
$rmfApp-> play
http://10.213.51.116:8080/vldms/tuner?ocap_locator=ocap://0xa2
The requested channel shall be tunned to Display device connected to the Raspberry Pi HDMI port.
7 CLOUD BASED EPG PLAYBACK SUPPORT
7.1 Youtube
To play audio/video over the internet, type the following command
# WPELauncher <YouTube URL>
Press ESC key on keyboard or EXIT key on Xfinity remote control to exit the YouTube video.
7.2 HTML5 based URLs
Integrated WPEBrowser can be used to access cloud based URLs. The WPEBrowser having media
player plugins enabled by default to playback media contents.
Following RDK-OTT (cloud based URL) can be used to access using WPE Browser:$ WPEBrowser http://107.21.252.26/scte/rdkott/
The above HTML page shall be displayed on the connected display device. You can navigate
using keyboard and play the media contents.
$ WPEBrowser http://107.21.252.26/scte/WeatherLow/
Confidential - Any unauthorized disclosure is strictly prohibited
Version 1.0
12
RDK HDP – Raspberry Pi
The HTML page shall display the Weather information for listed cities.
Confidential - Any unauthorized disclosure is strictly prohibited
Version 1.0
13
RDK HDP – Raspberry Pi
APPENDIX A: MPEG-2 LICENSE FOR RASPBERRY PI
You will be required to purchase license to play MPEG-2 TS streams on a Raspberry-Pi device.
You can purchase the license key from the Raspberry Pi portal.
URL:
Read the “Product Description” section carefully on the above link and order the MPEG-2 license
key for your Raspberry-Pi device. You should receive the license key on your registered email
address.
Follow these steps to enable codecs on your device(s):
1. Linux:
 Insert an SD card in either the SD card port of the laptop or the USB SD card reader.
 Verify that the PC detects the SD card by executing either of the commands listed
below:
# lsblk
# sudo fdisk –l
 Type the following command to check that the partitions on the SD card are mounted
# mount
 If not mounted, mount the FAT partition on the SD card with the following command
# mount /dev/mmcblk <partition-mountpoint>
 Open and edit the config.txt file. Add the following line at the end of the file.
# decode_MPG2=<Your_mpeg-2_licenseKey>
For ex:
# decode_MPG2=0xf628130b
 Save and close the file
 Remove the SD card and insert it to the Raspberry Pi SD card slot
 Following command will report codecs status:
# vcgencmd codec_enabled MPG2
Confidential - Any unauthorized disclosure is strictly prohibited
Version 1.0
14