Hello All, this post describes Joker TV connection with Raspberry Pi 3.
Joker TV connected to Raspberry Pi 3 using USB cable. UHF/VHF and Satellite antennas also connected to Joker TV.
First of all, I have prepared a micro-SD card with the Raspberry Pi image on it:
sudo dd if=~/Downloads/2017-11-29-raspbian-stretch-lite.img of=/dev/sdg bs=4M
/dev/sdg is my micro-SD card. I have downloaded latest Raspbian image here. After that I connected Joker TV to Raspberry Pi using USB cable and booted up using the prepared micro-SD card.
Joker TV doesn’t require special Linux kernel drivers, so we could simply build regular user-level applications using this instruction or download a pre-compiled binary here. After building, we are ready to tune Joker TV to terrestrial or satellite TV channels. Joker TV supports a wide range of DTV standards:
DVB-S/S2 – satellite, is found everywhere in the world
DVB-T/T2 – mostly Europe
DVB-C/C2 – cable, is found everywhere in the world
ISDB-T – Brazil, Latin America, Japan
ATSC – USA, Canada, Mexico, South Korea
DTMB – China, Cuba, Hong-Kong, Pakistan
In the image above, UHV/VHF and satellite antennas are located on the roof of my garage lab and are used to receive signals as described in this post
Tuning to ATSC digital television channels with Joker TV and Raspberry Pi
We will start our test from tuning to ATSC signal. ATSC is the digital television standard used in USA, Canada, Mexico and South Korea.
Here is an output of tuning to NBC channel in Miami, FL:
pi@raspberrypi:~/src/libjokertv/build $ ./joker-tv -d 11 -f 575000000 -b 6000000 -m 7 TS outfile:out.ts usb device found. firmware version 0x2c allocated joker=0x1e3bf10 ########### Tuning to 575000000 Hz TUNE start process_service started helene_set_params(): tune frequency 575000kHz helene_get_tv_system(): HELENE DTV system 9 (delsys 11, bandwidth 6000000) TUNE done INFO: status=11 (NOLOCK) ucblocks=255, rflevel=-23.970 dBm, SNR 455.700 dB, BER -1.00e+00, quality 0 INFO: status=0 (LOCK) ucblocks=40, rflevel=-23.970 dBm, SNR 29.100 dB, BER -1.00e+00, quality 0 USB ISOC: all/complete=7936.590609/2090.298515 transfer/sec 4.12 MBytes 16.330457 mbits/sec, 62.004553 calls/sec INFO: status=0 (LOCK) ucblocks=0, rflevel=-24.360 dBm, SNR 29.400 dB, BER -1.00e+00, quality 2 USB ISOC: all/complete=8000.547657/2367.225534 transfer/sec 4.66 MBytes 18.493940 mbits/sec, 62.504248 calls/sec
we tuned to 575MHz using ATSC standard (‘-d 11’), bandwidth 6MHz (‘-b 6000000’) and 8VSB modulation (‘-m 7’). Joker TV has found signal and locked to it (‘LOCK‘ sign). Transport stream (TS) about 18Mbit/sec is coming from Joker TV and saved to out.ts file.
Tuning to Satellite digital television channels
Now we ready to try something harder. We will use Joker TV and Raspberry Pi to receive streams from satellite located on GEO orbit about 36000 kilometres above the Earth. My satellite dish antenna pointed to the Galaxy-18 satellite owned by Intelsat and located in geosynchronous orbit at 123° W longitude, serving the continental United States, Alaska, Hawaii, Mexico, and Canada.
Here is an output of tuning to Ku band DVB-S (‘-d 5’) transponder 12033MHz, symbol rate 8200KSym and Horizontal (‘-y 18’) polarization. I’m using Universal LNB with two local oscillators with frequency 9750Mhz and 10600MHz (‘-z 9750,10600,11600’).
pi@raspberrypi:~/src/libjokertv/build $ ./joker-tv -d 5 -f 12033000000 -s 8200000 -y 18 -p -z 9750,10600,11600 TS outfile:out.ts usb device found. firmware version 0x2c allocated joker=0x14dff10 ########### Tuning to 12033000000 Hz TUNE start process_service started joker_io: failed to read reply. ret=-7 transferred=0 expected 2 cxd2841er_attach(): I2C adapter 0x14e17f8 SLVX addr 66 SLVT addr 64 /home/pi/src/libjokertv/linux/drivers/media/dvb-frontends/cxd2841er.c: i2c wr failed=-1 addr=64 reg=00 len=1 cxd2841er_attach(): attaching CXD2854ER DVB-S/S2 frontend cxd2841er_attach(): chip ID 0xc1 OK. tps65233_attach(): attached at I2C addr 0x60 tps65233_set_voltage() Error: cable fail. Output current less than 50 mA Channel freq 12033.00 MHz, LO 10600.00 MHz, L-Band freq 1433.00 MHz helene_get_tv_system(): HELENE DTV system 29 (delsys 5, bandwidth 0) helene_get_tv_system(): HELENE DTV system 29 (delsys 5, bandwidth 0) TUNE done INFO: status=0 (LOCK) ucblocks=0, rflevel=57.495 dBm, SNR 0.000 dB, BER nan, quality 2 Trying to get programs list ... CAM: can't parse PMT CAM: can't parse PMT All PAT/PMT parse done. Program list is ready now. Program number=1 callback:service_name_update program number=1 name=Daystar HD type=0x1. video:yes audio:yes ES pid=0x31 type=0x2 ES pid=0x34 type=0x81 ES pid=0x35 type=0x81 USB ISOC: all/complete=7934.520212/1374.742923 transfer/sec 2.69 MBytes 10.740179 mbits/sec, 61.988377 calls/sec INFO: status=0 (LOCK) ucblocks=0, rflevel=57.423 dBm, SNR 6.800 dB, BER 1.52e-02, quality 2 USB ISOC: all/complete=8000.623064/1383.540286 transfer/sec 2.72 MBytes 10.808903 mbits/sec, 62.504837 calls/sec INFO: status=0 (LOCK) ucblocks=0, rflevel=57.423 dBm, SNR 6.700 dB, BER 1.52e-02, quality 2 USB ISOC: all/complete=8000.694505/1384.048028 transfer/sec 2.72 MBytes 10.812875 mbits/sec, 62.505364 calls/sec INFO: status=0 (LOCK) ucblocks=0, rflevel=57.431 dBm, SNR 6.700 dB, BER 1.60e-02, quality 2
Joker TV has found signal and locked to it (‘LOCK‘ sign). Transport stream (TS) about 10Mbit/sec is coming from Joker TV and saved to out.ts file. This is Daystar TV channel in FullHD quality.
Stress test and performance
One of the most interesting feature of Joker TV that I have implemented is the Transport Stream generator. It’s implemented inside FPGA and you can find Verilog source code here. Basically it sends data using USB Isochronous transactions as fast as it can. So, we can stress test all USB path from FPGA, through USB PHY, USB cable and host USB stack. Here is and output of our stress test:
pi@raspberrypi:~/src/libjokertv/build $ ./joker-tv -t TS outfile:out.ts usb device found. firmware version 0x2c allocated joker=0x1ecbf10 USB ISOC: all/complete=7942.780211/7942.780211 transfer/sec 15.62 MBytes 62.052940 mbits/sec, 62.052940 calls/sec USB ISOC: all/complete=8000.694505/8000.690536 transfer/sec 15.75 MBytes 62.505395 mbits/sec, 62.505364 calls/sec USB ISOC: all/complete=8000.345253/8000.341284 transfer/sec 15.75 MBytes 62.502666 mbits/sec, 62.502635 calls/sec USB ISOC: all/complete=8000.694505/8000.690536 transfer/sec 15.75 MBytes 62.505395 mbits/sec, 62.505364 calls/sec USB ISOC: all/complete=8000.444469/8000.440500 transfer/sec 15.75 MBytes 62.503410 mbits/sec, 62.503410 calls/sec
as you can see we receive 62.5Mbit/sec transport stream from Joker TV. This speed is maximum theoretical speed for USB Isochronous transactions if we send one 1024 byte packet every microframe (125 usec). USB standard allows to send up to 3 packets per microframe but in Joker TV I have implemented only one (it’s enough for regular use).
Received data saved to out.ts file and we can check that all bytes correctly received. I have prepared ‘tscheck’ utility to do this:
pi@raspberrypi:~/src/libjokertv/build $ ./tscheck -f out.ts -p file out.ts opened. Prev pattern 0x0 mismatch with current 0xc0. file offset=1880 (0x758 or 0 MB) TS stream validation done. 158461816 bytes (151 MB) processed 842871 pattern OK, 1 FAIL (0.00 %)
As you can see 151MB of data received correctly.
What about CPU usage when receiving this 62.5Mbit/sec transport stream ? It’s not too big, here is a screenshot:
As you can see CPU cores mostly in idle (97% idle).
I hope this article was useful. I have briefly described Joker TV usage scenarios. Feel free to send me questions or suggestions. I am also planning to write other articles with deeper description of Joker TV and Digital Television.