Revert "Update Venmic to 7.1.0 (#1291)"

This reverts commit f11585586f.

Because this upgrades venmic to require GLIBCXX_3.4.35 (gcc16), which is too new and won't work for most users
This commit is contained in:
Vendicated
2026-08-18 04:28:34 +02:00
parent c9ded5c658
commit 7d087e7275
8 changed files with 101 additions and 97 deletions
+43 -33
View File
@@ -66,23 +66,28 @@ function getRendererAudioServicePid() {
);
}
function buildLinkData({ include, exclude }: { include?: Node[]; exclude?: Node[] }) {
const pid = getRendererAudioServicePid();
ipcMain.handle(IpcEvents.VIRT_MIC_LIST, () => {
const audioPid = getRendererAudioServicePid();
const { mute, ignoreDevices, ignoreInputMedia, ignoreVirtual, workaround, onlySpeakers, onlyDefaultSpeakers } =
Settings.store.audio ?? {};
const { granularSelect } = Settings.store.audio ?? {};
const targets = obtainVenmic()
?.list(granularSelect ? ["node.name"] : undefined)
.filter(s => s["application.process.id"] !== audioPid);
return targets ? { ok: true, targets, hasPipewirePulse } : { ok: false, isGlibCxxOutdated };
});
ipcMain.handle(IpcEvents.VIRT_MIC_START, (_, include: Node[]) => {
const pid = getRendererAudioServicePid();
const { ignoreDevices, ignoreInputMedia, ignoreVirtual, workaround } = Settings.store.audio ?? {};
const data: LinkData = {
mute: mute ?? true,
include: include ?? [],
exclude: exclude ?? [],
only_speakers: onlySpeakers,
ignore_devices: ignoreDevices,
only_default_speakers: onlyDefaultSpeakers
include,
exclude: [{ "application.process.id": pid }],
ignore_devices: ignoreDevices
};
data.exclude.push({ "application.process.id": pid });
if (ignoreInputMedia ?? true) {
data.exclude.push({ "media.class": "Stream/Input/Audio" });
}
@@ -95,31 +100,36 @@ function buildLinkData({ include, exclude }: { include?: Node[]; exclude?: Node[
data.workaround = [{ "application.process.id": pid, "media.name": "RecordStream" }];
}
return data;
}
ipcMain.handle(IpcEvents.VIRT_MIC_LIST, () => {
const audioPid = getRendererAudioServicePid();
const { granularSelect } = Settings.store.audio ?? {};
const targets = obtainVenmic()
?.list(granularSelect ? [] : ["application.name", "node.name"])
.filter(s => s["application.process.id"] !== audioPid);
return targets ? { ok: true, targets, hasPipewirePulse } : { ok: false, isGlibCxxOutdated };
});
ipcMain.handle(IpcEvents.VIRT_MIC_START, (_, include: Node[]) => {
return obtainVenmic()?.link(buildLinkData({ include }));
return obtainVenmic()?.link(data);
});
ipcMain.handle(IpcEvents.VIRT_MIC_START_SYSTEM, (_, exclude: Node[]) => {
return obtainVenmic()?.link(buildLinkData({ exclude }));
});
const pid = getRendererAudioServicePid();
ipcMain.handle(IpcEvents.VIRT_MIC_UNMUTE, () => {
return obtainVenmic()?.unmute();
const { workaround, ignoreDevices, ignoreInputMedia, ignoreVirtual, onlySpeakers, onlyDefaultSpeakers } =
Settings.store.audio ?? {};
const data: LinkData = {
include: [],
exclude: [{ "application.process.id": pid }, ...exclude],
only_speakers: onlySpeakers,
ignore_devices: ignoreDevices,
only_default_speakers: onlyDefaultSpeakers
};
if (ignoreInputMedia ?? true) {
data.exclude.push({ "media.class": "Stream/Input/Audio" });
}
if (ignoreVirtual) {
data.exclude.push({ "node.virtual": "true" });
}
if (workaround) {
data.workaround = [{ "application.process.id": pid, "media.name": "RecordStream" }];
}
return obtainVenmic()?.link(data);
});
ipcMain.handle(IpcEvents.VIRT_MIC_STOP, () => obtainVenmic()?.unlink());
-1
View File
@@ -92,7 +92,6 @@ export const VesktopNative = {
>(IpcEvents.VIRT_MIC_LIST),
start: (include: Node[]) => invoke<void>(IpcEvents.VIRT_MIC_START, include),
startSystem: (exclude: Node[]) => invoke<void>(IpcEvents.VIRT_MIC_START_SYSTEM, exclude),
unmute: () => invoke<void>(IpcEvents.VIRT_MIC_UNMUTE),
stop: () => invoke<void>(IpcEvents.VIRT_MIC_STOP)
},
clipboard: {
+51 -53
View File
@@ -121,25 +121,15 @@ addPatch({
if (isLinux) {
onceReady.then(() => {
const ownsStream = (streamKey: string) => {
return streamKey.split(":").at(-1) === UserStore.getCurrentUser().id;
};
FluxDispatcher.subscribe("STREAM_CLOSE", ({ streamKey }: { streamKey: string }) => {
if (!ownsStream(streamKey)) {
const owner = streamKey.split(":").at(-1);
if (owner !== UserStore.getCurrentUser().id) {
return;
}
VesktopNative.virtmic.stop();
});
FluxDispatcher.subscribe("STREAM_UPDATE", ({ streamKey }: { streamKey: string }) => {
if (!ownsStream(streamKey)) {
return;
}
VesktopNative.virtmic.unmute();
});
});
}
@@ -226,13 +216,6 @@ function AudioSettingsModal({
actions={[{ text: "Back", variant: "secondary", onClick: close }]}
>
<div className={cl("venmic-settings")}>
<FormSwitch
title="Initial Mute"
description="Fix an initial audio spike caused by chromium."
hideBorder
onChange={v => (Settings.audio = { ...Settings.audio, mute: v })}
value={Settings.audio?.mute ?? true}
/>
<FormSwitch
title="Microphone Workaround"
description="Work around an issue that causes the microphone to be shared instead of the correct audio. Only enable if you're experiencing this issue."
@@ -464,61 +447,78 @@ function isSpecialSource(value?: AudioSource | AudioSources): value is SpecialSo
return typeof value === "string";
}
function hasMatchingProps(value: Node, other: Node) {
return Object.keys(value).every(key => value[key] === other[key]);
}
function mapToAudioItem(node: AudioSource, granularSelect?: boolean, deviceSelect?: boolean): AudioItem[] {
if (isSpecialSource(node)) {
return [{ name: node, value: node }];
}
const rtn: AudioItem[] = [];
const mediaClass = node["media.class"];
if (mediaClass?.includes("Video") || mediaClass?.includes("Midi")) {
return [];
return rtn;
}
if (!deviceSelect && node["device.id"]) {
return [];
return rtn;
}
const preferred = ["application.name", "node.description", "node.name", "application.process.binary"] as const;
const prop = preferred.find(prop => node[prop]);
const name = node["application.name"];
if (!prop) {
return [];
if (name) {
rtn.push({ name: name, value: { "application.name": name } });
}
const name = node[prop]!;
const items: AudioItem[] = [{ name: name, value: { [prop]: name } }];
if (!granularSelect) {
return items;
return rtn;
}
let granularName = name;
const granularProps: Node = { [prop]: name };
const rawName = node["node.name"];
const append = (name: string, brackets: string) => {
const value = node[name];
if (!name) {
rtn.push({ name: rawName, value: { "node.name": rawName } });
}
if (!value) {
return;
}
const binary = node["application.process.binary"];
granularName += ` ${brackets[0]}${value}${brackets[1]}`;
granularProps[name] = value;
};
if (!name && binary) {
rtn.push({ name: binary, value: { "application.process.binary": binary } });
}
append("application.process.id", "<>");
append("application.process.binary", "()");
append("media.name", "[]");
const pid = node["application.process.id"];
items.push({ name: granularName, value: granularProps });
const first = rtn[0];
const firstValues = first.value as Node;
return items;
}
if (pid) {
rtn.push({
name: `${first.name} (${pid})`,
value: { ...firstValues, "application.process.id": pid }
});
}
function hasMatchingProps(value: Node, other: Node) {
const keys = Object.keys(value);
return keys.length === Object.keys(other).length && keys.every(key => value[key] === other[key]);
const mediaName = node["media.name"];
if (mediaName) {
rtn.push({
name: `${first.name} [${mediaName}]`,
value: { ...firstValues, "media.name": mediaName }
});
}
if (mediaClass) {
rtn.push({
name: `${first.name} [${mediaClass}]`,
value: { ...firstValues, "media.class": mediaClass }
});
}
return rtn;
}
function isItemSelected(sources?: AudioSources) {
@@ -647,10 +647,9 @@ function AudioSourcePickerLinux({
}))}
isSelected={isItemSelected(includeSources)}
select={updateItems(setIncludeSources, includeSources)}
serialize={JSON.stringify}
serialize={String}
popoutPosition="top"
closeOnSelect={false}
renderOptionLabel={o => o.label}
/>
</SimpleErrorBoundary>
</section>
@@ -668,10 +667,9 @@ function AudioSourcePickerLinux({
}))}
isSelected={isItemSelected(excludeSources)}
select={updateItems(setExcludeSources, excludeSources)}
serialize={JSON.stringify}
serialize={String}
popoutPosition="top"
closeOnSelect={false}
renderOptionLabel={o => o.label}
/>
</SimpleErrorBoundary>
</section>
-1
View File
@@ -49,7 +49,6 @@ export const enum IpcEvents {
VIRT_MIC_LIST = "VCD_VIRT_MIC_LIST",
VIRT_MIC_START = "VCD_VIRT_MIC_START",
VIRT_MIC_START_SYSTEM = "VCD_VIRT_MIC_START_ALL",
VIRT_MIC_UNMUTE = "VCD_VIRT_MIC_UNMUTE",
VIRT_MIC_STOP = "VCD_VIRT_MIC_STOP",
CLIPBOARD_COPY_IMAGE = "VCD_CLIPBOARD_COPY_IMAGE",
-1
View File
@@ -50,7 +50,6 @@ export interface Settings {
ignoreDevices?: boolean;
ignoreInputMedia?: boolean;
mute?: boolean;
onlySpeakers?: boolean;
onlyDefaultSpeakers?: boolean;
};