mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 12:45:27 +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;
|
package = firefoxPackage;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Create a virtual sound device, with mixing
|
hardware.alsa = {
|
||||||
# and all, for recording audio.
|
enable = true;
|
||||||
boot.kernelModules = [ "snd-aloop" ];
|
enableRecorder = true;
|
||||||
environment.etc."asound.conf".text = ''
|
defaultDevice.playback = "pcm.recorder";
|
||||||
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
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
|
|
||||||
systemd.services.audio-recorder = {
|
systemd.services.audio-recorder = {
|
||||||
description = "Record NixOS test audio to /tmp/record.wav";
|
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