paritybit.ca

Raw content of https://www.paritybit.ca.
git clone https://git.sr.ht/~jbauer/paritybit.ca
Log | Files | Refs | README | LICENSE

commit 5efa1921e5d6b1a2a5e0b54200cc89c70ae8f937
parent 372e56c3384338d0ff68188163e3810d16ffbbef
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Thu, 25 Aug 2022 22:41:49 -0400

*

Diffstat:
Acontent/garden/arboretum/documentation/openbsd-bits.gmi | 63+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mcontent/garden/greenhouse/index.gmi | 2++
2 files changed, 65 insertions(+), 0 deletions(-)

diff --git a/content/garden/arboretum/documentation/openbsd-bits.gmi b/content/garden/arboretum/documentation/openbsd-bits.gmi @@ -0,0 +1,63 @@ +# OpenBSD Bits + +Random things that I want to make note of. Usually small tutorial snippets + +## Multimedia + +This is a pain point with daily OpenBSD use. Audio device management is not as easy as it is with most other OSes, even if the audio system is way simpler. It can take a few commands to get things in order, and it's friendliest on laptops where you are less likely to have several peripherals plugged in. + +### Multiple audio devices + +Scan `dmesg` for `audioN` strings to figure out which audio device is mapped to which number. Then, to use, for example, audio1 when present but fall back to audio0 when not, use: + +``` +# rcctl set sndiod flags -f rsnd/0 -F rsnd/1 +# rcctl restart sndiod +``` + +Audio1 can be a USB DAC or other non-default audio interface. + +(Being able to tell sndiod which audio device to use without needing to change flags with rcctl and root privileges would be very nice. As would a small utility to list out audio interfaces by name. First thing might be hard depending on how sndiod works, but second could be a simple shell script.) + +### Use hotplugd to reload sndiod audio devices + +When you unplug an additional audio device, sndiod won't know about it unless you tell it to reload its configuration. + +``` +# cat > /etc/hotplug/attach +case $2 in +uaudio*) + pkill -HUP sndiod + ;; +esac +^D +# chmod +x /etc/hotplug/attach +# rcctl enable hotplugd +# rcctl start hotplugd +``` + +### Volume Management + +`sndioctl` is the program used to change audio device volume. It can be run as a non-privileged user: + +``` +$ sndioctl input.mute=1 +``` + +will mute the microphone, for example. + +``` +$ sndioctl output.level=+0.1 +``` + +will increase output volume by 10%, for example. + +### Environment Variables + +Passing the AUDIOPLAYDEVICE and AUDIORECDEVICE environment variables to a program will tell it to use the defined devices for playing or recording audio. This is useful if you have sndio set to play audio through one device, but your microphone is a different device. + +``` +$ AUDIOPLAYDEVICE=snd/1 AUDIORECDEVICE=snd/2 mumble +``` + +will tell this invocation of mumble to play audio through the audio1 device but record through audio2. diff --git a/content/garden/greenhouse/index.gmi b/content/garden/greenhouse/index.gmi @@ -81,6 +81,7 @@ Items are added to the top of the list as I come across them. => https://github.com/cc65/cc65 => https://www.shellhacks.com/systemd-service-file-example/ => https://www.freedesktop.org/software/systemd/man/systemd.service.html +=> https://exple.tive.org/blarg/2022/08/25/zero-again/ ### Digital Garden @@ -103,3 +104,4 @@ Items are added to the top of the list as I come across them. => https://ottawavelooutaouais.com/2022/07/30/biking-to-the-ottawa-international-airport-from-downtown/ => https://www.mtajchert.com/libraries-and-open-spaces/ => https://practicaltypography.com/ligatures-in-programming-fonts-hell-no.html +=> https://actsofvolition.com/2004/04/theriseof/