No system sound recorded from Virtual_Audio_Input
When there is no physical sound card in pulseaudio, cpal refuse to record any sound from the Virtual_Audio_Output
pactl list sinks
Sink #0
State: IDLE
Name: audio_output
Description: Virtual_Audio_Output
Driver: module-null-sink.c
Sample Specification: s16le 2ch 44100Hz
Channel Map: front-left,front-right
Owner Module: 0
Mute: no
Volume: front-left: 65536 / 100% / 0.00 dB, front-right: 65536 / 100% / 0.00 dB
balance 0.00
Base Volume: 65536 / 100% / 0.00 dB
Monitor Source: audio_output.monitor
Latency: 990983 usec, configured 2000000 usec
Flags: DECIBEL_VOLUME LATENCY SET_FORMATS
Properties:
device.description = "Virtual_Audio_Output"
device.class = "abstract"
device.icon_name = "audio-card"
Formats:
pcm
#!/usr/bin/pulseaudio -nF
### Create virtual output device sink
load-module module-null-sink sink_name=audio_output sink_properties=device.description="Virtual_Audio_Output"
### Create virtual input device sink
load-module module-null-sink sink_name=audio_input sink_properties=device.description="Virtual_Audio_Input"
### Create a virtual audio source linked up to the virtual input device
load-module module-virtual-source source_name=microphone master=audio_input.monitor source_properties=device.description="Virtual_Microphone"
### Allow pulse audio to be accessed via TCP (from localhost only), to allow other users to access the virtual devices
load-module module-native-protocol-unix socket=/tmp/pulseaudio.socket auth-anonymous=1
### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink
Could you share a minimal code snippet and the error or unexpected behaviour you're seeing? The audio_output.monitor source should appear in input_devices() and support recording. Knowing how you're selecting the device will help narrow this down.
https://github.com/rustdesk/rustdesk/blob/2f694c0eb2b40774285447498bee6926837602ac/src/server/audio_service.rs#L161
Can you be more explicit about the sources you're seeing, error that's thrown, etc.?
I can see Virtual_Audio_Output on rustdesk's gui and it's not throwing any error. but it's simply not recording from pulseaudio.
meanwhile on exactly the same container i can record pulseaudio using other program which is not relying on cpal.
Could you try cpal's record_wav example? I'd like to isolate whether this is a cpal or RustDesk thing.
@roderickvd Could you send me a binary for x86 Linux?
That's difficult given the amount of distros; cpal doesn't have binary distribution set up. Compiling from source is easy though:
- Install Rust using https://rustup.rs
- Clone cpal using
git clone https://github.com/RustAudio/cpal - Build and run using
cargo run --example record_wav
Closing as there is not enough information to work with, and OP's account has been deleted