Adds alsa config for loopback recording.

This commit is contained in:
Bailey Stevens 2023-09-21 05:09:06 -04:00
parent f319dfb046
commit f3f1509751
4 changed files with 54 additions and 2 deletions

4
.gitignore vendored
View File

@ -1,3 +1,3 @@
result
sd-card.img
clementine.qcow2
*.img
*.qcow2

43
asound.conf Normal file
View File

@ -0,0 +1,43 @@
pcm.multi {
type route;
slave.pcm {
type multi;
slaves.a.pcm "output";
slaves.b.pcm "loopin";
slaves.a.channels 2;
slaves.b.channels 2;
bindings.0.slave a;
bindings.0.channel 0;
bindings.1.slave a;
bindings.1.channel 1;
bindings.2.slave b;
bindings.2.channel 0;
bindings.3.slave b;
bindings.3.channel 1;
}
ttable.0.0 1;
ttable.1.1 1;
ttable.0.2 1;
ttable.1.3 1;
}
pcm.!default {
type plug
slave.pcm "multi"
}
pcm.output {
type hw
card 0
}
pcm.loopin {
type plug
slave.pcm "hw:Loopback,0,0"
}
pcm.loopout {
type plug
slave.pcm "hw:Loopback,1,0"
}

View File

@ -2,6 +2,11 @@
{
system.stateVersion = "23.05";
boot.kernelModules = [ "snd-aloop" ];
boot.extraModprobeConfig = ''
options snd-aloop index=8
'';
# Enables flakes and the updated `nix` command
nix.settings.experimental-features = [ "nix-command" "flakes" ];
@ -9,6 +14,7 @@
hardware.opengl.enable = true;
sound.enable = true;
sound.extraConfig = (builtins.readFile ./asound.conf);
# Includes packages needed for startx
services.xserver = {

View File

@ -9,8 +9,11 @@
hardware.raspberry-pi."4" = {
fkms-3d.enable = true;
apply-overlays-dtmerge.enable = true;
audio.enable = false;
};
boot.blacklistedKernelModules = [ "snd_bcm2835" ];
console.enable = false;
environment.systemPackages = with pkgs; [
libraspberrypi