-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhologram-arcturus-capture-card.pkg.toml
134 lines (118 loc) · 4.23 KB
/
hologram-arcturus-capture-card.pkg.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
[package]
name = "hologram-arcturus-capture-card"
version = "1.0.3"
description = "hologram: tooling for HDMI capture card on Arcturus"
requires = [
"jack-autoplug",
"mpv",
"pipewire-jack",
]
# I have a keybinding in Sway that runs this script to either start or stop all the respective services.
[[file]]
path = "/usr/bin/capture-card-audio-only-toggle"
mode = "0755"
content = '''
#!/bin/sh
set -euo pipefail
if systemctl --user is-active --quiet audio-only-capture-card.target; then
systemctl --user stop audio-only-capture-card.target
else
systemctl --user start audio-only-capture-card.target
fi
'''
# I have a keybinding in Sway that runs this script to either start or stop all the respective services.
[[file]]
path = "/usr/bin/capture-card-mpv-toggle"
mode = "0755"
content = '''
#!/bin/sh
set -euo pipefail
if systemctl --user is-active --quiet mpv-capture-card.target; then
systemctl --user stop mpv-capture-card.target
else
systemctl --user start mpv-capture-card.target
fi
'''
[[file]]
path = "/usr/lib/systemd/user/audio-only-capture-card.target"
content = '''
[Unit]
Description = Deliver audio from capture card via PipeWire
Wants = audio-only-capture-card.service jack-autoplug-to-mixing-console.service jack-autoplug-to-headphones.service jack-autoplug-to-earphones.service
PropagatesStopTo = audio-only-capture-card.service jack-autoplug-to-mixing-console.service jack-autoplug-to-headphones.service jack-autoplug-to-earphones.service
Conflicts = mpv-capture-card.target
'''
[[file]]
path = "/usr/lib/systemd/user/mpv-capture-card.target"
content = '''
[Unit]
Description = Deliver video/audio from capture card via mpv and PipeWire
Wants = mpv-capture-card.service jack-autoplug-to-mixing-console.service jack-autoplug-to-headphones.service jack-autoplug-to-earphones.service
PropagatesStopTo = mpv-capture-card.service jack-autoplug-to-mixing-console.service jack-autoplug-to-headphones.service jack-autoplug-to-earphones.service
Conflicts = audio-only-capture-card.target
'''
[[file]]
path = "/usr/lib/systemd/user/audio-only-capture-card.service"
content = '''
[Unit]
Description = Enable audio input from capture card while running
Conflicts = mpv-capture-card.service
[Service]
ExecStartPre=capture-card-set-profile input:analog-stereo
ExecStart=tail -f /dev/null
ExecStopPost=capture-card-set-profile off
Restart=always
RestartSec=1s
'''
[[file]]
path = "/usr/lib/systemd/user/mpv-capture-card.service"
content = '''
[Unit]
Description = Show video input from capture card in mpv
Conflicts = audio-only-capture-card.service
[Service]
ExecStartPre=capture-card-set-profile input:analog-stereo
ExecStart=mpv av://v4l2:/dev/video0 --demuxer-lavf-format=video4linux2 --demuxer-lavf-o-set=input_format=mjpeg --profile=low-latency
ExecStopPost=capture-card-set-profile off
Restart=always
RestartSec=1s
'''
[[file]]
path = "/usr/lib/systemd/user/jack-autoplug-to-mixing-console.service"
content = '''
[Unit]
Description = Connect capture card to mixing console with jack-autoplug
[Service]
ExecStart=pw-jack jack-autoplug -f "Kaptivo Whiteboard Analog Stereo" -F capture_FL -F capture_FR -t "AG06/AG03 Analog Stereo" -T playback_FL -T playback_FR
Restart=always
RestartSec=1s
'''
[[file]]
path = "/usr/lib/systemd/user/jack-autoplug-to-headphones.service"
content = '''
[Unit]
Description = Connect capture card to headphones with jack-autoplug
[Service]
ExecStart=pw-jack jack-autoplug -f "Kaptivo Whiteboard Analog Stereo" -F capture_FL -F capture_FR -t "Jabra Evolve 75" -T playback_FL -T playback_FR
Restart=always
RestartSec=1s
'''
[[file]]
path = "/usr/lib/systemd/user/jack-autoplug-to-earphones.service"
content = '''
[Unit]
Description = Connect capture card to earphones with jack-autoplug
[Service]
ExecStart=pw-jack jack-autoplug -f "Kaptivo Whiteboard Analog Stereo" -F capture_FL -F capture_FR -t "ATH-CKS50TW" -T playback_FL -T playback_FR
Restart=always
RestartSec=1s
'''
[[file]]
path = "/usr/bin/capture-card-set-profile"
mode = "0755"
content = '''
#!/bin/sh
set -euo pipefail
CARD_NAME="$(pactl list cards | awk '$1=="Name:"{print$2}' | grep Kaptivo | head -n1)"
pactl set-card-profile "$CARD_NAME" "$1"
'''