Technically not an OpenSuSE post, I know!
date: Sept. 2016
What you need:
- Raspberry Pi (I'm using a first generation model B rev 2 with 512MB RAM) and power supply
- SD card
- Hauppauge HVR-1900 connected to set-top box (Composite cables to SCART conversion plug)
- External USB drive
1. Install Raspbian on SD cardGo to https://www.raspberrypi.org/downloads/raspbian/ and download the Raspbian Jessie Lite (almost everything you need is already included in this image)
Follow the already well documented instructions to write this image to an SD card (and make sure you use a working card)
Make sure the external devices (HDD and HVR-1900) are already connected BEFORE powering on your Pi!
I'm working headless so all I need is the IP address of the Pi after it boots. This page can help you.
Use an SSH-client to connect to the ip address with username "pi" and default password "raspberry".
Now start the built-in configuration assistant to configure basic settings (more info here):
- change the user PASSWORD (option 2)
- set the correct LOCALE (option 5, sub option 1, nl_BE.UTF-8 UTF-8 in my case)
- set the correct TIMEZONE (option 3, sub option 2, Europe/Brussels in my case)
2. Configure HVR-1900The HVR-1900 is not working out of the box. The drivers and the utilities are already loaded (pvrusb2 module and v4l2-utils are included in the raspbian distribution) but we are still missing the firmware.
Let's check the kernel ring buffer messages for relevant output:
The HVR-1900 is a device that will load all necessary firmware when it is connected. To get it working you need the correct firmware files in the correct folder and retry the connection.
On some other linux distributions you have to download the appropriate files for your device (or extract them from the official windows drivers) and put them in the correct path (e.g. /lib/firmware)
So download this file and copy it to /lib/firmware
also install some other firmwares that are supplied in packages
Now that you have all the necessary files you can reload the driver by typing:
The dmesg command should now show something like this
Now do a quick test recording
Telenet digicorder specific (and maybe other set-top boxes): The scart output of the digicorder (DC-AD2100) has some quirks. In my case, the digicorder is connected to the TV using HDMI and to the HVR-1900 using scart-to-composite connectors. I found that you need to turn on the TV and watch the content you wish to record otherwise you only get sound. Also, make sure the audio volume of the digicorder is not too high because otherwise you get bad quality.
Now get the file from your Pi (using an sftp client like filezilla) and check it with an MPEG capable player (like VLC). Since the scart output is interlaced you will need to activate the deinterlace function of you player to get rid of the horizontal lines during quick movement.
3. Automount the external driveFirst, get the details of the connected device
I'm looking for a Toshiba drive so it is the last line. The UUID is the unique number of this drive that well remain the same across reboot or even on other machines.
Now we need to mount the device to a local folder for easy access. To do this you need to create a subfolder at /mnt.
Now edit the /etc/fstab file and add one line to the end. Press CTRL+X to exit and save the file:
UUID is the unique ID for that disk
/mnt/usb is the mountpoint you want to use
ext4 is the filesystem type for this disk
auto,users are settings related for automount and security
0 0 is for dump and checkdisk settings
if you now reboot or issue this command...
you can see that the contents of the disk are available at /mnt/usb.
I created a capture folder to keep all captures.
4. Remote control your setup (start/stop)Our goal is to use a simple web interface to start and stop the recording so you do not need to use a SSH for this.
To generate the web interface we will use the Flask framework because it's simple and also has a web server built-in.
Install it (and all dependencies) with:
It can take a while, afterward we need to create 2 files: the main python program and the html template.
NOTE: You will have to adapt this program because every HVR-1900 device has its own serial number. Only one line to adjust:
/sys/class/pvrusb2/sn-4034395926 <== change this number
For the html template we need to create a subfolder
Start the program to give it a try:
Now go to a web browser and try it out: http://ip-address-of-pi:5000/pvr2web
You should see the following:
Now press the green button...
Press stop... This is what you should see in the console output
A file with a timestamp should now exist in the target path
now we only have to autostart this program at boot time. We are going to use CRON for this because it is already installed. It just requires adding one line to a file.
and add this line at the bottom: @reboot /home/pi/pvr2web.py &
exit and save using CTRL+X and reboot...
5. Install minidlna (ReadyMedia) to stream to DLNA clientsinstall minidlna and change the library path
Now restart the service
And try to connect using VLC
Optional: use NFS to connect from *NIX clients.NFS gives you the highest transfer between the pi and others.
Installation is easy:
configuration is done by adding 2 lines to a config file:
just add the 2 last lines and press CTRL+X to exit and save
Now reload NFS by issuing:
From another machine you can now connect using...