rustdesk / rustdesk

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.
https://rustdesk.com
GNU Affero General Public License v3.0
71.84k stars 8.43k forks source link

No sound / audio from remote PC - working after switch default audio device from analog to digital #4280

Open VadosG opened 1 year ago

VadosG commented 1 year ago

Bug Description

No sound from remote PC on local PC, even after recent fixes #3762

How to Reproduce

  1. Connect to remote machine
  2. Play sound on remote machine
  3. Can't hear the played sound

Expected Behavior

Hear audio from a remote PC

Operating system(s) on local side and remote side

Windows 10 -> Windows 7 or 10

RustDesk Version(s) on local side and remote side

1.2.0 -> 1.2.0

Screenshots

No screenshots

Additional Context

I'm willing to let you remote access to the "problem computer" so you can take a look at the problem and hopefully fix it...

21pages commented 1 year ago

See whether anydesk works

VadosG commented 1 year ago

Yes, it works.

21pages commented 1 year ago

no clue now.

21pages commented 1 year ago

https://github.com/21pages/test/releases/download/test/cpal_enumerate.exe Run this on remote pc, maybe your audio device is not wasapi.

VadosG commented 1 year ago

Supported hosts:

  [Wasapi]
Available hosts:
  [Wasapi]
host_id: WASAPI
  Default Input Device:
    Some("FrontMic (Realtek High Definition Audio)")
  Default Output Device:
    Some("Динамики (Realtek High Definition Audio)")
  Devices:
  1. "Realtek Digital Output (Realtek High Definition Audio)"
    Default output stream config:
      SupportedStreamConfig { channels: 2, sample_rate: SampleRate(48000), buffer_size: Range { min: 0, max: 4294967295 }, sample_format: F32 }
    All supported output stream configs:
      1.1. SupportedStreamConfigRange { channels: 2, min_sample_rate: SampleRate(48000), max_sample_rate: SampleRate(48000), buffer_size: Range { min: 0, max: 4294967295 }, sample_format: F32 }
  2. "Динамики (Realtek High Definition Audio)"
    Default output stream config:
      SupportedStreamConfig { channels: 2, sample_rate: SampleRate(48000), buffer_size: Range { min: 0, max: 4294967295 }, sample_format: F32 }
    All supported output stream configs:
      2.1. SupportedStreamConfigRange { channels: 2, min_sample_rate: SampleRate(48000), max_sample_rate: SampleRate(48000), buffer_size: Range { min: 0, max: 4294967295 }, sample_format: F32 }
  3. "FrontMic (Realtek High Definition Audio)"
    Default input stream config:
      SupportedStreamConfig { channels: 2, sample_rate: SampleRate(48000), buffer_size: Range { min: 0, max: 4294967295 }, sample_format: F32 }
    All supported input stream configs:
      3.1. SupportedStreamConfigRange { channels: 2, min_sample_rate: SampleRate(48000), max_sample_rate: SampleRate(48000), buffer_size: Range { min: 0, max: 4294967295 }, sample_format: F32 }
21pages commented 1 year ago

Nothing special and still no clue.

21pages commented 1 year ago

Your pc sound plays out by "Realtek Digital Output (Realtek High Definition Audio)" or "Динамики (Realtek High Definition Audio)" ?

VadosG commented 1 year ago

I've tried both already - no sound. But mostly Realtek Digital Output, sets as default.

VadosG commented 1 year ago

I have encountered this problem on at least 1 PC with Windows 10 and 2 PC with Windows 7 (both x64)

VadosG commented 1 year ago

I really need help with this issue. I can't work without sound :(

21pages commented 1 year ago

https://github.com/RustAudio/cpal/issues/677

VadosG commented 1 year ago

Maybe some special exe for tests/logging? I'm ready to run anything to find the root of the problem.

21pages commented 1 year ago

https://github.com/21pages/test/releases/download/test/cpal_record_wav.exe

This program record wave of your default audio device, run it via terminal, it will print log. This is mine.

Default input config: SupportedStreamConfig { channels: 2, sample_rate: SampleRate(48000), buffer_size: Range { min: 0, max: 4294967295 }, sample_format: F32 }
Begin recording...
new_input 1
new_input 2
run_input process_commands_and_await_signal result: false
run_input process_commands_and_await_signal result: true
process_input 1
process_input frames_available:512, result:Ok(())
timestamp ok
data_callback
...

You can change your default audio device with https://github.com/xenolightning/AudioSwitcher_v1/releases/download/1.8.0.142/AudioSwitcher.exe

VadosG commented 1 year ago

Input device: Динамики (Realtek High Definition Audio)

Default input config: SupportedStreamConfig { channels: 2, sample_rate: SampleRate(48000), buffer_size: Range { min: 0, max: 4294967295 }, sample_format: F32 }
Begin recording...
new_input 1
new_input 2
run_input process_commands_and_await_signal result: false
run_input process_commands_and_await_signal result: false
run_input process_commands_and_await_signal result: false

Recording ./recorded.wav complete!

I have achieved audio availability. If you make the default device analog audio (not digital!), turn on the stereo mixer in the recording devices, and in the RustDesk settings select audio capture from the stereo mixer - the sound works. Tested on 1 PC with Windows 10 and 1 PC with Windows 7. Don't rush to close the issue yet, I need to test on a few more PCs...

Снимок Снимок2

AnatolMV commented 1 year ago

Input device: Динамики (Realtek High Definition Audio) Default input config: SupportedStreamConfig { channels: 2, sample_rate: SampleRate(48000), buffer_size: Range { min: 0, max: 4294967295 }, sample_format: F32 } Begin recording... new_input 1 new_input 2 run_input process_commands_and_await_signal result: false run_input process_commands_and_await_signal result: false run_input process_commands_and_await_signal result: false Recording ./recorded.wav complete!

I have achieved audio availability. If you make the default device analog audio (not digital!), turn on the stereo mixer in the recording devices, and in the RustDesk settings select audio capture from the stereo mixer - the sound works. Tested on 1 PC with Windows 10 and 1 PC with Windows 7. Don't rush to close the issue yet, I need to test on a few more PCs...

Снимок Снимок2

Ou! Thanks! It's realy work!

VadosG commented 1 year ago

In general, it is very hard to say, but it seems that Realtek audio cards are affected. On one of the PCs, the sound was captured normally from Nvidia HDMI with the Realtek stereo mixer turned off (simply put, without any settings). I already thought it was because of the cyrillic name of the audio output (Динамики), whereas Nvidia has a completely latin name. I renamed Динамики to Headphones - nothing happened. It's hard to say, but the problem is clearly there and difficult to understand.

VadosG commented 1 year ago

Note: AudioSwitcher.exe did not help me, I did it without it.

win100000 commented 1 year ago

How to solve? I also am w10 remote w7 no other software has a voice

kokpk commented 1 year ago

我能听到麦克风录到的声音,但是听不到被控电脑本身播放的声音。

MKPang commented 1 month ago

I'm remoting into a HyperV VM with VBCable virtual sound device. Audio from TeamViewer and AnyDesk can be heard, but nothing from RustDesk.

Using cpal_record, I see this written out to the console:

Input device: CABLE Input (VB-Audio Virtual Cable) Default input config: SupportedStreamConfig { channels: 2, sample_rate: SampleRate(44100), buffer_size: Range { min: 0, max: 4294967295 }, sample_format: F32 } Begin recording... new_input 1 new_input 2 run_input process_commands_and_await_signal result: false run_input process_commands_and_await_signal result: false run_input process_commands_and_await_signal result: false Recording ./recorded.wav complete!

Any help to get audio working with the VBCable drivers, please?

rustdesk commented 1 month ago

@fufesou take note of above, let us check after asio.