Difference between revisions of "Custom DATV Firmware for the Pluto"

From BATC Wiki
Jump to navigation Jump to search
Line 53: Line 53:
 
You can also easily add scrolling text messages to overlay across your images, various analogue and digital clocks, inputs from webcams, RTSP CCTV cameras, dancing chicken / cat overlays etc., there are a lots of choices. You probably want to spend a few hours clicking through the various menus to get a handle on the software options and what it can do. I found it fairly easy to set up sources and to be able to chop and change parameters whilst watching the DVB-S2 stream on another laptop. Within OBS it's also worth looking at the various extensions / add-ons that others have written for the platform, these basically are additional features for you to use. You will end up with something similar to my instance:
 
You can also easily add scrolling text messages to overlay across your images, various analogue and digital clocks, inputs from webcams, RTSP CCTV cameras, dancing chicken / cat overlays etc., there are a lots of choices. You probably want to spend a few hours clicking through the various menus to get a handle on the software options and what it can do. I found it fairly easy to set up sources and to be able to chop and change parameters whilst watching the DVB-S2 stream on another laptop. Within OBS it's also worth looking at the various extensions / add-ons that others have written for the platform, these basically are additional features for you to use. You will end up with something similar to my instance:
  
[[File:OBS Screen.png|647px]]
+
[[File:OBS Screen.png|585px]]
  
 
In my OBS 'scenes' I have an 'rtmp streamer' input, this allows me to use the camera / microphone in my Android mobile phone, along with software called Larix Broadcaster https://play.google.com/store/apps/details?id=com.wmspanel.larix_broadcaster - what this does is streams the video from the phone, but you cannot ingest this directly into OBS since you need an RTMP streaming server. You could use this mobile app to directly stream to the PLUTO SDR but then all the nice video processing features of OBS are lost. Luckily there is a thread at https://forum.batc.org.uk/viewtopic.php?f=69&t=6179 detailing what needs to be done to make build such a server, you can drop this onto one of your Raspberry PI's and it consumes very little CPU. Basically it uses NGINX HTTP server with an RTMP streamer plugin and just works. Point your phone and OBS at the PI's IP with the port defined in the configuration file, press the various go buttons and video / audio will be streamed from the phone into OBS.
 
In my OBS 'scenes' I have an 'rtmp streamer' input, this allows me to use the camera / microphone in my Android mobile phone, along with software called Larix Broadcaster https://play.google.com/store/apps/details?id=com.wmspanel.larix_broadcaster - what this does is streams the video from the phone, but you cannot ingest this directly into OBS since you need an RTMP streaming server. You could use this mobile app to directly stream to the PLUTO SDR but then all the nice video processing features of OBS are lost. Luckily there is a thread at https://forum.batc.org.uk/viewtopic.php?f=69&t=6179 detailing what needs to be done to make build such a server, you can drop this onto one of your Raspberry PI's and it consumes very little CPU. Basically it uses NGINX HTTP server with an RTMP streamer plugin and just works. Point your phone and OBS at the PI's IP with the port defined in the configuration file, press the various go buttons and video / audio will be streamed from the phone into OBS.

Revision as of 09:56, 16 October 2019

Forward

This is a preview of an article due for publication in CQ-TV 266, published here to promote early experimentation. Thanks to Paul M0EYT for writing it.

Before loading the custom firmware, it may be necessary to extend the frequency range of the Pluto. The instructions for this can be found on this web page: https://wiki.analog.com/university/tools/pluto/users/customizing. Scroll down to the bottom section "Updating to the AD9364".

You may also wish to enable the second CPU core as described here: https://www.ph4x.com/pluto-sdr-hack-2nd-cpu-core/

Introduction

Firstly, I'm not a DATV expert but have played with a number of SDR's over the years since my first SDR-14 back in 2005. I dabble in GHz stuff so have a rough idea what I'm doing but that’s about it! I like to make sure I learn something new related to technology every day, so both DATV and the PLUTO SDR fulfil this.I got the PLUTO after borrowing one from Jules, G0NZO and being super impressed by it, for the price you really cannot go wrong. It works out of the box, has TX+RX and with a few minutes work, can have its frequency range extended to cover 70MHz to 6GHz, not bad at all, plus it runs Linux internally (Linux pluto 4.14.0-g387d584d434e). The receiver is great and I used the loan unit to listen to all Bell Hill beacons up to 5.7GHz with something akin to a paperclip pushed into the RX port.

Pluto.png

This is the unit in question, shown to the left, it’s very compact at 5"X3"X1" with separate transmit and receive SMA sockets and a pair of micro USB sockets for I/O and power. It draws 400-420mA when idle or transmitting. When the QO100 narrow band transponder was used with PLUTO SDR's for TX, some frequency drift was apparent. It turns out that the integral TCXO wasn’t particularly good, so it's worth replacing it with a decent TCXO such as the ASTX-13-C-40.000MHz-I05-T which you can get from Mouser. This solves all frequency stability issues (well most...). For the ultimate stability, external GPSDO reference is still recommended.

First Steps

I've built the Portsdown filter/modulator unit for DVBS which performs really well, but was looking for a non-Lime-SDR method (it’s a long story) of generating DVBS28PSK and 16/32APSK DATV. I saw on Twitter that OM EvaristeF5OEO(@F5OEOEvariste) of rpitx fame was developing replacement firmware for the PLUTO that would provide DATV capabilities as well as some other goodies, so I pinged him a message and asked if I could beta-test the firmware. The firmware arrived quickly.The 'pluto.frm' file is copied into the root directory of the PLUTO mass storage memory, where the configuration files exist. Once copied up, 'eject' the device, don’t unplug the USB but use the software eject. The blue LED1 in the PLUTO will rapidly flash for 3 or 4 minutes then reboot and the mass storage device will reappear. Full details on this process are at https://wiki.analog.com/university/tools/pluto/users/firmware - don't unplug it during the flash process for obvious reasons; you might brick it. With the SDR still plugged into your PC, you can browse to the internal web-server by pointing a browser at http://192.168.2.1with all being well you should see something similar to the next screenshot:

Screenshot.png

Having updated the firmware and confirmed that it was working, next was the start of a massive learning curve…What would I need to use to generate some 'digital stream' with video in it? What software should be used?How does the stream get from the PC to the SDR? How do you set all the parameters needed to generate DATV? How do I get video from my phone camera into the PC? The list of questions was growing the more I looked into this stuff....

Digital Video Source

I know John GI7UGV as we work in the same industry and know that he's really into DATV, so had a chat with him and within minutes had VMIX (https://www.vmix.com/) installed – this looked like the easiest initial method of doing what I needed; make a PC generate some stream to control the PLUTO. This was pretty intuitive and within half an hour I had a test card source, spitting out the relevant data to the PLUTO. This was done by setting an external RTMP stream target with the following parameters:

URL : rtmp://192.168.2.1:7272/,437,DVBS2,QPSK,333,23,Pass : ,M0EYT,

The above parameters form part of the URL and are parsed by the F5OEO firmware to set the various DATV transmission parameters:

Frequency in MHz: 437
Mode (DVBS/DVBS2): DVBS2
Constellation (QPSK,8PSK,16APSK): QPSK (only QPSK in valid in DVBS)
SymbolRate in KS (33-2000): 333
FEC (12,23,34,67,78...): 23
CALLSIGN: M0EYT

It's particularly important to look at the RTMP stream definition syntax, probably best to cut & paste the above URL / pass text and then modify to suite your own requirements. With the PLUTO SDR plugged into the USB port of the PC running VMIX, it worked right away and a QPSK carrier was being generated at 437MHz, receivable on the Minituner. I had noted that VMIX was not free, so rather than spending hours with IDA, and having noted with John UGV had said, I decided to uninstall VMIX and give OBS (Open Broadcaster Software https://obsproject.com/download) a try.Since this is open source, there are no licensing 'difficulties' and although it's not as polished as VMIX, it's fully functional and just works.

OBS Basics

In OBS the first thing to do is to define the output stream so it points at the PLUTO SDR, so go to settings, stream, and type in the following, obviously tweaking the IP address, modulation parameters and callsign to suite your own environment:

OBS.png

You will be able to see a 'Controls' box docked at the bottom of the OBS window, this is where you press 'start streaming' to enable the PLUTO's DATV output. A green block should appear in the status bar indicating that streaming to the PLUTO is occurring. Before you jump in and press 'start streaming', you will need to set the streaming bitrate to avoid any overflows between OBS and the PLUTO. Visit http://www.satbroadcasts.com/DVB-S_Bitrate_and_Bandwidth_Calculator.html type in your DVBS/S2 parameters, press calculate, and make a note of the 'Netto TS bitrate' – you want to set your streaming bit rate to about 65% to 70% of this figure. So if the Net TS bitrate is 440Kbps you will want to set your video bitrate to say 286Kbps, better to set it on the lower side. This means that the video plus transport overheads will not cause overflows when streaming data into the PLUTO. Once you are familiar with the various bitrates, and your favourite settings, you will be able to guesstimate the video bitrate in OBS. It is set via 'settings', then 'output', then under the 'streaming' section type your bitrate. I have my encoder set to x264 compression and my audio bitrate set to 64Kbps. With these settings, there are no interruptions in the audio stream and everything works fluidly. Next, you will need a picture source, so the easiest method in OBS is to go to the 'scenes' dock, press +, enter a name for your scene, such as 'test card'. Next in the 'sources' dock, press +, select video capture device, create new, type in some name and press OK. You should see a 'colour bar / grey fade / bar' test card appear in the 'Preview' window. Ensure that in the 'Controls' dock, you have pressed 'Studio Mode' so you see Preview and Program windows. Whatever you see in the 'Program' window is the video that is being streamed to your PLUTO. You can set a number of 'scenes' so that you can quickly select and fade or cut between them. If you have desktop video files these are easy to add. You can create an additional scene and for example put a JPG/PNG image there, or add some desktop video. I found that my camcorder dumped its video out in a .VRO file, never heard of that, but OBS could ingest it and stream it correctly including the stereo audio tracks. You can also easily add scrolling text messages to overlay across your images, various analogue and digital clocks, inputs from webcams, RTSP CCTV cameras, dancing chicken / cat overlays etc., there are a lots of choices. You probably want to spend a few hours clicking through the various menus to get a handle on the software options and what it can do. I found it fairly easy to set up sources and to be able to chop and change parameters whilst watching the DVB-S2 stream on another laptop. Within OBS it's also worth looking at the various extensions / add-ons that others have written for the platform, these basically are additional features for you to use. You will end up with something similar to my instance:

OBS Screen.png

In my OBS 'scenes' I have an 'rtmp streamer' input, this allows me to use the camera / microphone in my Android mobile phone, along with software called Larix Broadcaster https://play.google.com/store/apps/details?id=com.wmspanel.larix_broadcaster - what this does is streams the video from the phone, but you cannot ingest this directly into OBS since you need an RTMP streaming server. You could use this mobile app to directly stream to the PLUTO SDR but then all the nice video processing features of OBS are lost. Luckily there is a thread at https://forum.batc.org.uk/viewtopic.php?f=69&t=6179 detailing what needs to be done to make build such a server, you can drop this onto one of your Raspberry PI's and it consumes very little CPU. Basically it uses NGINX HTTP server with an RTMP streamer plugin and just works. Point your phone and OBS at the PI's IP with the port defined in the configuration file, press the various go buttons and video / audio will be streamed from the phone into OBS. If you can get away from having any analogue video sources in your setup, your overall stream output will be digital from the sensor through to the display at the other end of your QSO. This means that quality will be maintained and you won't have poor quality audio with earth loops / buzzing or video that suffers from typical analogue artefacts.

System Integration

Having thought briefly about how to integrate the PLUTO into my existing QO100 narrow band system, I decided that it would be better to place all of the neededequipment into the ODU since it already has mains,10MHz ref, LAN, 70cms IFetc. feeding the outdoor box.

Pluto Network.png