Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loopback on Linux #906

Open
PrimmR opened this issue Aug 16, 2024 · 1 comment
Open

Loopback on Linux #906

PrimmR opened this issue Aug 16, 2024 · 1 comment

Comments

@PrimmR
Copy link

PrimmR commented Aug 16, 2024

Would it be possible to support audio loopback on Linux devices, the same way as with Windows (or macOS #876)?

It seems that it should be possible on at least ALSA with a little work, and maybe even easier with Pipewire (#887), but beyond that I'm not sure how it could be implemented.

@wgxh-cli
Copy link

wgxh-cli commented Jan 23, 2025

Hi! I'm doing things similar to yours. I use alsa host for both input and output devices. But suddenly I found that cpal's data_callback calling frequency is a bit lower than regular one, causing audio input to have a little latency. This really worried me.

BTW I'm sure this is a cpal problem. Recently I use pure C and libalsa to write another loopback program, it works well, with almost no latency.

The biggest difference between a loopback program using alsa and one using cpal is that the buffer_size property in alsa's stream setup is explicit, that is, you have to set a proper buffer_size for your stream. But in cpal, most of its users would use default buffer size, that is BufferSize::Default, which, explained in hosts/alsa/mod.rs, will cause a latency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants