Dark's Code Dump

Possibly useful

P2014 Intake Manifold Runner Position Sensor Switch/Circuit

Got this fault code shortly after a Blue Print ADV air filter was fitted in a VW Golf GTI MK7. Fault recurred under high load after clearing. Slight loss of performance and slightly rough idle. Sensor confirmed to be producing believable voltage outputs.

Resolved by replacing with a Mann air filter. The Blue Print appeared to have more pleats, which may have restricted air flow enough for the ECU to complain.

Raspberry Pi 4 sucks for USB audio

I bought a Raspberry Pi 4 B under the impression that it was great for USB audio. It is sold as having hardware issues from previous versions fixed, relating to overlap between ethernet and USB.

However this couldn't be further from the truth! It has a little-known limit on the number of isochronous USB devices. It can run one, maybe two, 24bit 48khz streams before it falls over. Devices with many ports, such as audio interfaces or USB sound cards (e.g. Creative X-Fi HD USB), randomly fail to initialise properly (missing ports, USB errors in dmesg, etc.). I also was not able to get flawless audio out of a Musical Fidelity V90-DAC no matter what I did. You'd think UAC 1 audio would be impossible to mess up after 23 years...

Stick to x86 and/or proper USB implementations for any serious Linux audio work! I pulled out an old J1800 board (fanless x86), added a Renesas USB 3.0 PCI-e card, and all the intermittent audio issues I had been grappling with for months on ARM SBCs vanished instantly.

Signal backups using Linux headless server

I went deeper down the rabbit hole of Signal's lack of message backups on iOS, and discovered the Signal Desktop app works differently to WhatsApp - it does not require any connection to the phone, instead it syncs directly from the server. Using the desktop app you can achieve proper backups, however it requires near 24/7 uptime if you are a heavy user, as only the 1000 newest messages are cached on the server. Any messages beyond the buffer of 1000 while the desktop client is offline will never sync to it.

If you have a 24/7 non-headless machine with any OS, you have things way easier and you don't need this guide. (Just install Signal as normal and leave it running all the time.) I only have headless Linux servers running 24/7, so if that is you then read on.


My issues with Signal

Signal has taken the world by storm since WhatsApp introduced their latest round of anti-privacy changes. At face value, Signal seems great, but it has flaws that have me seriously considering whether the privacy aspect is worth it:


Disable KVM virtio memory balloon

How to make your VPS provider salty 101:

rmmod virtio_balloon 

Make it permanent with:

echo "blacklist virtio_balloon" > /etc/modprobe.d/balloon.conf

Nvidia driver 460.89 high csrss.exe CPU usage

460.89 drivers cause high CPU usage in csrss.exe (20x higher than before) when animated cursors are in use, as well as system-wide lag - mouse cursor on 120hz display feels like 60hz or less, Firefox scrolling very stuttery, etc. This may or may not only be the case when colour management is in use.

The previous 457.51 drivers (lacking the improved colour management options) do not exhibit the issue. Or if you are less attached to your cursor than I am, you could disable animated cursors.

Finding LVM LV affected by corruption

I have an SSD that is regularly developing bad sectors. (I'd happily buy a Samsung Enterprise sieve.) In this case the bad sectors are occurring on read, rather than on write, and the data contained on them is lost. The system is rock solid with server-grade components, ECC memory and BTRFS, so I have no doubt the issue is with the SSD, and that data is being lost. The easiest method to detect these is a long SMART self test, but that leaves me with an LBA number that is tricky to correlate to actual data, due to LVM abstracting the partition layout.

This article will focus on identifying which LV of an LVM setup is affected by the corruption.


AppArmor profile for TF2 SRCDS servers

With the recent high profile Team Fortress 2 source code leak, I considered it necessary to lock down my TF2 servers as much as possible. Below is the full AppArmor profile I used to protect srcds_linux.

Complications such as SourceMod and auto-update are supported. /YOUR-SRCDS-LOCATION/ should be updated as necessary. To support replays, add whatever folder(s) used for replays using the /** rwk suffix.

Read on for the full profile...

Unreported background battery drain on iPhone SE 2nd Gen

Ran into some strange background battery drain on an iPhone SE 2nd Generation - it was noticeably above room temperature at all times (but not warm/hot to the touch), indicating a lack of deep sleep, and the battery chart showed a continuous decline, even during periods of no notifications or screen use. Additionally I received notifications suspiciously quickly - within a second of the event occurring, rather than the usual 2-5.

I say 'unreported' in the title as there was absolutely no indication that background drain was taking place on the Battery screen, other than in the percentage chart. 'Screen Off' did not exceed 30 minutes per day, and most of that was believably attributed to WhatsApp. This led me to search for system services as a cause, specifically anything I may have done that is out of the ordinary that may cause a system service to go haywire.

Read on for the potential solutions...

Fix iTunes Wi-Fi sync to a libvirt Windows VM

Couldn't get iPhone to appear in iTunes via wi-fi sync on a Windows 10 virtual machine. Tried all the usual steps such as verifying they can ping each other, re-ticking 'sync with this iPhone over wi-fi', rebooting, terminating AppleMobileDeviceHelper, etc.

Read on for solution...