25 Mar 2023, 09:35

Decent Sampler on Linux

I recently stumbled upon the Decent Sampler Plugin and excellent free sample library available from Pianobook. Keen to try out some of the samples, I downloaded the plugin for Linux. There are 3 options for using Decent Sampler (which all come in the download package) - standalone player or VST2 and VST3 plugins. I didn’t have a DAW installed and didn’t really want to use one just to try a few samples out, but quickly discovered that the Decent Sampler standalone player is quite limited and seems to be a bit buggy too. For example, clicking Options -> Audio/Midi Settings didn’t work - no settings dialog appeared!?* As such, I was unable to configure my MIDI keyboard as an input device. I then proceeded to try the VST plugin option.

I spent quite a bit of time without success messing with different audio programs for Linux (Qtractor, Element) in an attempt to use Decent Sampler as a VST plugin but found they crashed when loading the VST. I eventually found Carla - an audio plugin host - which did the job. Using Carla, I was able to quickly load Decent Sampler as a VST, then hookup my MIDI keyboard as an input device to it, and off I went. To get acceptable latency I had to reduce the buffer size from the default 1024 to 64 (any lower resulted in audio glitches). I couldn’t see how to do this from within Cara itself. Instead it can be done by setting the environment variable PIPEWIRE_LATENCY when starting Carla e.g.

PIPEWIRE_LATENCY=64/48000 carla [<carla project file>]

* I’m using Fedora 38, your experience may vary.

04 Jul 2022, 00:18

NetworkManager and DHCPv6

tl;dr NetworkManager method=dhcp is deprecated and should not be used.

I recently had an issue with a host on my network not getting a IPv6 default route when using DHCP. The host is running Fedora 36 which uses NetworkManager to manage network connections. I wanted the host to have a static IP, but configured via a DHCP static lease rather than manually. I ended up configuring the network connection with option method=dhcp after finding a post online with example config. But the result was no IPv6 network connectivity for this host due to missing default route.

After quite a bit of messing about trying to work out why, I stumbled on this post which explains the problem. At some point method=dhcp was deprecated, and in fact is no longer mentioned in the reference doco.

The correct way to achieve what I wanted to do is to set method=auto on the client. Then on the router, ensure that IPv6 config on the interface connected to the host (LAN) is set so the M flag is sent in router advertisements. This tells the client that a DHCP server is managing IP addresses and to initiate a DHCP solicitation. The end results is the client will have two IPv6 addresses - one via SLAAC, and another via DHCP.

03 May 2022, 00:00

Surface Laptop 3 and Linux

I recently acquired a Microsoft Surface Laptop 3 and installed Fedora 36 on it. Everything works by default except touchscreen. For touchscreen support you need the surface-laptop kernel.

Tips

Keyboard + Mouse

I found that Fedora Beta was missing drivers for keyboard and touchpad on first boot so I had to use keyboard and mouse attached via USB port. After I ran an update to get latest available kernel and did a reboot, they worked fine.

I expect Fedora final won’t have this issue.

HiDPI Scaling

By default Gnome only permits scaling at 100% or 200%. With the 2256 x 1504 resolution screen, I wanted something closer to 150%. Fortunately, this can be achieved with an (experimental!) setting:

$ gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer']"

Once that’s set, you should see the option to scale to 150% appearing in the Gnome display settings (you may need to logout and login first).

Firefox

Be sure to install firefox-wayland for much smoother UI performance.

VA-API

Hardware accelerated encoding/decoding of audio/video codecs via iHD driver. Install RPM Fusion non-free repo and then install the intel-media-driver package:

$ sudo dnf install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
$ sudo dnf install intel-media-driver libva-utils

