Enitoni / pulseshitter

An overengineered workaround to Discord not supporting audio when screensharing on Linux.
Mozilla Public License 2.0
349 stars 8 forks source link

Latency and Time elapsed not working #9

Closed FQQD closed 1 year ago

FQQD commented 1 year ago

It doesn't make this nice script unusable, but still butgs me out. the Latency and Time display in the Audio section of the CLI don't seem to chnage, at all. Otherwise, this works perfectly fine. image

CPU: quad core AMD Ryzen 3 3200G with Radeon Vega Graphics (-MCP-) speed/min/max: 2862/1400/3600 MHz Kernel: 6.2.12-1-cachyos-tt x86_64 Up: 47m Mem: 3947.3/15921.6 MiB (24.8%) Storage: 2.38 TiB (11.5% used) Procs: 269 Shell: fish inxi: 3.3.26

Enitoni commented 1 year ago

Hmm, is this while the audio is playing? Due to a limitation that I cannot seem to figure out, when parec is not transmitting audio, the meter and this timer will freeze.

FQQD commented 1 year ago

yes, it's also while playing music. it doesnt change at all.

Enitoni commented 1 year ago

What audio device are you using? I'm guessing the audio device may play a part of why parec is not reporting the time.

FQQD commented 1 year ago

I'm unsure what you mean by that, but I'm using a Behringer Xenyx 302USB as my audio device. As seen in the screenshot, it seems to use the PCM2902 Chipset. (I'm unsure though)

Enitoni commented 1 year ago

Hm, okay. Can you try running the parec command in your terminal that pulseshitter is running? You can find it by using a process manager such as htop. Then copy the command, let it run for a bit (with your audio source playing audio) and then send me what it logged.

FQQD commented 1 year ago

I think my computer is just screaming at me. This was my command: parec --verbose --device alsa_output.usb-Burr-Brown_from_TI_USB_Audio_CODEC-00.analog-stereo-output.monitor --monitor-stream 168 --format=float32le --rate=48000 --channels=2 --latency=1 --process-time=1

This is what "logged":

https://user-images.githubusercontent.com/96952506/235436800-2efc7027-579f-440d-ac97-1d45dd87faec.mp4

I tried it once without and with pulseshitter running.

Enitoni commented 1 year ago

Ah, my bad. I forgot it will pipe the actual audio into your stdout. Try running it with >/dev/null at the end.

FQQD commented 1 year ago

okay, it works fine in the log. i think both the time and the latency is correct.

https://user-images.githubusercontent.com/96952506/235949748-dcde4f4e-483a-45b5-980c-934eddafff42.mp4

Enitoni commented 1 year ago

Okay yeah, so my suspicions were right. You have a locale on your system that changes the delimiter in Time to a comma. But pulseshitter expects that to be a period. I think this is similar to https://github.com/Enitoni/pulseshitter/issues/7

Could you try setting the environment variable (mentioned in that issue) and seeing if that changes the delimiter to a period? You could even try running pulseshitter with that environment variable like so LC_NUMERIC=C ./pulseshitter and see if that makes it display the time correctly.

FQQD commented 1 year ago

image ah. it works. is it possible for you to make it compatible with other locales or something? otherwise, i'll just run with the fix.

Enitoni commented 1 year ago

This is an easy fix, it's the same fix as https://github.com/Enitoni/pulseshitter/issues/7 but applied to the parec process instead.

Enitoni commented 1 year ago

Fixed by https://github.com/Enitoni/pulseshitter/commit/06670f9beee363f052cc5011413fb92b7ca82dc4