Files
awesome-linuxaudio/ansible/playbook.yml

132 lines
6.6 KiB
YAML

---
# Ansible playbook to setup a Linux audio production system
# Draft. Prototype. Untested.
# Requires Debian 9 Stretch (testing)
# https://github.com/nodiscc/awesome-linuxaudio
# Minimum version: ansible 2.1
# Example usage: ansible-playbook -i hosts playbook.yml --tags=download-soundfonts
- hosts: all
become: false
become_user: root
vars:
- batt_cpu_governor: performance #CPU scaling governor on battery mode (performance/ondemand)
- local_home: "{{ lookup('env','HOME') }}" # wrapper to find current $HOME
tasks:
- name: install base packages
become: true
apt: state=latest name={{ item }}
with_items:
- apt-transport-https
- software-properties-common
- wget
- cpufrequtils
- laptop-mode-tools
- name: install jack packages
become: true
apt: state=latest name={{ item }}
with_items:
- jackd
- gladish
- laditools
# - pulseaudio-module-jack
# - qjackctl
# - vlc-plugin-jack
# - qjackrcd
### KXStudio (disabled)
# - name: download/install kxstudio sources.list/base package
# become: true
# apt: deb=https://launchpad.net/~kxstudio-debian/+archive/kxstudio/+files/kxstudio-repos_9.4.1~kxstudio1_all.deb
# - name: install gcc5 (debian 9+/ubuntu 15.10+)
# become: true
# apt: name=libglibmm-2.4-1v5 state=latest
# - name: download/install gcc5 package from kxstudio (debian 9+/ubuntu 15.10+)
# become: true
# apt: deb=https://launchpad.net/~kxstudio-debian/+archive/kxstudio/+files/kxstudio-repos-gcc5_9.4.1~kxstudio1_all.deb
### Other
# TODO: /etc/limits.d/audio.conf
# Provided by the jackd package.
# Changes to this file will be preserved.
# If you want to enable/disable realtime permissions, run
# dpkg-reconfigure -p high jackd
#@audio - rtprio 95
#@audio - memlock unlimited
#@audio - nice -19
# TODO: adduser $user audio, logout
- name: configure laptop-mode-tools (cpufreq)
become: true
template: src=etc_laptop-mode_conf.d_board-specific_cpufreq.conf.j2 dest=/etc/laptop-mode/conf.d/board-specific/cpufreq.conf
- name: download realtimeconfigquickscan
git: repo=https://github.com/raboof/realtimeconfigquickscan dest=/tmp/realtimeconfigquickscan
- name: run realtimeconfigquickscan
shell: 'perl ./realTimeConfigQuickScan.pl chdir=/tmp/realtimeconfigquickscan'
# TODO: configure laptop-mode tools drives/USB power management
# Another option is to create a systemd service/unit to switch governor to performance, but laptop-mode-tools has momre features
# TODO: make kxstudio package version configurable as it will change
# TODO: rtirq config? https://bitbucket.org/thismaechler/ubuntustudio-14.04-realtimeaudio/src/master/cfg/rtirq
# http://subversion.ffado.org/wiki/IrqPriorities
# http://alsa.opensrc.org/Rtirq
# TODO: create a systemd service that further optimizes resource usage (stop radio/networking/cups/...)
# TODO: install rt-preempt kernel, may need to reboot
# TODO: config/optimize jack http://wiki.linuxaudio.org/wiki/list_of_jack_frame_period_settings_ideal_for_usb_interface
# http://wiki.linuxaudio.org/wiki/optimize_jack
# TODO: tweak PCI latencies? https://www.mythtv.org/wiki/PCI_Latency
# TODO: switch CPU scheduler to BFS? https://en.wikipedia.org/wiki/Brain_Fuck_Scheduler
# TODO: customize CPU affinity? https://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html
# TODO: autostart ladi-system-tray
# Doc: https://bitbucket.org/thismaechler/ubuntustudio-14.04-realtimeaudio
# Doc: http://kxstudio.linuxaudio.org/Repositories
# Doc: https://github.com/raboof/realtimeconfigquickscan
# Doc: https://github.com/nodiscc/scriptz/blob/master/SNIPPETS.md
### Samples
- name: download soundfonts from http://freepats.zenvoid.org/
get_url: url={{ item }} dest='{{ local_home }}'
tags: download-soundfonts
with_items:
- 'http://freepats.zenvoid.org/ChromaticPercussion/HangDminor/Hang-D-minor-H2-20170907.tar.gz'
- 'http://freepats.zenvoid.org/Organ/ChurchOrganEmulation/ChurchOrganEmulation-20160921.tar.bz2'
- 'http://freepats.zenvoid.org/Organ/DrawbarOrganEmulation/DrawbarOrganEmulation-SF2-20170225.tar.xz'
- 'http://freepats.zenvoid.org/Guitar/SpanishClassicalGuitar/SpanishClassicalGuitar-20160210.tar.xz'
- 'http://freepats.zenvoid.org/Guitar/SeagullSteelStringGuitar/SeagullSteelStringGuitar-20160907.tar.xz'
- 'http://freepats.zenvoid.org/ElectricGuitar/FenderTelecaster/FT-EGuitarClean-SF2-20170222.tar.xz'
- 'http://freepats.zenvoid.org/ElectricGuitar/FenderTelecaster/FT-EGuitarMutedDirect-20161130.tar.xz'
- 'http://freepats.zenvoid.org/ElectricGuitar/FenderTelecaster/FT-EGuitarMutedClean-20161202.tar.xz'
- 'http://freepats.zenvoid.org/ElectricGuitar/FenderTelecaster/FT-EGuitarDistortion-20161103.tar.xz'
- 'http://freepats.zenvoid.org/ElectricGuitar/YElectricBass/YElectricBassDirect-20161108.tar.xz'
- 'http://freepats.zenvoid.org/ElectricGuitar/YElectricBass/YElectricBassClean-20161107.tar.xz'
- 'http://freepats.zenvoid.org/Synthesizer/SynthBass1/SynthBass1-SF2-20161227.tar.xz'
- 'http://freepats.zenvoid.org/Synthesizer/SynthBass2/SynthBass2-SF2-20161230.tar.xz'
- 'http://freepats.zenvoid.org/Synthesizer/SynthStrings1/SynthStrings1-20160913.tar.xz'
- 'http://freepats.zenvoid.org/Synthesizer/SynthStrings2/SynthStrings2-20160913.tar.bz2'
- 'http://freepats.zenvoid.org/Synthesizer/SynthBrass1/SynthBrass1-20160915.tar.xz'
- 'http://freepats.zenvoid.org/Synthesizer/SynthSquare/SynthSquare-20161127.tar.xz'
- 'http://freepats.zenvoid.org/Synthesizer/SynthCalliope/SynthCalliope-20161115.tar.xz'
- 'http://freepats.zenvoid.org/Synthesizer/NewAge/NewAge-20161211.tar.xz'
- 'http://freepats.zenvoid.org/Percussion/ColomboAcousticDrumKit/ColomboADK-FreePats-20160809-H2-097.tar.xz'
- 'http://freepats.zenvoid.org/Percussion/MuldjordKit/MuldjordKit2.tar.xz'
- 'http://freepats.zenvoid.org/SoundSets/FreePats2-GeneralMIDI/FreePats2-GM-20170822.tar.xz'
- 'http://freepats.zenvoid.org/Piano/KawaiUprightPiano/KawaiUprightPiano-SF2-20170128.tar.xz'
- 'http://freepats.zenvoid.org/Piano/YDP-GrandPiano/grand-piano-YDP-20160804.tar.bz2'
- 'http://freepats.zenvoid.org/Piano/SalamanderGrandPiano/SalamanderGrandPianoV3+20161209_48khz24bit.tar.xz'
- 'http://freepats.zenvoid.org/ElectricPiano/FM-Piano1/FM-Piano1-20161108.tar.xz'
- 'http://freepats.zenvoid.org/ElectricPiano/FM-Piano2/FM-Piano2-20161112.tar.xz'