Revert "Split UMC202HD inputs into mono channels"
This reverts commit d2b01eaf44.
pipewire-media-session is no longer supported upstream and has been removed
This commit is contained in:
parent
39371c5367
commit
0b97afa7ce
2 changed files with 10 additions and 54 deletions
|
|
@ -1,10 +1,5 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
defaults = {
|
||||
media-session = (builtins.fromJSON (builtins.readFile "${pkgs.pipewire-media-session}/nix-support/media-session.conf.json"));
|
||||
};
|
||||
in
|
||||
lib.mkIf config.myConfig.gui.enable {
|
||||
sound.enable = true;
|
||||
hardware.pulseaudio.enable = false;
|
||||
|
|
@ -40,43 +35,4 @@ lib.mkIf config.myConfig.gui.enable {
|
|||
value = "unlimited";
|
||||
}
|
||||
];
|
||||
|
||||
# Split U-PHORIA inputs into mono channels
|
||||
# https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Virtual-Devices#behringer-umc404hd-micguitar-virtual-sources
|
||||
services.pipewire.media-session.config.media-session."context.modules" = defaults.media-session."context.modules" ++ [
|
||||
{
|
||||
name = "libpipewire-module-loopback";
|
||||
args = {
|
||||
"node.name" = "UMC202HD_input1";
|
||||
"node.description" = "UMC202HD Input 1";
|
||||
"capture.props" = {
|
||||
"audio.position" = [ "AUX0" ];
|
||||
"stream.dont-remix" = true;
|
||||
"node.target" = "alsa_input.usb-BEHRINGER_UMC202HD_192k-00.pro-input-0";
|
||||
"node.passive" = true;
|
||||
};
|
||||
"playback.props" = {
|
||||
"media.class" = "Audio/Source";
|
||||
"audio.position" = [ "MONO" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "libpipewire-module-loopback";
|
||||
args = {
|
||||
"node.name" = "UMC202HD_input2";
|
||||
"node.description" = "UMC202HD Input 2";
|
||||
"capture.props" = {
|
||||
"audio.position" = [ "AUX1" ];
|
||||
"stream.dont-remix" = true;
|
||||
"node.target" = "alsa_input.usb-BEHRINGER_UMC202HD_192k-00.pro-input-0";
|
||||
"node.passive" = true;
|
||||
};
|
||||
"playback.props" = {
|
||||
"media.class" = "Audio/Source";
|
||||
"audio.position" = [ "MONO" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,24 +3,24 @@ import serial
|
|||
|
||||
|
||||
def run():
|
||||
source_to_led_mapping = {
|
||||
"UMC202HD_input1": 0,
|
||||
"UMC202HD_input2": 1,
|
||||
}
|
||||
|
||||
with pulsectl.Pulse("event-printer") as pulse:
|
||||
|
||||
def print_events(ev):
|
||||
with pulsectl.Pulse("event-source-info") as pulse2:
|
||||
source = pulse2.source_info(ev.index)
|
||||
if source.name in source_to_led_mapping.keys():
|
||||
if source.name in [
|
||||
"alsa_input.usb-BEHRINGER_UMC202HD_192k-00.analog-stereo",
|
||||
"alsa_input.usb-BEHRINGER_UMC202HD_192k-00.analog-stereo-input",
|
||||
]:
|
||||
muted = bool(source.mute)
|
||||
led = source_to_led_mapping[source.name]
|
||||
with serial.Serial(port="/dev/mute-indicator", baudrate=115200) as ser:
|
||||
if muted:
|
||||
ser.write(f"L{led}:32,0,0\n".encode())
|
||||
ser.write("L0:32,0,0\n".encode())
|
||||
ser.write("L1:32,0,0\n".encode())
|
||||
ser.write("S\n".encode())
|
||||
else:
|
||||
ser.write(f"L{led}:0,32,0\n".encode())
|
||||
ser.write("L0:0,32,0\n".encode())
|
||||
ser.write("L1:0,32,0\n".encode())
|
||||
ser.write("S\n".encode())
|
||||
|
||||
pulse.event_mask_set("source")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue