Friday 29 June 2018

Raspberry Pi [2]

Well now that I have this thing I have to find a use for it, and that use is proving to be best made out in hooking it to the TV and playing live Youtube content. It does however turn out able to play some existing video content, provided that you use the built in omxplayer software to do this, because it uses the OpenMAX standard for the ARM platform to hardware decode a lot of different video codecs. The documentation for omxplayer is here, which has to be invoked from the command line in a terminal session - it cannot be started from a GUI file manager type of application. There is no mouse (GUI) user interface but the documentation lists the following keypresses that will be recognised:

1           decrease speed
2           increase speed
<           rewind
>           fast forward
z           show info
j           previous audio stream
k           next audio stream
i           previous chapter
o           next chapter
n           previous subtitle stream
m           next subtitle stream
s           toggle subtitles
w           show subtitles
x           hide subtitles
d           decrease subtitle delay (- 250 ms)
f           increase subtitle delay (+ 250 ms)
q           exit omxplayer
p / space   pause/resume
-           decrease volume
+ / =       increase volume
left arrow  seek -30 seconds
right arrow seek +30 seconds
down arrow  seek -600 seconds
up arrow    seek +600 seconds

So far the capability in playback of my previously downloaded content (over the network from mediapc) is quite satisfactory. Of course, audio playback (music) will be less demanding on the hardware.

Although at the moment I am not planning to use the Pi for playing content from files, since it does not have sufficient inbuilt or connected storage, the capability is interesting to evaluate. I plan at the moment to stick with playing live Youtube streamed content. One aspect of the Pi which would be superior to mediapc and the old E350 boards I have used for media playback previously (like the one that was in my bedroom) is decoding VP8 content (the codec used in WebM containers) which the older Intel/AMD x86 CPUs don't support at hardware level.

Anyway the Pi was easy to get going with a 8 GB microSD card I had previously flashed Raspbian on to. An Apple Ipad USB 10 watt power adapter is able to run it. One day it will have a case (at the moment it is just the bare board) and perhaps the proper power supply.

Tuesday 19 June 2018

Optimising Gimp's temporary and swap storage

Whilst Gimp is a great piece of software, its default behaviour is to put temporary files into the home drive. If for some reason it needs to cache to disk it can become very slow. For me, I thought that creating my swap partition on the SSD would address this. However Gimp doesn't make use of that space.

In order to address this issue I changed serverpc's system configuration to use a swap file instead of a swap partion, and placed that file on the system volume (where Debian is installed). Off memory Debian doesn't provide the option for a swap file at installation, whereas these days Ubuntu defaults to it if you don't specify a swap partition or use the automatic partitioner. In any case I used these commands to change to a swap file. This system doesn't hibernate so I don't need to muck around changing hibernation settings:
  • dd if=/dev/zero of=/swapfile bs=1024 count=X
  • chmod 600 /swapfile
  • mkswap /swapfile
  • swapon /swapfile
In all cases /swapfile is the path and filename of the new swapfile. The dd command creates this file and preallocates its full size as zeros. This ensures the file is contiguous and not fragmented. The other commands are for setting permissions and enabling the swap.

The next step is to add an entry to /etc/fstab:
/swapfile none swap sw 0 0

Reboot and the next step is to change the partition to a regular partition. You can use fdisk's option to change a partition type. Change the swap partition to type 83. Then use mkfs to format the partition as ext4. Finally, create a directory off / to mount the partition to and then add its entry into fstab.

To change the settings for Gimp you need to edit /etc/gimp/2.0/gimprc and look for the options that specify temporary space and swap space. It's possible the temp space may not need to be changed as it is possibly only used during saves, when saving an existing file requires a temporary file to be written and then copied over the old file. The swap is the most important setting.

After playing with the settings and tweaking I was able to get a much faster and quieter editing process of some large images because the SSD was used instead of the regular HDD. A particular operation Gimp had struggled to do before was editing a 23 layer aerial mosaic which needed a unified transform of a layer that had been UT'd twice already. The software responded much faster even though there was still a lot of disk activity.

Doing this type of thing with Gimp is worthwhile if it is a lot cheaper than adding more RAM or a bigger SSD to a system. It also eliminates space usage for temporary files gobbling precious disk space. I face a constant battle with the large mosaics and massive volumes of aerial photography downloads to keep enough free space on this computer without running out. Gimp seems to use a lot of this space at times and has been responsible for disk full errors on several occasions.

Mainpc uses hibernation and it is simpler to stick with the current arrangement as I don't have to use Gimp on this PC so I will look at options for next time I reinstall this computer, for example adding another SSD if there are free ports. This mainboard in mainpc is quite a high spec one and has a M2 port onboard as well as a lot of Sata ports so it should be possible as in fact let's face it, the cheapest option for a high spec computer would be extra RAM (only 8 GB) in mainpc and extra SSD for temporary space and so on.

UPDATE: I have given up on playing with the temp settings and simply let the swap space be used as normal, as Gimp does seem to be quite capable of using swap in 2.10+. The main reason for doing this is that now that Gimp is installed from a flatpak, you just don't have the same ability to customise Gimp's own settings, and letting it use the Linux swap (which it apparently is quite OK with) is by far the best solution. So for my two PCs that use Gimp, each has 100 GB of SSD  available as swap and it does get used from time to time.

Monday 18 June 2018

Raspberry Pi

As we all know the Raspberry Pi is a low cost mini computer that occupies a very small form factor. It runs on Linux and there is an enthusiastic community of supporters.

I have elected to acquire a Pi to replace my satellite decoder box and dish for FTA TBN channels. Previously I had entered into a contract with Instal-Life in Australia in respect of a satellite decoder box and dish for the TBN channels, particularly Hillsong Channel. I had believed this contract was rent to own but have since discovered it is rent only and as the contract term has completed and the channels are available on the Internet for no charge I have determined the best option is to return the equipment and replace it with the Pi. Both this company and others offer the equipment for sale and it is of regret to me that I was unaware that an 18 month contract with this company was only for rental as they did offer a 6 month contract with a discount for purchasing after that contract period. TBN Pacific do offer the equipment for sale and since I do not have the means to purchase from Instal-Life and have no wish to do so because of the misunderstanding and other factors, any future installation of this type of equipment would be for the basis of full purchase at the outset.

To make a Pi work, apart from the basic board, it needs a case, power supply and SD card. At the moment I can make do without a case and have the other items to hand as my budget is very limited at present. It will run the Raspbian operating system which is a lite edition of Debian which will prove very satisfactory and enable it to perform other tasks. It will be interesting to see how it would handle video decoding. As it may be known, the key issue with Google's VP8 and VP9 codecs as enshrined in the WebM format container is that these codecs can only be supported by recent CPUs. This is another reason why swapping serverpc and mediapc around would be a great idea for the living room computer desk as mediapc has an older CPU that doesn't have hardware support for these codecs and consequently has difficulty in playing WebM container files.

When I have the Pi the main thing I expect to be doing is setting it up to automatically open a web browser to Hillsong Channel from the TBN website and that will be its sole purpose for the time being. Recording is not directly available but SimpleScreenRecorder can handle this if needed. The main difference will be the picture quality available over the internet. There is an option obviously to buy the satellite gear at a later time and have this option available again in future and I would consider this as this option is not dependent on the internet and always gives a high quality picture.

Since writing originally yesterday Instal-Life has offered to sell me the satellite gear at a significant discount so I am continuing with the agreement for another six months until it is paid off and at that stage I own the gear and do not have to make any more payments. The Raspberry Pi is also still coming so I expect to set that up as a sort of STB hooked to the TV probably that will be able to play live videos from Youtube etc.


Monday 11 June 2018

Canon EOS M100 / Computer Upgrade

Well I have been using a Canon EOS M100 for some weeks as a replacement for my SX260 compact which while it still works, has problems with the shutter on the front of the lens jamming. And while the SX260 was sort of a high end travel zoom and I miss its 20x lens, I won't miss that its low light performance even with its (for the time) superior chip capable of pushing the ISO to 1600 without much difficulty, doesn't really compare to a camera capable of doing 16,000 ISO without many challenges. So even with only a 3x zoom and a puny little flash and no hotshoe on this model (considering I use it more than my DSLR which has a hotshoe, because it has better low light and video performance), it still really shines as the entry level model of the EOS mirrorless range. 

Last week I went to an event and took a lot of photos and also some video and while the EOS 600D did quite well and I have two (kit) lenses for it, the EOS M100 also did very well and I used it to shoot an hour of video and take quite a lot of photos as well. And you can just do so much more with it than with a compact with all the limitations they have.

On another topic I have tested a few of my Linux computers running sddm with the Plasma login screen and the ones with the NVidia cards seem to have issues and the ones with Intel graphics don't. So maybe the Nouveau driver for NVidia graphics has its limitations. 

The other issue is needing computers with 32 GB of RAM to get things done, especially graphics editing. I hummed and hawed about getting 32 GB of RAM into serverpc but I would have to throw away the 16 GB already in it because it only has two RAM slots. When I built this one it was just going to be a basic Windows box and it wasn't going to need a lot of memory. So I only got a cheaper board with two slots. After tossing around the different options the easiest is to upgrade what is currently mediapc which has 12 GB of DDR3-1333 RAM, to 32 GB its maximum limit. You can buy 4 pieces of 8 GB Kingston ValueRam for $500 as a kit and the 8 GB in it now would go into mainpc (hopefully) to make it 32 GB. Then we swap the current mediapc and serverpc around so that mediapc runs on this newer box with "only" 16 GB of RAM and Intel graphics. So that is the plan, all I need is a spare $500 now...