-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-ltc-loopback.sh
More file actions
executable file
·60 lines (49 loc) · 1.93 KB
/
setup-ltc-loopback.sh
File metadata and controls
executable file
·60 lines (49 loc) · 1.93 KB
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
#!/bin/bash
# LTC Loopback using module-remap-source to create a proper input device
# This approach creates both a sink and a remapped source that Qt can see
set -e
case "$1" in
start|"")
echo "Creating LTC virtual audio cable..."
# Create a null sink (output device)
SINK_ID=$(pactl load-module module-null-sink \
sink_name=ltc_cable_sink \
sink_properties=device.description="LTC_Cable_Out")
echo "Created output device: LTC_Cable_Out (module $SINK_ID)"
# Create a remapped source from the null sink's monitor
# This creates a proper input device (not just a monitor)
SOURCE_ID=$(pactl load-module module-remap-source \
master=ltc_cable_sink.monitor \
source_name=ltc_cable_source \
source_properties="device.description='LTC_Cable_In' device.class=audio/source")
echo "Created input device: LTC_Cable_In (module $SOURCE_ID)"
echo ""
echo "Success! Virtual audio cable created."
echo ""
echo "In vtcgui:"
echo " Generator → Select 'LTC_Cable_Out' as output"
echo " Reader → Select 'LTC_Cable_In' as input"
echo ""
echo "To remove: $0 stop"
;;
stop)
echo "Removing LTC virtual audio cable..."
# Remove in reverse order
pactl list short modules | grep ltc_cable_source | awk '{print $1}' | while read id; do
pactl unload-module "$id" 2>/dev/null && echo "Removed source module $id" || true
done
pactl list short modules | grep ltc_cable_sink | awk '{print $1}' | while read id; do
pactl unload-module "$id" 2>/dev/null && echo "Removed sink module $id" || true
done
echo "LTC virtual audio cable removed"
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac