mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
nixos/tests/firefox: use hardware.alsa
This commit is contained in:
parent
c8a84a01d5
commit
0b5ca42f31
1 changed files with 6 additions and 28 deletions
|
@ -18,37 +18,15 @@ import ./make-test-python.nix ({ lib, pkgs, firefoxPackage, ... }:
|
|||
package = firefoxPackage;
|
||||
};
|
||||
|
||||
# Create a virtual sound device, with mixing
|
||||
# and all, for recording audio.
|
||||
boot.kernelModules = [ "snd-aloop" ];
|
||||
environment.etc."asound.conf".text = ''
|
||||
pcm.!default {
|
||||
type plug
|
||||
slave.pcm pcm.dmixer
|
||||
}
|
||||
pcm.dmixer {
|
||||
type dmix
|
||||
ipc_key 1
|
||||
slave {
|
||||
pcm "hw:Loopback,0,0"
|
||||
rate 48000
|
||||
periods 128
|
||||
period_time 0
|
||||
period_size 1024
|
||||
buffer_size 8192
|
||||
}
|
||||
}
|
||||
pcm.recorder {
|
||||
type hw
|
||||
card "Loopback"
|
||||
device 1
|
||||
subdevice 0
|
||||
}
|
||||
'';
|
||||
hardware.alsa = {
|
||||
enable = true;
|
||||
enableRecorder = true;
|
||||
defaultDevice.playback = "pcm.recorder";
|
||||
};
|
||||
|
||||
systemd.services.audio-recorder = {
|
||||
description = "Record NixOS test audio to /tmp/record.wav";
|
||||
script = "${pkgs.alsa-utils}/bin/arecord -D recorder -f S16_LE -r48000 /tmp/record.wav";
|
||||
script = "${pkgs.alsa-utils}/bin/arecord -Drecorder -fS16_LE -r48000 -c2 /tmp/record.wav";
|
||||
};
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue