Compare commits

..

No commits in common. "9a271848858ae3bb28cfeaf87742b11e88e69c12" and "5a08b3e0bd7191a6f2a70188c8213d4b25b7d788" have entirely different histories.

9 changed files with 91 additions and 211 deletions

View File

@ -1 +0,0 @@
tcp_bbr_load="YES"

View File

@ -148,25 +148,3 @@
block: |
daily_scrub_zfs_enable="YES"
daily_scrub_zfs_default_threshold="7"
# Switch to bbr tcp congestion control which should be better on lossy connections like bad wifi.
- name: Install loader.conf
copy:
src: "files/{{ item }}_loader.conf"
dest: "/boot/loader.conf.d/{{ item }}.conf"
mode: 0644
owner: root
group: wheel
loop:
- bbr
- name: Configure sysctls
sysctl:
name: "{{ item.name }}"
value: "{{ item.value }}"
state: present
reload: false
sysctl_file: "/etc/sysctl.conf.local"
loop:
- name: net.inet.tcp.functions_default
value: "bbr"

View File

@ -26,8 +26,6 @@ firefox_config:
# Disable battery status, used to track users.
dom.battery.enabled: false
# Disable that websites can get notifications if you copy, paste, or cut something from a web page, and it lets them know which part of the page had been selected.
#
# This breaks copying from BigQuery https://github.com/microsoft/monaco-editor/issues/1540
dom.event.clipboardevents.enabled: false
# Isolates all browser identifier sources (e.g. cookies) to the first party domain, with the goal of preventing tracking across different domains.
privacy.firstparty.isolate: true

View File

@ -74,25 +74,3 @@
# doas mkdir /tmp/emulated_tpm
# doas swtpm socket --tpmstate dir=/tmp/emulated_tpm --ctrl type=unixio,path=/tmp/emulated_tpm/swtpm-sock --log level=20 --tpm2
- name: Build aur packages
register: buildaur
become_user: "{{ build_user.name }}"
command: "aurutils-sync --no-view {{ item }}"
args:
creates: "/var/cache/pacman/custom/{{ item }}-*.pkg.tar.*"
loop:
- fw-ectool-git
- name: Update cache
when: buildaur.changed
pacman:
name: []
state: present
update_cache: true
- name: Install packages
package:
name:
- fw-ectool-git
state: present

View File

@ -12,16 +12,12 @@ function main {
shift
if [ "$cmd" = "copy" ]; then
copy "${@}"
elif [ "$cmd" = "av1" ]; then
av1 "${@}"
elif [ "$cmd" = "stream_software_h264" ]; then
stream_software_h264 "${@}"
elif [ "$cmd" = "stream_hardware_h264" ]; then
stream_hardware_h264 "${@}"
elif [ "$cmd" = "preprocess_software_h264" ]; then
preprocess_software_h264 "${@}"
elif [ "$cmd" = "h264" ]; then
h264 "${@}"
elif [ "$cmd" = "preprocess_hardware_h264" ]; then
preprocess_hardware_h264 "${@}"
elif [ "$cmd" = "software_h264" ]; then
software_h264 "${@}"
elif [ "$cmd" = "vp9" ]; then
vp9 "${@}"
elif [ "$cmd" = "preprocess_hardware_vp9" ]; then
@ -64,71 +60,7 @@ function copy {
"rtsp://$USERNAME:$PASSWORD@172.16.16.251:8554/fetch"
}
function av1 {
# local additional_flags=()
# additional_flags+=(--profile "$PROFILE")
# (cd "$DIR/../" && cargo build --no-default-features "${additional_flags[@]}")
local destination_type="$1" # "stream" or "preprocess"
local acceleration_type="$2" # "software" or "hardware"
# shift 2
local args=()
if [ "$destination_type" == "stream" ]; then
args+=(-re -stream_loop -1)
elif [ "$destination_type" == "preproces" ]; then
true
else
(>&2 echo "Unknown destination type: $destination_type")
exit 1
fi
if [ "$acceleration_type" == "software" ]; then
true
elif [ "$acceleration_type" == "hardware" ]; then
args+=(-vaapi_device /dev/dri/renderD128)
else
(>&2 echo "Unknown acceleration type: $acceleration_type")
exit 1
fi
args+=(-i "$file_to_cast")
if [ "$acceleration_type" == "software" ]; then
args+=(-c:v h264)
elif [ "$acceleration_type" == "hardware" ]; then
args+=(-vf 'format=nv12|vaapi,hwupload')
args+=(-c:v h264_vaapi)
else
(>&2 echo "Unknown acceleration type: $acceleration_type")
exit 1
fi
args+=(-b:v 2M)
args+=(-profile:v high)
args+=(-bf 0)
args+=(-strict -2)
args+=(-c:a opus)
args+=(-ac 2)
args+=(-b:a 320k)
args+=(-ar 48000)
if [ "$destination_type" == "stream" ]; then
args+=(-f rtsp)
args+=(-rtsp_transport tcp)
args+=("rtsp://$USERNAME:$PASSWORD@172.16.16.251:8554/fetch")
elif [ "$destination_type" == "preproces" ]; then
args+=("$file_to_save")
else
(>&2 echo "Unknown destination type: $destination_type")
exit 1
fi
}
function stream_software_h264 {
function h264 {
local file_to_cast
file_to_cast="$3"
@ -140,74 +72,24 @@ function stream_software_h264 {
# -bf 0 :: Disable b-frames because webrtc doesn't support h264 streams with b-frames.
</dev/null exec ffmpeg \
-re \
-stream_loop -1 \
-i "$file_to_cast" \
-c:v h264 \
-b:v 2M \
-profile:v high \
-bf 0 \
-strict -2 \
-c:a opus \
-ac 2 \
-b:a 320k \
-ar 48000 \
-f rtsp \
-rtsp_transport tcp \
"rtsp://$USERNAME:$PASSWORD@172.16.16.251:8554/fetch"
}
function stream_hardware_h264 {
local file_to_cast
file_to_cast="$3"
local USERNAME PASSWORD
USERNAME="$1"
PASSWORD="$2"
set -x
# -bf 0 :: Disable b-frames because webrtc doesn't support h264 streams with b-frames.
</dev/null exec ffmpeg \
-re \
-stream_loop -1 \
-vaapi_device /dev/dri/renderD128 \
-i "$file_to_cast" \
-vf 'format=nv12|vaapi,hwupload' \
-c:v h264_vaapi \
-b:v 2M \
-profile:v high \
-bf 0 \
-strict -2 \
-c:a opus \
-ac 2 \
-b:a 320k \
-ar 48000 \
-f rtsp \
-rtsp_transport tcp \
"rtsp://$USERNAME:$PASSWORD@172.16.16.251:8554/fetch"
}
function preprocess_software_h264 {
local file_to_cast file_to_save
file_to_cast="$1"
file_to_save="$2"
set -x
# -bf 0 :: Disable b-frames because webrtc doesn't support h264 streams with b-frames.
</dev/null exec ffmpeg \
-i "$file_to_cast" \
-c:v h264 \
-b:v 2M \
-profile:v high \
-bf 0 \
-strict -2 \
-c:a opus \
-ac 2 \
-b:a 320k \
-ar 48000 \
"$file_to_save"
-re \
-stream_loop -1 \
-init_hw_device vaapi=foo:/dev/dri/renderD128 \
-hwaccel vaapi \
-hwaccel_output_format vaapi \
-hwaccel_device foo \
-i "$file_to_cast" \
-filter_hw_device foo \
-vf 'format=nv12|vaapi,hwupload' \
-c:v h264_vaapi \
-bf 0 \
-strict -2 \
-c:a opus \
-b:a 320k \
-ar 48000 \
-f rtsp \
-rtsp_transport tcp \
"rtsp://$USERNAME:$PASSWORD@172.16.16.251:8554/fetch"
}
function preprocess_hardware_h264 {
@ -219,19 +101,66 @@ function preprocess_hardware_h264 {
# -bf 0 :: Disable b-frames because webrtc doesn't support h264 streams with b-frames.
</dev/null exec ffmpeg \
-vaapi_device /dev/dri/renderD128 \
-i "$file_to_cast" \
-vf 'format=nv12,hwupload' \
-c:v h264_vaapi \
-b:v 2M \
-profile:v high \
-bf 0 \
-strict -2 \
-c:a opus \
-ac 2 \
-b:a 320k \
-ar 48000 \
"$file_to_save"
-init_hw_device vaapi=foo:/dev/dri/renderD128 \
-hwaccel vaapi \
-hwaccel_output_format vaapi \
-hwaccel_device foo \
-i "$file_to_cast" \
-filter_hw_device foo \
-vf 'format=nv12|vaapi,hwupload' \
-c:v h264_vaapi \
-b:v 2M \
-profile:v high \
-bf 0 \
-strict -2 \
-c:a opus \
-ac 2 \
-b:a 320k \
-ar 48000 \
"$file_to_save"
}
function software_h264 {
local file_to_cast
file_to_cast="$3"
local USERNAME PASSWORD
USERNAME="$1"
PASSWORD="$2"
set -x
# -bf 0 :: Disable b-frames because webrtc doesn't support h264 streams with b-frames.
</dev/null exec ffmpeg \
-re \
-stream_loop -1 \
-i "$file_to_cast" \
-c:v h264 \
-bf 0 \
-c:a opus \
-b:a 320k \
-ar 48000 \
-f rtsp \
-rtsp_transport tcp \
"rtsp://$USERNAME:$PASSWORD@172.16.16.251:8554/fetch"
}
function preprocess_h264 {
local file_to_cast file_to_save
file_to_cast="$1"
file_to_save="$2"
set -x
# -bf 0 :: Disable b-frames because webrtc doesn't support h264 streams with b-frames.
</dev/null exec ffmpeg \
-i "$file_to_cast" \
-c:v h264 \
-bf 0 \
-c:a opus \
-b:a 320k \
-ar 48000 \
"$file_to_save"
}
function vp9 {

View File

@ -3,5 +3,4 @@ ifconfig_igb0="up"
ifconfig_igb1="up"
ifconfig_lagg0="up laggproto failover laggport igb0 laggport igb1"
ifconfig_lagg0_alias0="inet 74.80.180.138 netmask 255.255.255.248"
ifconfig_lagg0_ipv6="inet6 2620:11f:7001:7::2/64"
ifconfig_lagg0_alias1="inet6 2620:11f:7001:7::3 prefixlen 64"
ifconfig_lagg0_alias1="inet6 2620:11f:7001:7::2/64"

View File

@ -19,7 +19,7 @@ function cleanup {
done
}
vms=()
for sig in EXIT; do
for sig in EXIT INT QUIT HUP TERM; do
trap "set +e; sleep 10; cleanup" "$sig"
done
@ -67,17 +67,17 @@ function start_vm {
local bridge_link_name
bridge_link_name=$(detect_available_link "${bridge_name}")
additional_args+=("-s" "2:0,virtio-net,netgraph,path=${bridge_name}:,peerhook=${bridge_link_name},mac=${mac_address}")
# additional_args+=("-s" "2:0,virtio-net,netgraph,path=${bridge_name}:,peerhook=${bridge_link_name},mac=${mac_address}" "-s" "3,ahci-cd,/home/talexander/disk.iso")
# -H \
# additional_args+=("-s" "2:0,virtio-net,netgraph,path=${bridge_name}:,peerhook=${bridge_link_name},mac=${mac_address}")
additional_args+=("-s" "2:0,virtio-net,netgraph,path=${bridge_name}:,peerhook=${bridge_link_name},mac=${mac_address}" "-s" "3,ahci-cd,/home/talexander/disk.iso")
vms+=("$name")
while true; do
set -x
set +e
bhyve \
-D \
-c 2 \
-c 1 \
-m 3G \
-H \
-o 'rtc.use_localtime=false' \
-s 0,hostbridge \
-s "4,nvme,/dev/zvol/zroot/vm/mediamtx/disk0" \

View File

@ -19,7 +19,7 @@ function cleanup {
done
}
vms=()
for sig in EXIT; do
for sig in EXIT INT QUIT HUP TERM; do
trap "set +e; sleep 10; cleanup" "$sig"
done

View File

@ -19,7 +19,7 @@ function cleanup {
done
}
vms=()
for sig in EXIT; do
for sig in EXIT INT QUIT HUP TERM; do
trap "set +e; sleep 10; cleanup" "$sig"
done
@ -68,7 +68,6 @@ function start_vm {
bridge_link_name=$(detect_available_link "${bridge_name}")
additional_args+=("-s" "2:0,virtio-net,netgraph,path=${bridge_name}:,peerhook=${bridge_link_name},mac=${mac_address}")
# additional_args+=("-s" "2:0,virtio-net,netgraph,path=${bridge_name}:,peerhook=${bridge_link_name},mac=${mac_address}" "-s" "3,ahci-cd,/home/talexander/disk.iso")
vms+=("$name")
while true; do
set -x