Set up multiple sound server options for FreeBSD.

This commit is contained in:
Tom Alexander 2024-05-18 09:52:18 -04:00
parent f44074ebe7
commit 38d255f0ab
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
8 changed files with 59 additions and 21 deletions

View File

@ -15,6 +15,7 @@ pflog_conf:
- name: 0
dev: pflog0
cputype: "amd"
hwpstate: true
etc_hosts: {}
wireguard_directory: mrmanager
enabled_wireguard:

View File

@ -17,6 +17,7 @@ graphics_driver: "amd"
cputype: "amd"
hwpstate: true
cores: 16
sound_system: "oss"
users:
talexander:
initialize: true

View File

@ -5,7 +5,6 @@
CPUTYPE?=x86-64-v4
.elif ${.CURDIR:N*/lang/gcc48*} && ${.CURDIR:N*/lang/gcc10*} && ${.CURDIR:N*/devel/binutils*} && ${.CURDIR:N*/devel/qt6-base*} && ${.CURDIR:N*/www/node20*}
CPUTYPE?=znver4
# CPUTYPE?=x86-64-v4
.endif
# Disable static for subversion because /usr/local/lib/libutf8proc.a not found despite utf8proc being installed
@ -26,7 +25,8 @@ OPTIONS_SET+=NATIVECOMP PGTK
.endif
.if ${.CURDIR:M*/www/firefox*}
OPTIONS_UNSET+=PULSEAUDIO SNDIO JACK
OPTIONS_UNSET+=PULSEAUDIO SNDIO
OPTIONS_UNSET+=JACK
.endif
OPTIONS_SET+=OPTIMIZED_CFLAGS

View File

@ -1,11 +1,7 @@
archivers/unrar
archivers/unzip
archivers/zip
audio/jack
audio/mixertui
audio/noise-suppression-for-voice-lv2
audio/pavucontrol
audio/qjackctl
databases/sqlite3
deskutils/xdg-desktop-portal
devel/git

View File

@ -4,13 +4,6 @@
- mixertui
state: present
- name: Install packages
when: install_graphics
package:
name:
- pavucontrol
state: present
- name: Configure sysctls
ignore_errors: true
when: sound_default_unit is defined
@ -25,12 +18,15 @@
- name: hw.snd.default_unit
value: "{{ sound_default_unit }}"
- name: Install loader.conf
copy:
src: "files/{{ item }}_loader.conf"
dest: "/boot/loader.conf.d/{{ item }}.conf"
mode: 0644
owner: root
group: wheel
- name: Configure sysctls
sysctl:
name: "{{ item.name }}"
value: "{{ item.value }}"
state: present
sysctl_file: "/etc/sysctl.conf.local"
loop:
- realtime_priority
- name: hw.snd.verbose
value: "2"
- include_tasks: "tasks/freebsd_{{sound_system}}.yaml"
when: sound_system is defined

View File

@ -0,0 +1,37 @@
# Jack users must be added to the realtime group.
# Also set memorylocked to 128M in login.conf
# D-bus should be enabled for auto-launching jack.
- name: Install loader.conf
copy:
src: "files/{{ item }}_loader.conf"
dest: "/boot/loader.conf.d/{{ item }}.conf"
mode: 0644
owner: root
group: wheel
loop:
- realtime_priority
- name: Install packages
package:
name:
- jackit
state: present
- name: Install packages
when: install_graphics
package:
name:
- qjackctl
state: present
# hw.snd.default_auto=0 # (2)
# hw.snd.default_unit=1 # (3)
# hw.usb.uaudio.buffer_ms="2"
# hw.snd.latency=0
# hw.snd.latency_profile=0
# Hurts battery:
# kern.timecounter.alloweddeviation=0

View File

@ -0,0 +1,7 @@
- name: Install packages
when: install_graphics
package:
name:
- pavucontrol
state: present