Firefox on Citrix VAD with Audio Redicetion result in lag and stutter in WebRTC calls
Categories
(Core :: Audio/Video: cubeb, defect)
Tracking
()
People
(Reporter: david.gittler, Unassigned)
References
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0
Steps to reproduce:
I've run into the following issue:
We are a company delivering desktops for work through Citrix Virtual Apps and Desktops, everything including the Browser, which is Firefox currenty.
Now as the web conferencing stuff is as the peak of its popularity, we are deploying some new tool for doing so, its from 3CX and its WebRTC based and I'd like to use Firefox for this.
First of all, it runs perfectly fine on a Firefox running on a local PC. The Issue only occurs inside the Citrix session, which uses virtual audio devices to capture the audio from apps and send it to the device and feed apps with microphone data from the device (its called HDX audio).
It has different settings, one called HD Audio "High Quality" which is slower but delivery nice HD Audio. And one called VoIP-optimized "Medium Quality" which uses a a separate UDP connection for very fast transport and utilizes the Speex audio codec, it not that high quality but you can each other pretty good.
Here is some more information on the Citrix audio stuff: https://docs.citrix.com/en-us/citrix-virtual-apps-desktops/multimedia/audio.html
I tested 3 browsers for this:
Firefox ESR 78.6.1 (This is our company main browser)
Firefox Nightly 87.0a1 (2021-01-27)
Chrome 88.0.4324.104.
When I enter the 3CX WebRTC Meeting with Firefox ESR and the HD Audio Codec, the sound is extremely choppy, very laggy, and you basically don't understand what the other person says and vice versa. It sounds a bit like buffer overflow or sample rate issues/missmatch to me.
When I enter the meeting with Firefox Nightly and the HD Audio Codec, I can hear the other person perfectly fine. So the audio output side of Firefox does somehow work differently here. However, the microphone input is still just as bad as on ESR, the other person doesn't understand anything.
When I open the Chrome with HD Audio Codec, it runs perfectly. No issue here, it sounds just like a local browser would, with minor latency added.
When I open the Meeting with Firefox ESR and the VoIP-based Medim Quality Audio Codec on the Citrix side, it is still laggy and choopy, however some spoken words do actually make it through. I can't really describe why, but lowering the passtrough audio quality makes things better here. Still nowhere near good.
Entering the Meeting with Firefox Nightly and the Medium Quality Codec, I hear the other person kinda nice and fast, just as well the codec can do. The Other person however hears me just like on ESR, so very choppy and bad, with the occasional word making it through.
Entering the Meeting with Chrome again with the Medium Quality Codec, I can properly talk with the other person, minus a small loss in quality that comes from that Speex codec. Runs stable and nice.
Some more information: When watching YouTube for instance, It works like a charm on all browser and all codec settings (minus the Speex codec not sounding as pretty for music). Absolutely no general issue here, it only seems to affect WebRTC.
I also did all the above with a NextCloud Talk Session instead of 3CX to reproduce it, its the same thing with all the same issues and non-issues as mentioned above. It seems to really affect WebRTC as a whole, not just that 3CX Meeting thing.
We also have other apps running on the Citrix Desktop live VLC Media player, a native Softphone App from 3CX and Microsoft Teams (without the Citrix optimization), which all run perfectly fine. As well as the Chrome for WebRTC sessions.
It can only really be reproduced with Citrix Desktops I fear, but from everything I gathered so far, it has to be some audio I/O issue in Firefox that only appears in this setting.
I can't really use the Webmeeting thing with Firefox as it stands, and resorting to local browsing is not really an option in most cases for us.
I will have to install another browser like Chrome soon because our company wants to go forward with the Webmeeting tool, however maintaining multiple browsers for hundrets of users and a bunch of languages etc. is not really in my long-term interest, so I'd kindly ask you if a fix could be provided with the next Firefox ESR in summer at the latest.
Something was clearly done to the audio stack between 78 and the current Nightly, as in the Nightly sounds great on audio output, but input is just as bad as on 78.
If there are any settings I can mess with, please let me know too, but from what I've found out in testing some things in about:config and scavenging the internet, there isn't much that affects me.
Also I found out that in about:support there is this massive lag shown on Firefox (ESR as Nightly as well) in the Media section: https://prnt.sc/xrkh0v I don't know if this is important. On local PC browsers is a few dozens ms here.
Please help us, it would be much appreciated. :)
Also let me know if I should pull up additional logging or other information. If it is really necessary, I can probably also set up a test site with Citrix VAD. However that would mean some work for me and I'd have to get in touch with a dev personally to provide access.
Actual results:
Audio very choppy, studdery and lagging when using Firefox for WebRTC on Citrix.
Expected results:
Audio should run smooth.
Comment 1•5 years ago
|
||
I have attempted in reproducing the described issue, but I got stuck at "Select installation type" for not having a license key or a configuration setup file to upload.
I will set the WebRTC component and let someone with more experience in the area have an opinion on the long description provided.
David, do you think you could provide us with a way to reproduce your issue on our systems?
| Reporter | ||
Comment 2•5 years ago
|
||
Hello Daniel,
Thank you for answering the bug! :)
I can try to setup a basic Citrix infrastructure for testing and provide you with some sort of access (VPN probably) to it, if you see that fit?
| Reporter | ||
Comment 3•5 years ago
|
||
I have set up a dedicated test site now in the cloud. Its a basic Citrix setup just enough to get a session and access the browsers like I said.
Everything I posted can be reproduced there, I tested it already. Firefox Nightly, ESR and a standard Chrome installed there.
I don't wanna post the access credentials here in the bug, but via mail i can get you set up in 5min to test everything.
Are you interested to test it Daniel? And maybe get a better understanding of it?
Comment 4•5 years ago
|
||
Hi! Firstly, I want to apologize for the long time taken to reply. The work backlog is getting quite thick with bug triage.
I have received your email and I've set everything up as described there:
- Installed OpenVPN Client and Citrix Workspace App.
- Downloaded the OpenVPN config file along with the authentification credentials.
- Pasted the config file in the correct location.
- Connected into OpenVPN GUI and connected wioth the provided credentials.
- Opened the provided webpage test link in Firefox and logged in using the provided credentials.
After this step, I have observed the <<Cannot start desktop "Desktop">> error/warning.
The same error gets displayed when clicking on the "Desktop"
...and here is where I'm stuck, again. I do now know how to properly get 2 PCs into a WebRTC meeting using this webapp in order to reproduce the poor audio quality. Can you help me further?
| Reporter | ||
Comment 5•5 years ago
|
||
Hey! Its okay, thanks for responding to the mail so quickly. I was just wondering if it was forgotten maybe.
Okay I'm sorry to hear that you were not able to connect. But I think I know what happened, I was able to reproduce this error on the test site. You probably used the autologin button, which is intended to use local credentials to authenticate on the server. This isn't configured and it also wouldn't work because it uses Active Directory Accounts. So the browser pops a simple authentication window and when you use that, its a problem.
Please go back to step 5 and open the website. Do not use the big button but the smaller one underneath: https://prnt.sc/1061h7e
The login window should look like this: https://prnt.sc/1061iql
Then it should do. :)
Comment 6•5 years ago
|
||
I have successfully reproduced using the help of the reporter, David.
I can confirm that:
-
When the user connects to a remote desktop with Citrix and then performs a webrtc call with another system, he will notice that the sound captured in the citrix remote desktop is improperly played to the other participant of the webrtc call.
-
The sound captured by the other (non-remote connected) system is properly delivered/played to the remote desktop webrtc participant when using a Nightly v88.0a1, but poorly delivered/played when using an ESR v78.8.0esr.
I imagine that this may not be necessary, but, just in case, I've regressed this change for the fix and this is my result:2021-02-25T15:34:54.288000: DEBUG : Found commit message:
Bug 1663917 - Remove special case on Windows for VOICE cubeb stream. r=kinetikThis 0 commit unties the device selection from the fact that a stream
transports voice data. Telling cubeb that the stream has voice data allows
lowering the complexity of the resampler, and lowering the impact of the
resampler on the latency.Differential Revision: https://phabricator.services.mozilla.com/D89591
2021-02-25T15:34:54.288000: DEBUG : Did not find a branch, checking all integration branches
2021-02-25T15:34:54.288000: INFO : The bisection is done.
2021-02-25T15:34:54.288000: INFO : Stopped
This bug addresses the 1st issue I've confirmed above, which is the fact that the sound captured by a webrtc call, on a Firefox in a Citrix Remote desktop is severely lagging and stuttering when it is being played on the other participant's system. Tested in Windows 10 remote desktop provided by the reporter.
If a local reproduction is necessary, please NI me so I can forward the sensitive information received from the reporter.
This bug may be more related to using a remote desktop than a WebRTC call; if the component is incorrect, please set a more appropriate one.
Comment 7•5 years ago
|
||
I can also confirm that the issue does not occur when using Chrome on the remote desktop to perform a webrtc call.
| Reporter | ||
Comment 8•5 years ago
|
||
Hello Daniel,
Thank you so much so far!
I dug a little bit more into this with the information you had provided. It does not seem to have to do with WebRTC specifiically.
I found a very recent bug that seems to have a related issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1684320
I did try the online voice recorder mentioned in the bug that records audio and then plays it back to you. https://online-voice-recorder.com/es/ and it results in the very same issue with Citrix.
Paul Adenot requested the reporter to change the value of media.cubeb.wasapi-raw from 1 to 0 and also to 2 and 3, that worked for that bug with the dolby audio driver on the laptop, however, it does not seem to make any difference for me with Citrix.
Currently testing with the newest Nightly again 87.0a1 (2021-01-27) (64-Bit)
Do you think Paul Adenot would be the right one to take a look into this and we could ask him to do that?
Comment 9•5 years ago
|
||
I am only confirming your issue and leaving it to be picked up by DEV team.
Changing its component based on the commit that was found to influence the behavior of this issue (comment 6) and also based on the last comment. Hopefully, it can be addressed faster.
Updated•5 years ago
|
Comment 10•5 years ago
|
||
Considering the bug hasn't been picked up yet, I've looked up the person suggested above and it appears he is involved with cubeb.
Paul, can you have an opinion on this issue? Do you think you could address this bug further?
Comment 11•5 years ago
•
|
||
David, can you send me the same info you sent to Daniel at padenot@mozilla.com, so I can have a look on my end and get this fixed ? I have a Windows setup here, and should be able to install whatever is needed to get to the bottom of this.
I'm not sure I understand 1. in https://bugzilla.mozilla.org/show_bug.cgi?id=1689400#c6, is this another problem (wrong audio routing?), or is it related? We can probably get it fixed as well.
| Reporter | ||
Comment 12•5 years ago
|
||
Paul, I sent you the information you need to access the test setup via mail.
I fired it up again and updated everything. You find a Firefox ESR 78.10.01 and a Firefox Nightly 91.0a1 as well as a Chrome 91 there.
Everything still behaves as described with voice calls, the Citrix part is set to the HD voice codec and issues are the same.
With the Firefox ESR, Voice Output and Input is bad.
With the Nightly, Output is fine but Input is still bad (you can hear it on the other side of the call).
On the Chrome everything is fine.
Feel free to test with that machine as you want, you have admin permissions and can install whatever tools and dev stuff you want.
Regarding the mentioning of 1. from Daniel, I think he means the distorted audio. No, its not a separate problem, its the very issue of this request. I think you can hear very well what I mean if you do a WebRTC Call to another person by using the Citrix test site for your end.
Another thing: If it would be very cool if there is any chance of the fix, if possible, making it into Firefox 91. We are using ESR at the company and my fear is that if its not 91, we might not receive the fix for another year.
Comment 13•5 years ago
|
||
I've had an initial look. This machine reports a very small minimum buffer size of 133 (which is in itself an odd number). I'll be increasing this number. There might be more at play, but I already have way better audio with a couple changes (but not perfect).
| Reporter | ||
Comment 14•5 years ago
|
||
Cool, thanks! Let me know if I can be of any further help!
Comment 15•5 years ago
|
||
This has been taken care of in 1720293. There is possibly more work to do on a cubeb level.
Updated•5 years ago
|
Updated•5 years ago
|
Description
•