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

Audio no sound (Add asio support) #3762

Open
LaiYueTing opened this issue Mar 24, 2023 · 33 comments
Open

Audio no sound (Add asio support) #3762

LaiYueTing opened this issue Mar 24, 2023 · 33 comments
Labels
💎 Bounty bug Something isn't working Fund help wanted Extra attention is needed

Comments

@LaiYueTing
Copy link
Contributor

LaiYueTing commented Mar 24, 2023

Bug Description

When I connect to remote machines, I am unable to hear the audio playback from those machines.

I have enabled the following settings in my playback device:
Default device: Astro MixAmp Pro Game
Default communication device: Astro MixAmp Pro Voice

If the default device is set to Astro MixAmp Pro Game, I will not be able to hear the audio playback from remote machines. However, if the default device is set to Astro MixAmp Pro Voice, I will be able to hear the audio playback from remote machines. Even if I use the default High Definition Audio Device, I can still hear the audio playback from remote machines.

Even if I directly configure the audio input device in RustDesk, it does not work.

It is important to note that when using other remote desktop connections (such as AnyDesk, Teamviewer, etc.), I am able to hear the audio playback from remote machines.

The only way to fix this issue is by changing the Windows playback device settings.
However, due to some reasons, I do not want to switch to other audio input devices to resolve this problem.
I am looking for a better solution to fix this issue.

How to Reproduce

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

Expected Behavior

I should hear the sound as I do with AnyDesk / Teamviewer connect remote machines.

Operating system(s) on local side and remote side

Windows 10 22H2, Windows 11 22H2

RustDesk Version(s) on local side and remote side

1.1.9, 1.2.0 Nightly Build

Screenshots

No screenshots

Additional Context

No response

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@Just4Link
Copy link

Same issue here ... i have running a docker server instance where my pc (win10 and rustdesk 1.1.9) and my smartphone (from playstore) connected.... i cant hear on the android phone no playback from audio ... in anydesk the audio works in comparison.

@rustdesk
Copy link
Owner

rustdesk commented Apr 13, 2023

Please try out the nightly build tomorrow.
https://github.com/rustdesk/rustdesk/releases/tag/nightly

controlled side is affected

@hellblue
Copy link

hellblue commented Apr 13, 2023

i tried the nightly
from win 10 22H2 to win 10 22H2 no sound
from android to win 10 i hear sound
from win 10 22H2 to win 11 22H2 i can hear sound
from win 10 22H2 to linux debian i can hear sound

@rustdesk
Copy link
Owner

it is still old build, new build is ready 3 hours later.

@Just4Link
Copy link

still no sound there :(

@21pages
Copy link
Collaborator

21pages commented Apr 14, 2023

still no sound there :(

Which device is the controlled one, android or windows?

@Just4Link
Copy link

i control with a android phone my windows 10 machine ... anydesk runs fine with sound

@Just4Link
Copy link

when i control the android phone audio wont work too ... i gave all the access control but no sound from android ... so both ways make problems

@LaiYueTing
Copy link
Contributor Author

I have been using the latest nightly build version on my end, but there haven't been any changes.

@hellblue
Copy link

inside my lan i have now sound between all devices i will try if it works also outside my lan next week on my laptop at work

@rustdesk
Copy link
Owner

rustdesk commented Apr 14, 2023

No luck then, we will wait for anothor our Windows to reproduce no sound problem. android side is in low priority.

@rustdesk rustdesk added the help wanted Extra attention is needed label Apr 14, 2023
@Avi0n
Copy link

Avi0n commented Apr 14, 2023

Using nightly on both controlled and controller, I still cannot hear macOS audio.

  • Controlled: macOS with BlackHole set as Audio Input Device
  • Controller: Windows 11

@LaiYueTing
Copy link
Contributor Author

Just to add on, the default format for the Default device - Astro MixAmp Pro Game is 6 Channel 16 Bit 48000Hz, and the default format for the Default communication device - Astro MixAmp Pro Voice is 2 Channel 16 Bit 48000Hz. I'm not sure if this is related to the issue.

Also, when other remote devices connect to my computer, they can't hear any sound.

By the way, currently my audio device is connected to my PC via USB → ASTRO MixAmp Pro TR → speakers and headphone/microphone.

@21pages
Copy link
Collaborator

21pages commented Apr 15, 2023

https://github.com/21pages/test/releases/download/test/cpal_enumerate.exe
This program enumerates audio device config, maybe we can get some clue from it.

@rustdesk
Copy link
Owner

6 Channel 16 Bit 48000Hz

image

@21pages let us do #2

@LaiYueTing
Copy link
Contributor Author

https://github.com/21pages/test/releases/download/test/cpal_enumerate.exe This program enumerates audio device config, maybe we can get some clue from it.

Supported hosts:
  [Wasapi]
Available hosts:
  [Wasapi]
host_id: WASAPI
  Default Input Device:
    Some("耳麥式麥克風 (Astro MixAmp Pro Voice)")
  Default Output Device:
    Some("耳機 (Astro MixAmp Pro Game)")
  Devices:
  1. "耳麥式耳機 (Astro MixAmp Pro Voice)"
    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. "耳機 (Astro MixAmp Pro Game)"
    Default output stream config:
      SupportedStreamConfig { channels: 6, sample_rate: SampleRate(48000), buffer_size: Range { min: 0, max: 4294967295 }, sample_format: F32 }
    All supported output stream configs:
      2.1. SupportedStreamConfigRange { channels: 6, min_sample_rate: SampleRate(48000), max_sample_rate: SampleRate(48000), buffer_size: Range { min: 0, max: 4294967295 }, sample_format: F32 }
  3. "耳麥式麥克風 (Astro MixAmp Pro Voice)"
    Default input stream config:
      SupportedStreamConfig { channels: 1, sample_rate: SampleRate(48000), buffer_size: Range { min: 0, max: 4294967295 }, sample_format: F32 }
    All supported input stream configs:
      3.1. SupportedStreamConfigRange { channels: 1, min_sample_rate: SampleRate(48000), max_sample_rate: SampleRate(48000), buffer_size: Range { min: 0, max: 4294967295 }, sample_format: F32 }
  4. "線路 (Astro MixAmp Pro Game)"
    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:
      4.1. SupportedStreamConfigRange { channels: 2, min_sample_rate: SampleRate(48000), max_sample_rate: SampleRate(48000), buffer_size: Range { min: 0, max: 4294967295 }, sample_format: F32 }

@Coldblackice
Copy link

https://github.com/21pages/test/releases/download/test/cpal_enumerate.exe This program enumerates audio device config, maybe we can get some clue from it.

No sound for me, either, and I've tried nearly every nightly version for the past couple months:

Supported hosts:
  [Wasapi]
Available hosts:
  [Wasapi]
host_id: WASAPI
  Default Input Device:
    None
  Default Output Device:
    Some("Speakers (High Definition Audio Device)")
  Devices:
  1. "Speakers (High Definition Audio Device)"
    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 }

@21pages
Copy link
Collaborator

21pages commented Apr 19, 2023

https://github.com/21pages/test/releases/download/test/rustdesk-1.2.0-x86_64_audio_no_sound_log_to_D_log_txt.exe

The program can log on the two computers, the log is in D:/log.txt, you can look at the log against this commit
I think one possible reason is encoding/decoding failure, otherwise we should hear some noise, hope someone can dig it.


if let Ok(n) = d.decode_float(&frame.data, buffer, false) {

@LaiYueTing
Copy link
Contributor Author

https://github.com/21pages/test/releases/download/test/rustdesk-1.2.0-x86_64_audio_no_sound_log_to_D_log_txt.exe

The program can log on the two computers, the log is in D:/log.txt, you can look at the log against this commit I think one possible reason is encoding/decoding failure, otherwise we should hear some noise, hope someone can dig it.

if let Ok(n) = d.decode_float(&frame.data, buffer, false) {

https://pastebin.com/iGS2hBZv
https://pastebin.com/iXYt9FZn

@21pages
Copy link
Collaborator

21pages commented Apr 19, 2023

https://github.com/21pages/test/releases/download/test/rustdesk-1.2.0-x86_64_audio_no_sound_log_to_D_log_txt.exe
The program can log on the two computers, the log is in D:/log.txt, you can look at the log against this commit I think one possible reason is encoding/decoding failure, otherwise we should hear some noise, hope someone can dig it.

if let Ok(n) = d.decode_float(&frame.data, buffer, false) {

https://pastebin.com/iGS2hBZv https://pastebin.com/iXYt9FZn

2023-04-20T03:25:51.687961200+08:00 audio_service play sample_rate_0:48000, sample_rate:48000
2023-04-20T03:25:51.700352300+08:00 audio_service play ok sample_format: F32
2023-04-20T03:25:51.703995300+08:00 build_input_stream data callback data len: 2880, lock len:2880, encode_len:2880
2023-04-20T03:25:51.705443400+08:00 send_f32 AUDIO_ZERO_COUNT 0
2023-04-20T03:25:51.706142600+08:00 send_f32 encode_vec_float err Error { function: "opus_encode_float", code: BadArg }

In this first log, the host have 6 channels(from calculation), but encoder can only be created with one or two channels.

if config.channels() > 1 { Stereo } else { Mono },

https://github.com/xiph/opus/blob/8cf872a186b96085b1bb3a547afd598354ebeb87/src/opus_encoder.c#L521

@21pages
Copy link
Collaborator

21pages commented Apr 19, 2023

https://github.com/21pages/test/releases/download/test/cpal_enumerate.exe This program enumerates audio device config, maybe we can get some clue from it.

No sound for me, either, and I've tried nearly every nightly version for the past couple months:

Supported hosts:
  [Wasapi]
Available hosts:
  [Wasapi]
host_id: WASAPI
  Default Input Device:
    None
  Default Output Device:
    Some("Speakers (High Definition Audio Device)")
  Devices:
  1. "Speakers (High Definition Audio Device)"
    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 }

How many channels are there on the other end ?

@21pages
Copy link
Collaborator

21pages commented Apr 20, 2023

https://github.com/21pages/test/releases/download/test/rustdesk-1.2.0-x86_64_audio_rechannel_log_to_D_log_txt.exe

This program will do audio rechannel on both sides, ranging from 1 to 8, replace old programs with channel numbers greater than 2, read log again this commit

@LaiYueTing
Copy link
Contributor Author

https://github.com/21pages/test/releases/download/test/rustdesk-1.2.0-x86_64_audio_rechannel_log_to_D_log_txt.exe

This program will do audio rechannel on both sides, ranging from 1 to 8, replace old programs with channel numbers greater than 2, read log again this commit

https://pastebin.com/d4xC07eb
https://pastebin.com/PnJ30wSu

I can hear the sound now!

@test2a
Copy link

test2a commented Jun 25, 2023

[2023-06-25 10:12:53.514372 +05:30] INFO [src/common.rs:172] clipboard update found on client
[2023-06-25 10:17:09.438885 +05:30] INFO [src/common.rs:172] clipboard update found on client
[2023-06-25 10:18:29.094237 +05:30] INFO [src/common.rs:172] clipboard update found on client
[2023-06-25 10:21:39.221245 +05:30] INFO [src/common.rs:172] clipboard update found on client
[2023-06-25 10:28:23.476917 +05:30] DEBUG [libs/hbb_common/src/config.rs:418] Configuration path: /home/user/.config/rustdesk/RustDesk_default.toml
[2023-06-25 10:28:23.578801 +05:30] INFO [src/ipc.rs:515] pa monitor: "alsa_output.pci-0000_03_00.6.analog-stereo.monitor"
[2023-06-25 10:28:23.585840 +05:30] ERROR [src/ipc.rs:285] Failed to start ipc_pa server at path /tmp/RustDesk/ipc_pa: Address already in use (os error 98)
[2023-06-25 10:28:23.586160 +05:30] ERROR [src/ipc.rs:555] Failed to start pa ipc server: Address already in use (os error 98)
[2023-06-25 10:28:23.701742 +05:30] ERROR [src/ipc.rs:537] Failed to send audio data:Broken pipe (os error 32)
[2023-06-25 10:28:23.740054 +05:30] INFO [src/flutter.rs:771] Session 421231539 start, render by flutter texture rgba plugin
[2023-06-25 10:28:24.067545 +05:30] INFO [src/client.rs:273] rendezvous server: rs-sg.rustdesk.com:21116
[2023-06-25 10:28:24.068758 +05:30] INFO [src/client.rs:290] #1 punch attempt with 192.168.1.6:39143, id: 421231539
[2023-06-25 10:28:30.070070 +05:30] INFO [src/client.rs:290] #2 punch attempt with 192.168.1.6:39143, id: 421231539
[2023-06-25 10:28:42.070792 +05:30] INFO [src/client.rs:290] #3 punch attempt with 192.168.1.6:39143, id: 421231539
[2023-06-25 10:29:00.072351 +05:30] INFO [src/client/io_loop.rs:829] sync transfer job status

@rustdesk i got these logs.

@Avey777
Copy link

Avey777 commented Sep 13, 2023

V1.2.2 no sound

@rustdesk
Copy link
Owner

/bounty $100

@algora-pbc
Copy link

algora-pbc bot commented Sep 21, 2023

💎 $100 bounty • RustDesk

Steps to solve:

  1. Start working: Comment /attempt #3762 with your implementation plan
  2. Submit work: Create a pull request including /claim #3762 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to rustdesk/rustdesk!

Add a bountyShare on socials

@eddiemorris
Copy link

How can we add Cpal with Asio to Rustdesk?
https://github.com/RustAudio/cpal
I get audio with the built in audio driver, but none of the Asio options.

@rustdesk
Copy link
Owner

I get audio with the built in audio driver, but none of the Asio options.

What does this mean? is Asio good or not good for you?

@eddiemorris
Copy link

eddiemorris commented Dec 24, 2023

I use Asio exclusively - my default Windows output is routed into VoiceMeeter, where I can mix multiple streams of audio, then out to speakers. I used Teamviewer to capture the Asio audio from VoiceMeeter on the Remote computer: I could control it, get its Asio stream, and hear it from my computer.
I just figured out a workaround, that has a few steps:

  • I keep the remote Windows System audio output at Digital Audio (High-Def) - no speakers connected here.
  • I keep all software, audio interface, etc running into VoiceMeeter.
  • Route the output of Voicemeeter into a DDMF virtual audio cable (which is WDC)
  • Route the virtual audio cable into the Windows input/microphone
  • In the properties of the virtual cable Advanced tab, "Listen to this device" needs to be on, and point to the default Windows output.

Tested just now from my Android 12 Go Edition $40 tablet into Windows 10 Pro machine.
RustDesk is awesome.

@rustdesk
Copy link
Owner

rustdesk commented Dec 24, 2023

Thanks @eddiemorris we will add asio support on Windows in the future.

To date 2024-02-14, we do not start yet. Please do not ask when.

@rustdesk rustdesk added the Fund label Jan 19, 2024
Repository owner deleted a comment from thehappycomputer Feb 13, 2024
@rustdesk rustdesk changed the title Audio no sound Audio no sound (Add asio support) Feb 13, 2024
@bomzj
Copy link

bomzj commented Apr 6, 2024

No sound on control pc (win 11) coming from remote win 10.

@Karbust
Copy link

Karbust commented Apr 11, 2024

Not sound between Windows 11 machines (control and remote).

I'm on version 1.2.3-2.

Used to work when controlling Windows 10 from Windows 11.

Repository owner deleted a comment from eleazar7 Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💎 Bounty bug Something isn't working Fund help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests