[ 
https://issues.apache.org/jira/browse/GUACAMOLE-1201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17225022#comment-17225022
 ] 

Mike Jumper commented on GUACAMOLE-1201:
----------------------------------------

{quote}
I modified the getAudioContext() function in AudioContextFactory.js of the 
Guacamole Client to use 44100 sample rate, but I can still see these issues.
{quote}

If this were the issue, the outbound data would be entirely incorrect. The 
outbound data has already been dumped in raw form and checked against the 
sample rate accepted by the RDP server. The audio was correct and identical to 
the audio recorded within the RDP session, except that some samples from the 
dump were mysteriously missing from the in-session recording.

{quote}
So, I think that the interval for flushing the audio packet will be a problem 
in the Guacamole Server.

Based on the size of the audio packet, the audio duration follows as below:

FreeRDP: (4408/4) *1000 / 44100 = about 25 ms
Guacamole: (1764/4) *1000 / 44100 = 10 ms

But there are 2 problems in the intervals for flushing the audio packet:
 * The average interval is 1/2 of the audio duration in the FreeRDP, but it’s 
the same as the audio duration in the Guacamole Server.
 * The intervals are even in the FreeRDP, but they aren’t very even in the 
Guacamole Server.
{quote}

There is no flushing interval, but a required amount of audio data per packet. 
The amount of data within each audio packet is strictly defined by the RDP 
protocol spec for the "AUDIO_INPUT" channel. It is not arbitrarily chosen. See 
the {{FramesPerPacket}} field of the {{MSG_SNDIN_OPEN}} PDU:

https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-RDPEAI/%5bMS-RDPEAI%5d.pdf

Guacamole's RDP support for audio input works by accepting samples from the 
client until this number of audio frames have been received, at which point 
that data is flushed in the required {{MSG_SNDIN_DATA}} PDU. If you believe the 
amount of data sent is incorrect here, please describe how and your 
calculations. My tests so far have shown the amount of data sent to be exactly 
correct.

{quote}
*FreeRDP:* audin_receive_wave_data()
 *Guacamole:* guac_rdp_ai_flush_packet()

|*FreeRDP*|*Guacamole Server*|
|38|0|
|39|1|
|39|2|
|14|41|
|39|1|
|14|1|
|39|1|
|14|7|
|39|47|
|14|0|
|…|…|
{quote}

Are these values the number of milliseconds between calls?

Assuming these are relative call timings, the pattern makes sense where data is 
being received in larger chunks than allowed per flushed PDU. A single block of 
received audio data would then need to be fairly quickly split up into multiple 
chunks. Is it you thinking, then, that this behavior of sending several packets 
in a quick burst might exhaust the buffer space of the RDP server, resulting in 
lost samples?

> Audio Input issues - Recording at an incorrect rate and Having much noise
> -------------------------------------------------------------------------
>
>                 Key: GUACAMOLE-1201
>                 URL: https://issues.apache.org/jira/browse/GUACAMOLE-1201
>             Project: Guacamole
>          Issue Type: Bug
>          Components: guacamole-client, guacamole-server
>    Affects Versions: 1.0.0, 1.1.0, 1.2.0
>         Environment: FreeRDP 2.2.0, Apache Guacamole Server 1.3.0, Apache 
> Guacamole Client 1.3.0
>            Reporter: Jimmy
>            Priority: Minor
>         Attachments: adobe-audition-crash-1.png, adobe-audition-crash-2.png, 
> audacity-recorded-time.png, ms-voice-recorder.png
>
>
> I found some audio input issues when using Audacity and Adobe Audition.
> The test environment follows as below:
>  * *FreeRDP*: stable-2.0
>  * *Apache* *Guacamole* *Server*: staging/1.3.0
>  * *Apache Guacamole Client*: staging/1.3.0
>  * *Remote Server*: Windows 10 64 bit Version 2004 (OS Build 19041.572)
>  * Ubuntu 18.04 64 bit
>  * Audacity 2.3.3
>  * Adobe Audition 2020
>  
> The test case follows as below:
>  # Connect to the remote server (Windows 10, 64bit) over the Apache Guacamole 
> Client.
>  # In the remote server, run Audacity.
>  # In Audacity, click the record button and start to record the audio.
>  # In Audacity, after 10 seconds, click the stop button.
>  # In Audacity, click the play button.
>  
> In step 5, we can see the following issues:
>  # The recording time is 10.5 seconds, but the actual recorded time is about 
> 7.5 seconds. (see 'audacity-recorded-time.png' image.)
>  # The recorded audio has a lot of noise.
> FYI: When using Adobe Audition, the crash issue frequently occurs. (see 
> 'adobe-audition-crash.png' image)
>  
> The weird things follow as below:
>  * When performing the above test case by using xfreerdp (2.2.0, c72055d74), 
> we can't see the above two issues in Audacity.
>  * When performing the above test case by using mstsc (10.0.18362), we can't 
> see the above two issues in Audacity.
> Especially, when using the Apache Guacamole Server & Client, we can't see the 
> above two issues in Microsoft Voice Recorder. (see 'ms-voice-recorder.png' 
> image)
>  
> For these audio input issues, I researched the followings:
>  * 
> [http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/audio-support-in-RDP-td7508.html]
>  * https://issues.apache.org/jira/browse/GUACAMOLE-236
>  * https://issues.apache.org/jira/browse/GUACAMOLE-228
>  * [https://jira.glyptodon.com/browse/GUAC-1511]
>  
> But I didn't get any solution and workaround.
>  
> *Please let me know some solution or workaround to fix these issues.*
> Thanks.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to