Linux: virtual audio support via ALSA Loopback card#8171
Linux: virtual audio support via ALSA Loopback card#8171aramg wants to merge 2 commits intoobsproject:masterfrom
Conversation
Try to create & use an OBS specific loopback card; fallback to any available option if that fails. Fixes obsproject#3929
Moves v4l2-output and adds alsa-output, for audio support via ALSA Loopback card
1ad48e5 to
51f7877
Compare
|
I have been testing this PR. Here are some initial observations:
|
|
Thanks for the feedback. I think you are correct, the fact that video goes through a kernel loopback device does not mean audio should, too. I am open to closing this PR, or refactoring if this approach is chosen after all. https://obsproject.com/forum/threads/quick-and-easy-virtual-microphone-for-linux.158340/ |
|
I am really interested in getting the main audio output working. You can get by with the monitor output, but it bypasses the built-in mixer in OBS and there are no fades for scene transitions. Audio for the virtual camera was requested nearly three years ago: https://ideas.obsproject.com/posts/1415/obs-virtual-camera-audio I don't really understand the response from Lain about why a satisfactory implementation is not currently possible. When I asked for details of what needed to be done, I was told that "someone willing, and available, to spend time to do it". I found that completely uninformative. Your patch is the closest thing we have to an implementation. I wish we could find a way to move it forward. I can program in C, but if nobody is willing to discuss whatever is blocking a properly-working implementation, I'm stuck. Maybe you have some insights. |
|
Wanted to follow up on the clicking. After more tests I find that when I read audio directly from the Alsa loopback device there is no clicking. I get the clicking when I read the audio through PipeWire. |
|
Just posted #10495 which implements audio output through PulseAudio. Look a Lua script in the PR decription which starts and stops a virtual audio cable when the virtual camera starts and stops. |
NOTE: This PR includes the changes in #8008, which is expected to get merged first.
Description
Adds virtual audio support via the ALSA loopback module,
snd_aloop. As implemented, audio is optional and the virtualcam depends on v4l2loopback still.snd_aloopis not auto-loaded and an audio-only mode is not available.Motivation and Context
Allows sharing audio output with other programs as a virtual microphone.
How Has This Been Tested?
modprobe v4l2loopbackmodprobe snd-alooparecord -D hw:Loopback,1,0 --duration=30 -fS16_LE -c2 -r48000 /tmp/test.pcmaplay -fS16_LE -c2 -r48000 /tmp/test.pcmpacmd load-module module-alsa-source source_properties=device.description=OBS device=hw:Loopback,1,0** ideally the audio and video device names will be added to the OBS status bar, a to-do.
Types of changes
Checklist: