macOS Ventura VM with USB audio passthrough

…on Arch Linux.

  1. OneClick macOS Simple KVM
    (based on foxlet/macOS-Simple-KVM)

    1. git clone https://github.com/notAperson535/OneClick-macOS-Simple-KVM
    2. Follow their setup docs, recommended: Manual Method. Jist:
      1. ./fetch-macOS-v2.py # pick Ventura
      2. qemu-img convert BaseSystem.dmg -O raw BaseSystem.img
      3. qemu-img create -f qcow2 macOS.qcow2 64G
      4. copy/change basic.sh: look for $VMDIR and $OVMF and make sure they point to the correct paths/files.
      5. run your basic.sh
      6. run Disk Utility, Erase that ~64GB disk, name it something useful
      7. run Installer
      8. several reboots during install, pick the Install volume when that happens, until our volume pops up
  2. give us USB permissions: chown -R myuser /dev/bus/usb
    TODO: find a better permanent solution
  3. Connect QEMU Monitor
    1. telnet 127.0.0.1 5801 (see port in basic.sh)
    2. info usb, then info usbhost
  4. Add USB device. See QEMU docs and Arch QEMU wiki: Pass through host USB device
    1. get vendorid+productid from lsusb or info usbhost, e.g.:
      Bus 2, Addr 64, Port 3.4.2, Speed 480 Mb/s
      Class ef: USB device 1397:0509, UMC404HD 192k
    2. Add a line to basic.sh, before MOREARGS:
      -device usb-ehci,id=ehci -device usb-host,bus=ehci.0,vendorid=0x1397,productid=0x0509,id=behringer \
  5. Check
    1. in QEMU Monitor
    2. in macOS System Report › Hardware/USB + Hardware/Audio
    3. macOS System Settings › Sound › Output & Input

TODO

  • what happens if the device doesn’t exist
  • the Behringer sounds terribly datamoshed

invoke oomkiller via SysRq on Arch Linux on a Thinkpad T450s

Note: I have Ctrl/Fn swapped via bios.
Prerequisite: SysRq has to be enabled:

sysctl kernel.sysrq=1

Then

  1. Hold Fn+Ctrl+Alt+S
  2. Release all but Alt, keep holding Alt
  3. now we’re effectively in Alt+SysRq+…, and can hit the final key for magic function:
    b = reboot
    e = terminate all processes
    i = kill all processes
    h = dump help to kernel log, and finally:
    f = invoke OOM killer

Troubleshoot/test:

  • run a dmesg -w, watch what happens, especially with h
  • xev should report Sys_Req after Fn+Ctrl+Alt+S, among all the modifiers

Make persistent

# /etc/systemd/sysrq.service
[Unit]
Description=Enable SysRq key

[Service]
Type=oneshot
ExecStart=sysctl kernel.sysrq=1

[Install]
WantedBy=multi-user.target

systemctl daemon-reload
systemctl enable sysrq.service

“Horrible edge cases to consider when dealing with music”

From jvoisin (CC BY-SA)

Some artists will benchmark your utf8 support [and beyond]:
[…] Magma and their Kobaïan made-up language featuring some custom diacritics that don’t exist in utf8.

Of course, see also the famous Falsehoods Programmers Believe About Names.
This also reminds me that on BC BY-NC-SA I’ve noticed how bad Bandcamps slugify is: 無​限​大 becomes –14 (the 14 is just an anti-hash-collision counter, I believe)

3D modelling at 19th Unnamed Cave: photogrammetry archaeology (Paper)

Three images: Left: photography of a stone in a cave, presumably. There are very faint marks. Right: a drawing of a humanoid figure. Center: both overlaid, now you can see how the faint markings maybe, somehow could be identified, but probably not.

Impressive use of photogrammetry:

Most surprisingly, the cave’s ceiling features very large anthropomorphic glyphs that are not apparent in situ due to the tight confines of the cave. We argue that photogrammetry offers untapped potential for not simply the documentation but also the discovery of a variety of archaeological phenomena.

Jan F. Simek, Stephen Alvarez and Alan Cressler, Cambridge University Press. Image (from there): Anthropomorph in regalia (1.81m tall) from 19th Unnamed Cave, Alabama (photograph by S. Alvarez; illustration by J. Simek).

Wendy Carlos answers questions about Vocoders

a repeating light brown pattern, in the center a logo that says Wendy Carlos, the Wendy in scripty handwriting, the carlos in Gothic uppercase. It looks very 90s!

From Wendy Carlos’ delightfully 90s website

Then I got a chance to try one at the NY World’s Fair of 1964-65, at the Bell Labs pavilion. I was hooked! When I figured how to make it not just speak, but sing, it earned an assured place in a forthcoming new album. You know, it seemed an exciting idea to share! The first reactions were unanimous: everyone hated it!

Reminds me of my first time hearing Daft Punk’s Discovery, it took a while!

euxo pipefail

this will hereby hopefully join, in my brain, netstat’s tulpn and ps’s aux:

#!/bin/bash
set -euxo pipefail

-e — exit immediately when one command fails
-u — fail on undefined vars
-o pipefail — fail if a pipe fails
-x — be very very verbose