aboutsummaryrefslogtreecommitdiff
path: root/scripts/hostname/desktop2
diff options
context:
space:
mode:
authorCullum Smith <cullum@sacredheartsc.com>2024-10-31 21:36:39 -0400
committerCullum Smith <cullum@sacredheartsc.com>2024-10-31 21:36:39 -0400
commit2c9845db4bc00221bc3c2343a020208f7f532166 (patch)
tree843bc24a1bbf2cad33c4bdc8a17c3d0d838fceb4 /scripts/hostname/desktop2
parent7eb111136453d0e8d8451d7dd85ba9892318f294 (diff)
downloadinfrastructure-2c9845db4bc00221bc3c2343a020208f7f532166.tar.gz
many fixes
Diffstat (limited to 'scripts/hostname/desktop2')
-rw-r--r--scripts/hostname/desktop224
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/hostname/desktop2 b/scripts/hostname/desktop2
new file mode 100644
index 0000000..0e6e551
--- /dev/null
+++ b/scripts/hostname/desktop2
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+# This desktop has USB speakers and webcam USB microphone, so sndio can't
+# use both at the same time. This creates a virtual device combining both
+# of them into one virutal sound card.
+#
+# Because the virtual soundcard is installed to /dev/dsp, it will
+# automatically be used as the default.
+
+playback_device=1
+recording_device=0
+samplerate=48000
+bits=16
+buffer_ms=25
+microphone_gain=50
+
+pkg install -y virtual_oss
+sysrc -v \
+ virtual_oss_enable=YES \
+ virtual_oss_dsp="-T /dev/sndstat -C 2 -c 2 -S -r ${samplerate} -b ${bits} -s ${buffer_ms}ms -O /dev/dsp${playback_device} -R /dev/dsp${recording_device} -d dsp -t vsdp.ctl"
+service virtual_oss restart
+
+set_loader_conf "hint.pcm.${recording_device}.mic=${microphone_gain}"
+set_loader_conf "hint.pcm.${playback_device}.pcm=100"