Media Players Documentation Release 2.5
Total Page:16
File Type:pdf, Size:1020Kb
Media Players Documentation Release 2.5 Isuma January 28, 2015 Contents 1 Hardware platforms 3 1.1 Shuttle XPC small desktops.......................................3 1.2 Logic Supply desktops (v2.5 series)...................................3 1.3 Advantech rugged servers (1.0 series)..................................3 2 Installation 5 2.1 Install Debian...............................................5 2.2 Install local server software.......................................6 2.3 Configure Local Server..........................................6 2.4 SSH upload account configuration....................................6 2.5 SSH tunnels configuration........................................7 2.6 First file sync...............................................7 3 Maintenance 9 3.1 External synchronisation drives.....................................9 3.2 Syncing a media player......................................... 10 4 User guides 11 4.1 How to setup a playlist.......................................... 11 5 Troubleshooting 19 5.1 Test procedure.............................................. 19 5.2 Troubleshooting stuck queues...................................... 19 5.3 Queue is full but media player sees it empty............................... 20 5.4 Logging in to media players on the console............................... 20 5.5 Password resets.............................................. 20 5.6 Inspecting status from the commandline................................. 20 5.7 Remote login to media players...................................... 21 6 Development 23 6.1 XMLRPC API.............................................. 23 6.2 Debian packages............................................. 23 7 Design documentation 25 7.1 Terminology............................................... 25 7.2 Design strategy for 3.0.......................................... 26 7.3 Similar projects.............................................. 27 8 Original specifications 29 i 8.1 Overview................................................. 29 8.2 Hardware possibilities.......................................... 32 8.3 Auto-mounting Hotplugged Devices................................... 33 8.4 Synchronization scripts......................................... 33 8.5 Test scripts................................................ 34 8.6 How to set up kiosk mode........................................ 35 9 Changing this document 37 ii Media Players Documentation, Release 2.5 The Isuma Media Players project is a fully free and open source software project to create a two-way, distributed content distribution network for communities with poor connexions to the internet. Contents 1 Media Players Documentation, Release 2.5 2 Contents CHAPTER 1 Hardware platforms The media players project doesn’t require any special hardware to run, although we do expect the usual: • network interface • display and sound card (to play videos) • storage However, since we are storing videos, we are aiming for large storage specifications. As of July 2014, the Isuma.tv store is around 1 TB (terabyte, or 0.9 TiB, tebibyte), so we currently deploy 2TB hard drives. The rest of this section is dedicated to current and previous platform specifications. 1.1 Shuttle XPC small desktops We have one Shuttle machine in the office, in the XPC series, there isn’t much to say about it other than its peculiar form factor is not very convenient. 1.2 Logic Supply desktops (v2.5 series) Around 10 machines were built with some Logic Supply Mini-ITX cases, although the original product link is now dead. We also had trouble with shipping and delivery to Canada. Finally, some hard drive sockets were damaged during travel, which makes us doubt of the viability of this platform on the long term. 1.3 Advantech rugged servers (1.0 series) We have deployed some Advantech UNO-3282 servers on the field. Two of those servers were provisionned for Isuma and are still running after years of service. They have sealed cases that are very solid. Advantages: • very sturdy • sealed, so it won’t collect dust • power button protected from accidental tripping 3 Media Players Documentation, Release 2.5 Disadvantages: • heavy • power supply is external 4 Chapter 1. Hardware platforms CHAPTER 2 Installation This describes how to set up a local server from scratch. You may be able to install the components on an existing system, but this is currently not supported. 2.1 Install Debian To begin, boot into the Debian “stable” installer, either from USB, CD-ROM or from netboot. Note that the boot priority in the BIOS of the UNO-3272 has options for both USB CDROM and normal IDE CDROM so make sure you pick whichever one you are using. Set up keyboard, timezone, and other settings as normal. When you get to the partitioning screen, set up partitions as follows: First hard drive (sda): 1. Primary, filesystem ext3, size 200MB, bootable flag, mount as /boot 2. Primary, LVM, size 1TB Second hard drive (sdb): 1. Primary, LVM, size 1TB Now choose “Write changes to disk and configure LVM.” Set up LVM as follows: Physical volumes: sda2 and sdb1 Volume group: call it main, and set it to use all of both physical volumes. Logical volumes: 1. Name: root, size 80GB 2. Name: swap, size 3GB 3. Name: media, size 2TB Save the changes, and go back to the partitioning screen. Set up the logical volumes to be mounted as follows: 1. root: filesystem ext3, mount point / 2. swap: use as swap 3. media: filesystem ext3, mount point /var/isuma Now choose to continue and the volumes will be formatted. Formatting the media partition takes about a half hour and looks like it’s stuck at 33% completed for that entire time, so go have a coffee. Set up root and normal users. 5 Media Players Documentation, Release 2.5 Next, choose a local Debian mirror. On the software selection screen, select the “standard system” and “Web server” software collections. 2.2 Install local server software In /etc/apt/sources.list add: deb http://debian.koumbit.net/debian stable main Then run: apt-get update apt-get install koumbit-archive-keyring You will see this warning: W: GPG error: http://debian.koumbit.net stable Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 0x6DC388D8B7C0A70A It is normal, you need to bootstrap the trust to the repository. Optionnally, you can also download the key directly from the web of trust and verify the signatures to check its authenticity. Then run: apt-get install isuma-local-servers isuma-autossh Optionally, if you want to setup kiosk mode, run: apt-get install isuma-kiosk 2.3 Configure Local Server Create the config.inc file in the /usr/share/isuma-local-servers/sync/. Configure the unique username/password to access cs.isuma.tv in the form: username:[email protected]. Make sure file is properly formed with opening <?php and no closing ?> The username refers to a user that is created within the drupal at cs.isuma.tv. 2.4 SSH upload account configuration There is configuration required to setup the rsync between the media player and the main isuma.tv website. Copy the [email protected] private key to /var/isuma/.id_rsa on the media player. The key can be found on the isuma.tv server at /home/cachingserver/.ssh/id_rsa. Be sure that it is readeable by and only by www-data (chown www-data /var/isuma/.id_rsa; chmod 600 /var/isuma/.id_rsa). Then run: su www-data -c "ssh [email protected] -i /var/isuma/.id_rsa" NB: I didn’t do that for v25n11 as there is no caching server and couldn’t find the specified files. Important: Save the fingerprint by entering “yes” 6 Chapter 2. Installation Media Players Documentation, Release 2.5 2.5 SSH tunnels configuration The SSH tunnels allow Isuma administrators to login remotely on the media players, from the central server. They work with a package called “autossh” that tries its best to keep an SSH connection to the central server open. That connection is then used to create a tunnel back to the SSH server running on the media player. The isuma-autossh package should automatically prompt you for the relevant information. You need to provide it with the public key of the isuma central server, which is: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCdr5vyuwKikrW0Vg+mlsRTkG1Jp3wUt4JmLopspln5sWsbAsMDtnUe7T0NW6s6W2tYvlav9m987HrNvAXCWbBeOwIuabbtcUK39QRdEUrAcd1yConPxmnsk7+sN2p7NC76lYIXYQM7hT2pWa3rXpdZQT2leSrrWFW0j/PEvwsEvb+4vmm2POX2L9GJDeb/czdT6/3NNRVlDiSh4rORbtXgDq7cj2qKZ0xnzDOcOpSjXig2eLl6759qLV3p76iNmMoHjWwo3bRypkwtiZ3zmwBPtGlctezgHqukaUKwcbDRNoZgv99QYLzAYqjx7ZqwWBCaNixaXgZhNkKhmlVSRXZB root@ip-10-122-35-248 (!) If that file is changed, you can use the dpkg-reconfigure isuma-autossh command to copy and paste the proper key back into place. Then the isuma-autossh package generates a public key in /root/.ssh/id_rsa.pub, which needs to be manually copied at the end of the /home/tunnel/.ssh/authorized_keys file on the central server. 2.6 First file sync (From #7744.) Here’s the resyncing process for the file queue. Note that we actually inject the files in the download queue to make sure we haven’t missed anything, but the files could also be injected straight into the File queue. On the central server, list the queues for the media player: mysql> SELECT csc.uid, csc.caching_server_queue, ns.title, ns.sqid FROM caching_server_config csc JOIN nodequeue_subqueue ns ON ns.qid = csc.caching_server_queue WHERE csc.uid=91; +-----+----------------------+-----------+------+ | uid | caching_server_queue | title | sqid | +-----+----------------------+-----------+------+ | 91 | 86 | download | 307 | | 91 | 86 |