$ vainfo
libva info: VA-API version 1.14.0
libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.14 (libva 2.14.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 22.3.1 ()
vainfo: Supported profile and entrypoints
      VAProfileNone                   :	VAEntrypointVideoProc
      VAProfileNone                   :	VAEntrypointStats
...

20 Jan 2022, 09:23

TrueNAS and NFS

I recently installed TrueNAS and attempted to setup NFS. Here are some notes that may be of use to others or my future self 😄

My use case is to mount the NFS share on demand, backup my home directory, then immediately unmount.

Truenas

Under Services -> NFS:

  1. Enable NFSv4. Because, why not? NFSv4 is better.
  2. Enable ‘NFSv3 ownership model for NFSv4’. This permits UID/GID to be preserved without needing ID mapper running on client side.

Under Sharing -> Unix Shares:

  1. Create a dataset for the NFS share. Be sure to set a quota to something sensible.
  2. Create the NFS share with defaults

Other:

  • Create a TrueNAS user with the same UID as the user that will be using the NFS share
  • Drop into command shell on Truenas and navigate to the new NFS share root. Create a directory under the root and chown it to the user that will use it e.g.
cd /mnt/Seagate4TB/nfsshare
mkdir home-backup
chown ian home-backup

NFS client

  • add an entry to /etc/fstab e.g.
truenas.lan:/mnt/Seagate4TB/nfsshare /mnt	nfs4	noauto,defaults

where /mnt/Seagate4TB/nfsshare/ is the NFS root.

  • add entry to sudoers to enable non-root user to mount the NFS mountpoint:
ian	ALL=(ALL)	NOPASSWD: /usr/bin/mount /mnt, /usr/bin/umount /mnt

Now user ‘ian’ should be able to write into /mnt/home-backup.

11 Feb 2021, 10:23

Split Tracks and Pulseaudio

I’m learning to play the drums. Something I’m trialling is split tracks, where the mix of the recording is separated into left and right, with left being only drums and vocals, and right being everything except drums and vocals. This is great except when played through stereo headphones, the mix sounds odd and is uncomfortable to listen to. The solution is to convert the stereo output to mono, however most home setups won’t have the kind of gear required for this.

My solution is to use Linux Pulseaudio to create a ‘sound sink’ which is essentially a virtual output device that sits between my music player software and the sound card.

I added 3 lines to the end of /etc/pulse/default.pa - each one creates a new sound sink, in addition to the normal stereo output.

load-module module-remap-sink sink_name=Mono sink_properties="device.description='Stereo to Mono'" master=alsa_output.pci-0000_00_1b.0.analog-stereo channels=2 channel_map=mono,mono

load-module module-remap-sink sink_name=Left-to-Mono sink_properties="device.description='Left to Mono'" master=alsa_output.pci-0000_00_1b.0.analog-stereo channels=1 master_channel_map=mono channel_map=left

load-module module-remap-sink sink_name=Right-to-Mono sink_properties="device.description='Right to Mono'" master=alsa_output.pci-0000_00_1b.0.analog-stereo channels=1 master_channel_map=mono channel_map=right

The first line creates the ‘Stereo to Mono’ sink, useful for listening to both left and right channels of the split track together. Then there is ‘Left to Mono’, useful for listening to drums only - instead of them coming out of only the left headphone, they come out of both headphones. Then ‘Right to Mono’.

When playing back a split track song I can switch between the 3 different sinks in the audio config settings as required.

17 Jun 2020, 00:00

Sam Harris & Trump

NOTE: work in progress

UPDATE Sept 5th 2022: Recent comments by Sam Harris on Trump would suggest that it is Sam Harris who is unhinged!

“At that point Hunter Biden literally could have had the corpses of children in his basement, I would not have cared,”

Sam Harris is a brilliant thinker, and has an amazing ability to articulate his thoughts to a broad audience. I should say I’m no expert on Harris’ past work.

Most recently I listened to his ‘Making Sense’ podcast entitled ‘Can We Pull Back From The Brink?’. He methodically works through the issues surrounding the recent George Floyd protests, police brutality, and the enduring problem of race relations in America. Throughout this podcast Harris makes commentary on Trump which I found really jarring in the way it contrasts with Harris’ usual calm, rational approach. He calls Trump names such as ‘unhinged’ and ‘crackpot’ which I find puzzling and a little unsettling. I’m no fanboy for Trump. Trump is an egotistical bully. At the same time, I’ve seen nothing in his words or behaviour that would make me think he is literally crazy.

17 Mar 2020, 21:38

4K Disappointment

tl;dr - before going down the 4K path, make sure your graphics hardware is capable of driving your display at full spec.

My old faithful Dell U2412 monitor recently started playing up. It is my main ‘work from home’ monitor and I needed to get work done, so I rather hastily found a replacement. I thought to myself “hey, 4K has been around for ages and prices are reasonable so may aswell grab one of those”. I settled on a Samsung LU28E590DS capable of upto 3840x2160@60hz. I plugged it in a cranked the resolution right up - sweet! Looks gorgeous. I ended up enabling 200% scaling to make the text readable (unfortunately fractional scaling is not officially supported yet in Gnome).

I quickly realised that the interface was noticeably laggy - like everything had been dipped in molasses. My first inclination was that my graphics adaptor was struggling at 4K resolution, but after some research into the wonderful world of computer display graphics I came to the conclusion that the issue was in fact the refresh rate - my hardware (Intel HD530 integrated GPU, coupled with Gigabyte H110M-H motherboard) was only capable of outputting at 4K@24hz instead of the 60hz I’d been used to. That was annoying but I thought to myself, “oh well I’ll just drop the resolution down to something that can output at 60hz”. Unfortunately I then struck the problem of non-native resolution and the blurriness that results from scaling; for me this was an unacceptable tradeoff - in my opinion worse than the lower refresh rate! Again I naively thought “4K has been around for ages, surely I can grab a low end graphics card that will output 4K@60hz!?” Alas, no. Well technically, yes, but only Nvidia it seems. I’m running Linux and, unless you’re a gamer (which I’m not), Nvidia’s drivers are not worth the hassle IMHO.

As I’ve now discovered, until relatively recently only DisplayPort has been capable of outputing 4K@60hz. However that adaptor is far less common (on PC hardware at least) than HDMI. The story with HDMI is that it was limited to 4K@30hz until v2.0 of the HDMI spec, which is only included on higher end graphics cards and motherboards!

My options are this stage:

  • put up with 24hz (what I’m currently doing)
  • buy a standalone graphics adaptor which comes with Displayport and/or HDMI 2.0 - PROS: flexibility CONS: expensive, noisy
  • replace my CPU + motherboard with something more recent, that includes onboard Displayport and/or HDMI 2.0 - PROS: updated CPU + chipset, quiet CONS: inferior graphics capability compared with standalone

UPDATE: 2020-04-19, I ended up getting a HP EliteDesk G2 800 motherboard cheap off Ebay which comes with dual displayport capable of 4k@60hz

07 Oct 2019, 09:23

Connecting to Internode with OpenWRT

Australian ISP Internode does not officially support OpenWRT.

I recently connected HFC (hybrid fibre coaxial) with NBN & Internode. To get it working I needed to tag VLAN 2 on the WAN interface. Using the Luci web interface, navigate to Networks -> Switch and set the dropdown to Tagged next to VLAN 2 under WAN. Then setup the WAN interface like a standard PPPoE with <username>@internode.on.net for the username and my account password.

Update 12th Feb 2021: if you’re not using Luci web interface or the option is missing, you can achieve the same by editing /etc/config/network and setting the ‘wan’ interface ifname option to be e.g. eth1.2 where eth1 corresponds with the WAN physical interface and .2 signifies the VLAN. Then reload the config with service network reload.

22 Dec 2018, 09:35

The Last Kingdom, a brief review

I just finished watching episodes 1-6 of the BBC historical drama The Last Kingdom. I enjoyed the first few episodes but found myself increasingly unsettled as the eposides went by. Something is very ‘off’ about this story. The TV series is based on the books, The Saxon Stories by Bernard Cornwell, so any criticism of the story and script are going to be primarily with the author.

The Good

Great Britain has a fascinating history, and there was much I learnt from watching TLK. I’m much creative license has been taken, but it certainly has piqued my interest and encouraged me to find out more about the real history.

The production values are great, with the locations and sets being very believable. The cinematography is cleverly done, and the music matches the tempo and pathos of the scenes very well. The acting is mostly very good, with some standout performances. I particularly liked the character of King Alfred (played by David Dawson) and Viking Lord Ubba (played by Rune Temte).

With the copious violence, and occasional sex scene aside, I found it pretty thought provoking viewing.

The Bad

The violence is gratuitous and I found disturbing at times. The portrayal of women is not positive. The few female lead characters seem to be nags, pious busy bodies and mostly there for the amusement of the men.

Ulricht is a really unlikeable character. He’s a foolish, arrogant, petulant, man-baby. I hope this is just the story arc that ends up with him growing up and setting things right in the end, but I so wanted to punch him in the face by episode 6.

Ubba by contrast was the bad guy I grew to love, and was sorry to see him meet his inevitable demise.

The Ugly

Humanity always filters history through the lens of the present, and it is no different with TLK.

I couldn’t figure out what moral code the main character, Ulricht, lived by. On one hand he is angrily calling for ‘justice to be done!’ meanwhile he is picking and choosing what is right and wrong based on nothing more than what feels right for him at the time.

The constant mocking of Christianity I found really tiresome. There is zero recognition that western civilisation itself is deeply rooted in its Judeo-Christian heritage. It’s almost as if Christianity was some annoying baggage hindering progress, instead of the driving force behind Britain and Europe’s advance towards what became the pinnacle of human achievement and knowledge.

The pagan beliefs are portrayed through a very modern prism. There is no judgement in their belief system - you just do your best to observe all the right superstitions and pay your respects to the right gods and you’ll be fine - Valhallah awaits. Of course the reality of pagan belief is world of darkness and bondage: human sacrifice anyone?

15 Nov 2018, 08:00

Morning Devotion

“The Lord’s portion is his people.” – Deuteronomy 32:9

How are they his? By his own sovereign choice. He chose them, and set his love upon them. This he did altogether apart from any goodness in them at the time, or any goodness which he foresaw in them. He had mercy on whom he would have mercy, and ordained a chosen company unto eternal life; thus, therefore, are they his by his unconstrained election.

They are not only his by choice, but by purchase. He has bought and paid for them to the utmost farthing, hence about his title there can be no dispute. Not with corruptible things, as with silver and gold, but with the precious blood of the Lord Jesus Christ, the Lord’s portion has been fully redeemed. There is no mortgage on his estate; no suits can be raised by opposing claimants, the price was paid in open court, and the Church is the Lord’s freehold forever. See the blood-mark upon all the chosen, invisible to human eye, but known to Christ, for “the Lord knoweth them that are his”; he forgetteth none of those whom he has redeemed from among men; he counts the sheep for whom he laid down his life, and remembers well the Church for which he gave himself.

They are also his by conquest. What a battle he had in us before we would be won! How long he laid siege to our hearts! How often he sent us terms of capitulation! but we barred our gates, and fenced our walls against him. Do we not remember that glorious hour when he carried our hearts by storm? When he placed his cross against the wall, and scaled our ramparts, planting on our strongholds the blood-red flag of his omnipotent mercy? Yes, we are, indeed, the conquered captives of his omnipotent love. Thus chosen, purchased, and subdued, the rights of our divine possessor are inalienable: we rejoice that we never can be our own; and we desire, day by day, to do his will, and to show forth his glory.

~ Charles Spurgeon

This brought me to tears. Amazing Grace how sweet the sound! What a mystery that God both chooses those who would be His, and yet at the same time makes salvation available to anyone and everyone. It makes no sense in the natural, but God’s ways aren’t our ways.