From 13c676a88649f58d24f8ccd3b97a60ce34bc97a3 Mon Sep 17 00:00:00 2001 From: Lucas Bickel Date: Tue, 7 Mar 2017 15:13:26 +0100 Subject: [PATCH] Set up alsa on vagrant Should work on linux and macos, I only tested osx and was able to hear sound coming out of it using mpg123 on the command line. LibreTime probably still needs some fixes to make this work as intended. --- Vagrantfile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Vagrantfile b/Vagrantfile index 88df66969..54d478519 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -15,8 +15,29 @@ Vagrant.configure("2") do |config| config.vm.provider "virtualbox" do |v| # to run without OOMing we need at least 1GB of RAM v.memory = 1024 + + # enable audio drivers on VM settings + # pinched from https://github.com/GeoffreyPlitt/vagrant-audio + config.vm.provider :virtualbox do |vb| + if RUBY_PLATFORM =~ /darwin/ + vb.customize ["modifyvm", :id, '--audio', 'coreaudio', '--audiocontroller', 'hda'] # choices: hda sb16 ac97 + elsif RUBY_PLATFORM =~ /mingw|mswin|bccwin|cygwin|emx/ + vb.customize ["modifyvm", :id, '--audio', 'dsound', '--audiocontroller', 'ac97'] + end + end end + # ubuntu/trusty64 alsa setup + # slightly modernized from https://github.com/naomiaro/vagrant-alsa-audio + # https://wiki.ubuntu.com/Audio/UpgradingAlsa/DKMS + config.vm.provision "shell", inline: <<-SHELL + alsa_deb="oem-audio-hda-daily-dkms_0.201703070301~ubuntu14.04.1_all.deb" + wget -nv https://code.launchpad.net/~ubuntu-audio-dev/+archive/ubuntu/alsa-daily/+files/${alsa_deb} + sudo dpkg -i ${alsa_deb} + rm ${alsa_deb} + sudo DEBIAN_FRONTEND=noninteractive apt-get -y -m --force-yes install alsa + sudo usermod -a -G audio vagrant + SHELL config.vm.provision "shell", inline: "cd /vagrant; ./install -fIapv --web-port=9080" config.vm.provision "shell", path: "docs/scripts/install.sh" config.vm.provision "shell", path: "docs/scripts/serve.sh"