Re: module-remap-source, module-virtual-source, and latencies

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Thanks for the replies!

guest271314 - Huh, that's odd that you would see any audio differences. My stab in the dark guess would be some sort of PulseAudio resampling? Otherwise I would think the PCM data would be the same. I'll double check that the audio quality is as expected.

Georg - I can see how that MR could reduce latency, interesting.

I'm kind of just thinking out loud here, but the latency can get very low (say to 10ms), right? As long as I have small numbers in pa_buffer_attr, I would think that:
- My application would get a callback from PulseAudio, telling it to write something
- My application writes something
- Immediately thereafter, Chrome gets a callback to read data
- Chrome reads the data
- There isn't a risk of an underrun here by Chrome, because it will only get callbacks when data is ready (hazy guess!)

I ask this because my alternative is modifying Chromium and sending data directly to it over a custom IPC channel. But in theory that IPC channel should not be faster than PulseAudio. PulseAudio is just acting as a queue, and ultimately just a form of IPC between my application and Chrome.

In any case, I'll soon find the answer myself. Thanks!

On Sun, Apr 17, 2022 at 9:13 AM guest271314 <guest271314@xxxxxxxxx> wrote:
I am not sure about different latencies re module-remap-source and module-virtual-source. From my testing the quality of audio output when using a remapped source with getUserMedia() is inferior compared to getting the raw PCM using pactl or parec with fetch() on the browser side then using AudioWorklet or MediaStreamTrackGenerator in Chrome/Chromium to output the audio.

On Sat, Apr 16, 2022 at 9:49 PM Chase Lambert <chaselambda@xxxxxxxxx> wrote:

I'm trying to make a low latency Virtual microphone. What that means is I make a null sink, and then a module-virtual-source or module-remap-source that has a master pointing to the sink's monitor.

Then I can write to that sink, and get data to show up in this virtual microphone.

I've found that module-remap-source has a lower latency than module-virtual-source, (~400ms lower it seems), but I don't have any idea why. And more generally -- what is the difference between these two modules? I looked at their source and also the git history, but that didn't clear much up for me.

Also, is this the best way to make a low latency microphone? I have an application that I want to send data to Chrome, with as low latency as possible. Chrome operates directly with pulseaudio[0].


[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux