Git Product home page Git Product logo

Comments (19)

Enitoni avatar Enitoni commented on August 20, 2024 1

You can get the commands from here:

pub fn list() -> Vec<Self> {
let mut child = Command::new("pactl")
.stdout(Stdio::piped())
.stderr(Stdio::null())
.env("LC_NUMERIC", "C")
.arg("--format=json")
.arg("list")
.arg("sinks")
.spawn()
.expect("spawns pactl");
let stdout = child.stdout.take().unwrap();
let result: Vec<Self> = serde_json::from_reader(stdout).expect("parses pactl output");
child.wait().expect("pactl exited correctly");
result
}

from pulseshitter.

Enitoni avatar Enitoni commented on August 20, 2024 1

I think I see the issue already. Your output is in french. pulseshitter cannot properly detect the events if the output is in french. There might be an environment variable you can run to get it to output in english.

from pulseshitter.

Enitoni avatar Enitoni commented on August 20, 2024 1

I'll hopefully get around to updating pulseshitter later (currently don't have my setup) so I'll commit a fix by then. In the meantime, you'll have to run the binary with that environment variable.

from pulseshitter.

Enitoni avatar Enitoni commented on August 20, 2024

Pulseshitter has a mechanism in place to kill the stream as soon as the sink input is closed, because it is actually not pulseshitter changing to the microphone, but parec (the process recording your game). This is an issue with the original pulsecord (that this project was inspired by), that pulseshitter is supposed to fix.

This is not an issue me or my friend can reproduce. Can you give me some steps to reproduce the issue? It shouldn't be happening. Also tell me what audio devices you have, and the version of pulseaudio/pipewire on your system.

The yellow process means that the sink input is closed/gone. pulseshitter displays it in yellow and allows you to still select it so that once it comes back, it can continue the stream. This is to fix issues where for example seeking in a video or muting and unmuting will cause the sink input to change.

from pulseshitter.

Emik03 avatar Emik03 commented on August 20, 2024

Works fine for me on both Firefox and Henry Stickmin Collection, I suspect you have an outdated version of pipewire, or perhaps some quirk with pulseaudio?

What distro do you use? I have never run into this issue on popOS 22.04 or Fedora 38, both on pipewire.

It should look like this when you have closed the sink input that is currently streaming.

image

from pulseshitter.

LyesSaadi avatar LyesSaadi commented on August 20, 2024

Hi ! This is weird, then...

So, I'm on Fedora Silverblue 39, so, prolly not a pipewire version issue.

❯ pipewire --version
pipewire
Compiled with libpipewire 0.3.80
Linked with libpipewire 0.3.80

Can you give me some steps to reproduce the issue?

There isn't any difficult process to reproduce it from my side, really. I just finished playing with friends henry stickmin, and the issue is triggered after a few seconds without any sound from the game, but it could also be just the game closing the sink at that time.

Maybe some quirks with Silverblue ?

from pulseshitter.

LyesSaadi avatar LyesSaadi commented on August 20, 2024

So, a bit more testing, so, it's actually properly seeing that the sink is closed. The UI just "defocuses" all entries, but pulseshitter outputs my sound.

Here are some steps I did on Firefox:

  • A video that was playing, but is paused (the sink is displayed).
  • I click the entry, it is correctly waiting for audio without outputting anything.
  • I replay the video, Firefox seems to close the old sink (?), what I selected defocuses in the UI, and pulseshitter outputs my voice.

Test 2:

  • A video which was currently playing.
  • I click the entry, it is correctly playing the video's audio.
  • When stopping the audio, no issue.
  • But when, replaying, it defocuses on the UI, and plays the microphone's sound.

With any other game I played, when I closed the game, it would begin to output my voice.

from pulseshitter.

Enitoni avatar Enitoni commented on August 20, 2024

Just to be sure, you're on the latest version of pulseshitter, correct?

If that is the case, can you run this command and tell me what you get?
pactl --version

I also checked with my friend, and they are on pipewire 0.3.83 not 0.3.80 so it's possible this is a Fedora regression. If possible, can you try upgrading to that version and see if that works?

Your steps to reproduce do not seem to work. pulseshitter stops outputting when the sink is closed as intended. So this has to be caused by a difference in your system and ours.

from pulseshitter.

Enitoni avatar Enitoni commented on August 20, 2024

This is the line that determines whether or not to clear the stream (aka, stop it). This assumes that the device stays the same, and that the stream has not moved (for example, to your microphone).

pub fn is_invalid(&self, correct_device: &Device) -> bool {

My suspicion so far is that you have a version of pipewire that does not properly send this event.

from pulseshitter.

LyesSaadi avatar LyesSaadi commented on August 20, 2024

I think I was on the latest pulseshitter, recompiled it just to be sure, and it didn't change anything.

For pactl :

❯ pactl --version
pactl 16.1
Compilé avec libpulse 16.1.0
Lié avec libpulse 16.1.0

I'll try to rebase to the testing repos of Fedora 39 for latest pipewire, as updates is currently in a freeze.

from pulseshitter.

LyesSaadi avatar LyesSaadi commented on August 20, 2024

Tested with 0.3.83, it doesn't solve the problem :/...

from pulseshitter.

Enitoni avatar Enitoni commented on August 20, 2024

That is very strange. Could you try running the parec command that pulseshitter runs and see if it detects the sink input closing properly? It should start with "Stream moved to" and is outputted to stderr. Show me the logs of what that looks like after you have reproduced the issue. Just be sure to direct stdout to /dev/null as it will spam your console with raw audio if not.

pub fn spawn_parec(device: Device, source: Source) -> Result<Child, AudioError> {
Command::new("parec")
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.env("LC_NUMERIC", "C")
.arg("--verbose")
.arg("--device")
.arg(format!("{}.monitor", device.id()))
.arg("--monitor-stream")
.arg(source.input_index().to_string())
.arg("--format=float32le")
.arg("--rate=48000")
.arg("--channels=2")
.arg("--latency=1")
.arg("--process-time=1")
.spawn()
.map_err(|_| AudioError::ParecMissing)
}

from pulseshitter.

LyesSaadi avatar LyesSaadi commented on August 20, 2024

How to get the device and source ids ?

from pulseshitter.

LyesSaadi avatar LyesSaadi commented on August 20, 2024

Okay, so tried to do it manually with Helvum:

  • Opened parec
  • Removed the automatic links to the microphone : first tip, there is no message when doing that
  • Added a link from Firefox : there's a stream moved message
  • Removed the Firefox links, either manually or automatically when the sink closes : no message
Ouverture d’un flux enregistrement avec une spĂ©cification d’échantillon « s16le 2ch 44100Hz » et un plan des canaux « front-left,front-right ».
Connexion Ă©tablie.
Création du flux réussie.
Mesures du tampon : maxlength=4194304, fragsize=352800
Utilisation de la spĂ©cification d’échantillon « s16le 2ch 44100Hz », plan des canaux « front-left,front-right ».
Connecté au périphérique alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_6__source (index : 52, suspendu : no).
Flux déplacé vers le périphérique Firefox (344, non suspendu).
^CSignal obtenu, fermeture.ce : 1788757 ”sec.        

"Flux Déplacé" means Stream moved. That message appeared only when first connecting Firefox to parec at step 3, but not when closing the connection at step 4.

from pulseshitter.

LyesSaadi avatar LyesSaadi commented on August 20, 2024

Oh that would be hilarious if that's the issue.

from pulseshitter.

Enitoni avatar Enitoni commented on August 20, 2024

Try running pulseshitter with this environment variable: LANG=C

from pulseshitter.

LyesSaadi avatar LyesSaadi commented on August 20, 2024

Yup, that was the issue 😆 ! This is hilarious.

from pulseshitter.

LyesSaadi avatar LyesSaadi commented on August 20, 2024

Seems like a pretty trivial fix for me, and I have a setup ready, will try to send a pull request your way !

from pulseshitter.

Enitoni avatar Enitoni commented on August 20, 2024

Sure, go for it!

from pulseshitter.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.