# Anyone here uses Teams on FreeBSD?



## quakerdoomer (Nov 19, 2022)

I (shamefully) have to use Google Chrome and sometimes (ungoogled-chromium) to get Teams working on FreeBSD. The audio drops mid-call if the amount of free RAM drops below 50%. I was suspecting the issue to be VPN, wg, pf but none of them were the true culprits.
I have 32 GB of RAM but not sure if it is ZFS or KDE but even after closing Firefox (with 200+ tabs), shutting down Guests on vbox and bhyve still the RAM does not clear up. The only way to get a stable Teams audio call is to reboot. If I go about my day and have some things running, Teams either won't pick up audio or would drop it mid call both incoming and outgoing voice and sometimes Screen sharing also ends up crashing others' Teams app :O - but that is a diff story.

I tried FFX and it has an echo issue with virtualoss.
Is anyone out there using Teams successfully on FreeBSD?


P.S. How do I get the swap to kick in at startup itself? Never seen swap being used, have one listed under fstab though. Will that help? Do I switch over to UFS2?


----------



## zirias@ (Nov 19, 2022)

Teams working perfectly fine on a really old amd64 machine with 8GB RAM that's rarely rebooted here, FreeBSD 13.1, ZFS, chromium...


----------



## quakerdoomer (Nov 19, 2022)

No... what?? HOW? Are you using a non-root user? Can you run chrome as root 



Spoiler: Embarrassing



(OP is a privacy theatrical performer *runs and hides behind a rock*)


 and maintain audio during Teams call? I run as root # chrome --no-sandbox (could that be the reason?)

Can you run a test for me? Could you just fill your RAM up, say > 75% 6GB  and see if the audio drops mid-call? I know this is a strange request. My call never drops if that's the only thing going on and nothin else is actively competing with it.


----------



## zirias@ (Nov 19, 2022)

quakerdoomer said:


> Can you run chrome as root


No. Well, maybe I _could_, but I certainly don't want to...

Edit: I wouldn't be surprised if "running as root" is exactly your problem. Why are you doing that? Furthermore, are any other layers (ALSA, some sound daemon like pulseaudio, ...) involved? If so try to have the browser use "OSS" (/dev/dsp) directly to rule that out.

My RAM is always well used, currently I get "262M Free" – this by itself certainly can't be the issue.


----------



## quakerdoomer (Nov 19, 2022)

Yes, I am using virtualoss. It uses the internal speakers but uses the mic of the earphones plugged into the headphone jack. You think virtualoss is the culprit?
Chrome does not detect the webcam when run as non-root user. Not sure why but I can live without it.


----------



## zirias@ (Nov 19, 2022)

I don't think anything right now  but I'd certainly try to rule it out. This, and, of course, running as root (don't do that, never ever, and if you explain why you do it, I'm pretty sure someone on here can suggest a better solution...).

BTW, from time to time, I *do* have a sound problem with Teams (and it adds to my scepticism about applications written in javascript). But it never drops during a call. Sometimes it just doesn't work right from joining a meeting. In this case, only a full reload of Teams in the browser helps, leaving and rejoining the same meeting doesn't.


----------



## quakerdoomer (Nov 19, 2022)

zirias@ said:


> Sometimes it just doesn't work right from joining a meeting. In this case, only a full reload of Teams in the browser helps, leaving and rejoining the same meeting doesn't.


Story of my life. Have you tried using ungoogled-chromium?
I need to get my internal mic working immediately. Any suggestions about external USB only microphones that work out of the box on FreeBSD?


----------



## cmoerz (Nov 19, 2022)

Can confirm, that Teams works fine - even with chromium. However, I'm experiencing choppy/robotic audio outbound - people start hearing my voice in robotic fashion after a random time period. Leaving the call and re-entering usually resolves that, which (at least to me) is an indicator that this might be more of a "Microsoft problem" than a "me problem"...

I'm using a USB based DAC (Burr-Brown from TI USB Audio CODEC) on another workstation, that does not show this problem. Admittedly, that's an indicator that above assessment is likely wrong, but I'm living fine with that cognitive dissonance for the moment.


----------



## zirias@ (Nov 19, 2022)

quakerdoomer What I describe certainly *isn't* a FreeBSD issue (sound input and output works just fine, I can verify that, and I even hear the "signalling" sounds of Teams, just not the actual meeting sound), but an issue with Teams. *Maybe* only in FreeBSD's chromium, I can't know that, but I doubt it....

So, looking for some USB hardware certainly wouldn't help.

edit: BTW, in our company, almost everyone else uses the electron-flavor of Teams on Windows, and still, some issues happen almost daily...


----------



## tanis (Nov 19, 2022)

cmoerz said:


> Can confirm, that Teams works fine - even with chromium.


Does that mean, that Teams also performs well in Firefox ?!


----------



## cmoerz (Nov 19, 2022)

I've seen Teams work on Firefox but audio only; screen shares and video did not work for me however.


----------



## quakerdoomer (Nov 19, 2022)

I tried FFX, but since I am using virtualoss it somehow  does not play well with it and makes people hear their own echo - my output is somehow seeping into the input. Can't speak for those who are able to use their internal mic.


----------



## zirias@ (Nov 19, 2022)

About a year ago, Teams in chromium just crashed as soon as someone started screen sharing. It is solved now (sharing myself works perfectly as well). I don't know whether a Teams or a chromium update solved it...

I would really really prefer a classic, native application (e.g. using Qt). But well ...


----------



## tanis (Nov 19, 2022)

cmoerz said:


> I've seen Teams work on Firefox but audio only; screen shares and video did not work for me however.


Chromium delivers the full experience then (audio, screen sharing, and video) ?


----------



## cmoerz (Nov 19, 2022)

At least for me, it seems to work. I've installed chromium-107.0.5304.87_1 and just used that for calling last week with the whole nine yards: audio, screen sharing, video - you name it, it works.


----------



## kpedersen (Nov 19, 2022)

cmoerz said:


> I've seen Teams work on Firefox but audio only; screen shares and video did not work for me however.


With some faffing and a user agent spoof plugin, you can get Teams to play ball with a standard browser.

https://addons.mozilla.org/en-GB/firefox/addon/uaswitcher/

For a short while a month ago, screen share (I.e *them* sharing the screen), didn't appear on mine and was a bit broken but Microsoft seemed to resolve something.


----------



## bakul (Nov 19, 2022)

quakerdoomer said:


> I have 32 GB of RAM but not sure if it is ZFS or KDE but even after closing Firefox (with 200+ tabs), shutting down Guests on vbox and bhyve still the RAM does not clear up.


Even if you quit programs that hog memory, not all of that memory will be returned to the free pool (shown as free  in top) but used for ARC. However there should be no problem grabbing memory as you need it. Try the attached program to experiment (rename to hog.c and compile. Instructions in the source code. Note that if you make it allocate a lot of space, the system will start allocating swap and slow down temporarily and may even run out of swap space!).

One suggestion for you is to try compiling the kernel with "options SCHED_4BD" instead of the default "options SCHED_ULE" as it is supposed to be better for interactive programs. See this thread: https://lists.freebsd.org/pipermail/freebsd-stable/2018-April/088678.html

Before recompiling the kernel you can also try "sysctl kern.sched.preempt_thresh=1" or some such low value and see if it helps.

There may be other sound related knobs you can try as well.


----------



## meine (Nov 19, 2022)

No, I don't use Teams on my private FreeBSD box.

Teams on my W10 boss box demonstrates why you'd better run away from it: it hijacks CPU and bandwidth what and whenever. Working from home Teams doesn't run from the W10 box because the fixed line data connection is too narrow. Three kids looking Netflix works on the same connection though. That should be conclusive.

Teams on the familiy Linux Mint box keeps starting after login although that is switched off. Sessions are like calling to Mars with bad intergalactic storms.

IMHO it is malware and you should avoid it like the plague.


----------



## free-and-bsd (Nov 20, 2022)

quakerdoomer said:


> Story of my life. Have you tried using ungoogled-chromium?
> I need to get my internal mic working immediately. Any suggestions about external USB only microphones that work out of the box on FreeBSD?


Have you consulted this page? Excellent points that help to get mic & camera working without root in FreeBSD. At least, I got my camera and mic working in Firefox (I don't use Chrome).


----------



## aragats (Nov 20, 2022)

Teams works fine here in both Chromium and Firefox. More over, both Teams and Zoom work much better in FreeBSD than in Linux here.


----------



## jmos (Nov 20, 2022)

Am I the only one? I don't want a webbrowser to get access to a microphone or camera. Such ideas sound really weird to me. Far too much is sacrificed on the altar of comfort, and a "works after all" is simply too little in this day and age.

To get Teams up & running I'm using bhyve with PCI passthrough, Win11 and the desktop application.


----------



## zirias@ (Nov 20, 2022)

jmos to begin with, the "desktop application" is mostly the same pile of javascript running in the browser as well, just packaged with electron (so it contains half a browser)...

Then, in a modern browser, you can configure which sites can access e.g. the microphone. And if you don't trust this (sure, there's a potential for bugs), you can launch multiple instances with different profiles, allowing for completely different configurations, and e.g. enable microphone only in the one instance you use to run Teams.


----------



## quakerdoomer (Nov 29, 2022)

Anyone on Firefox?
I can see unlike Chrome, my audio does not drop at all! But, microphone causes echoes as per people. Wondering if a separate device for mic would sort this and if anyone else is facing any issues for Teams under Firefox.


----------



## tanis (Dec 1, 2022)

Using Teams in Chrome now:
- audio is working
- video, I don’t know I got no cam
- screen sharing is unfortunately not working 

Any advice on the screen sharing issue would be appreciated!


----------



## quakerdoomer (Dec 2, 2022)

For me screens haring works. It might be dependent upon camera. Also, I read somewhere that once someone shares their screen, you might be able to as well, but that's not a fix. Does your laptop have a cam? If yes, then it should be easy to enable it. Let me know your obseravtions using Firefox. You might have to Disable Enhanced  Tracking Protection and of course allow third party MS cookies etc.

On Teams during calls, does your audio drop?


----------



## tanis (Dec 8, 2022)

Nope, no audio drop so far, but im still struggling with the headset issue. Anyone here got a working combo of audio usb bluetooth adapter and bluetooth headset incl. mic which is worth to share? 

Right now I’m using my Air for Teams, so moving that over to my Desktop  (FreeBSD) would allow me to have everything in one place.


----------



## twschulz (Dec 8, 2022)

I have run Teams with Chromium on FreeBSD as part of work as a researcher, with varying levels of success, since 2020. In the past year plus, it has worked pretty well. In the past, audio from others would be distorted, but that was "fixed" by changing the default port options from ALSA to sndio, which I think happened in late 2020.

My best success has been with using a USB Headset with an included headphone. That way one can just do a
`sysctl hw.snd.default_unit=USB_HEADSET_DEVICE_NUMBER`
and things just work (audio, video, screen sharing). I have stayed away from background effects (like blur) as when I first tried them video just crashed. It may be better now, but I have been lucky enough with a generic enough background that I don't care.

On a different computer I have compiled a custom Chromium from ports that used pulseaudio so that I could select separate inputs and outputs and was able to do this using a Yeti USB microphone and an external speaker, and it worked great for a time. However, sound from my end has started to get garbled the last month or so and I haven't had time to track down where the problem is (internet connection, pulseaudio, something else). It doesn't help that setup is on a computer I don't use as often anymore. I may just go back to the "stock" Chromium from ports and set up a virtual_oss (didn't know so much about that when I went the pulseaudio route).

Regardless, there will be times when Teams will just act weird and people will immediately blame you, even if everything tests fine locally. From talking to system administrators here, I understand that sometimes you get a "bad" Teams instance for a session (maybe like a noisy neighbor VM). It's a lottery for which machine you get for a Teams meeting session based on your location, which is why disconnecting and reconnecting sometimes helps. Other times, it works better the next day. The frustrating thing is that it rarely is easy to track down when things go bad. So, I don't bother tracking things down until it becomes consistent.

I have heard from other who use Linux that they prefer to use it in Chromium/Chrome instead of the beta Teams Linux client because the Chromium client gains features quicker and appears to be more stable than the Teams Linux client.

Sorry if this doesn't answer any specific questions, but it does provide an additional data point.


----------



## hselasky@ (Dec 8, 2022)

There appears to be some kind of bug in the OSS backend for Chrome. Firefox OSS audio is much better, but Microsoft doesn't support that! I've found out that building Chrome with ALSA audio backend is more stable on FreeBSD and maybe we should consider that, because putting patches upstream chrome is very difficult!


----------



## zirias@ (Dec 8, 2022)

hselasky@ said:


> putting patches upstream chrome is very difficult!


I'd call that an understatement since they outright _refused_ to take any BSD-portability patches (which lead to a port with >1000 local patches) 

Anyways, that might be the relevant hint here: I don't experience any issues with Teams in chromium (other than the sporadic reliability issues every colleague using Windows or Linux sees as well). But then, my chromium doesn't use OSS directly but SNDIO instead....


----------



## hselasky@ (Dec 8, 2022)

Yes, SNDIO works too, but having ALSA the default would be better, now that the ALSA-OSS plugin has received some needed care. Native Chromium OSS audio glitches a bit in Teams, which is annoying.



> >1000 local patches



I totally agree. I experience the same thing with the Linux kernel and webcamd in ports. The bugs reported "by the wrong people" are simply not counted or given priority. It's very strange.


----------



## twschulz (Dec 9, 2022)

Ah, I didn't know that the ALSA-OSS plugin has been updated. I may try rebuilding with ALSA to see if that is better as well.

I hope to have some time with the machine next week and hopefully I can convince someone at work to receive some calls, so I can test their experience (as I said, local recording of the call on my end is fine, but their recordings of me from their end are dreadful, and it's not just because I'm hearing my own voice  ).

I third the "would be nice" if Chromium accepted FreeBSD patches.


----------



## tanis (Dec 10, 2022)

Just for the record, last Friday I experienced several audio drops during a Teams session. First drop appeared after 45 minutes in the meeting and lasted for at least 20 secs. I used my Macbook Air with Safari latest upgrade, so it seems this is not particular related to the browser or os, looks more like there is an issue on the provider side (Microsoft). The session took almost three hours and it seemed the more time went by the worse the audio drop appeared in seconds as well as in frequency.  As I’m a vivid facetime user with my family, this experience reminds me of my skype calls before facetime had been around. So I guess there is still some skype in there somewhere.


----------



## hselasky@ (Dec 10, 2022)

One thing you can also do, is to install teams in a VM and then use rdesktop to connect the audio and display.

I think these additional options should do the trick:

`-r sound:remote /sound:sys:oss,format:1 /microphone:sys:oss,format:1`

Many years ago I used to cross-compile Windows applications using wine under FreeBSD, but the vendors do stupid things like using 32-bit installers for 64-bit software, which screws up wine. So this is a never ending ongoing battle, to simply get things to work.

I think the reason OpenSource solutions has not yet replaced the Microsoft OS, has simply got to do with royalties given to middle men and the shops that sell Microsoft products. If a product is free, no matter what percentage you demand, the result will be zero money. This also has to do with content restriction technologies, supported by the movie industry. What the Microsoft OS allows is simply not the same like a FreeBSD power user is allowed to do. And the advice you get from the Microsoft OS certified shop is not the same like you get from a FreeBSD developer. Typically when your computer breaks down, you are asked to thrash the old one and buy a new one. Everything you need is backuped in the cloud. The other day someone by accident asked me for help and I told them to tell the Microsoft OS certified shop to explicitly take the harddisk out of the computer and give it to the owner, before the computer was trashed. Two weeks later it appeared that thousands of important files were missing from the supposedly bullet proof and OS integrated cloud backup. OMG! The Microsoft way vs the FreeBSD way really got very clear to me last week! I'm sticking with FreeBSD and what supports FreeBSD. What I really wanted to say, you might want to try audio/hpsjam instead of teams. It might not be perfect, but utilizes a different audio transport technology than what teams does. I.E. lower latency which is sometimes important when trying to get the word and say something in a heated discussion. Did you ever wonder how 100 milliseconds of delay for every sentence exchange make conversations several minutes longer than they should be in the end? Be smart and put teams in the trash, save time and tell your friends about the alternatives  My rant for today!


----------



## twschulz (Dec 13, 2022)

Yes, I have run the Teams client in a Windows virtual machine in bhyve and used freerdp for conversations too. It works great for audio only conversations! Unfortunately, one can't pass through the webcam (at least not with any flags I could pass). So, it's not an option when people insist on having video (not always my choice).

Thanks for the tip on audio/hpsjam, I won't be able to get work to use that, but it's nice to try something different in non-work situations.


----------



## hselasky@ (Dec 13, 2022)

If you only need to speak 1 to 1 with someone, you can share the `pwcview` window using `x11vnc` from FreeBSD. Just specify the window ID and it only shares this one.


----------



## twschulz (Dec 13, 2022)

Heh! Yes, that could do the trick. I'll keep that in mind, thanks!


----------



## quakerdoomer (Dec 21, 2022)

I think I have almost zeroed down upon the main cause for the audio drops. In my case it was due to being oversmart. I was using a User-Agent spoofer and announcing myself as Chrome on Linux, I changed to MS Edge on Win10 and it works fine.
The javascript files Teams serves you change depending upon the platform and UA you provide. The issue is not completely solved but my calls no longer drop every 2 - 5 minutes.. now I can have a call going on for quite some time.. It does sometimes drop after like 40 minutes or so but that too is rare.
Maybe just being plain Chrome over FreeBSD and not spoof the User-Agent would help solve the issue completely.


----------



## twschulz (Dec 22, 2022)

Good to know quakerdoomer. I can add that I run the standard user-agent string. Since I only run Teams in Chrome and it "works", I haven't bothered changing things. I do mess around with the user agent string in Firefox, but normally, I just change the OS string to "FreeBSD not Linux" and things mostly work there.

I will also add that I created a virtual OSS device for the microphone and speaker combo, and it seemed to clear up the audio issues (at least people didn't complain like when I used pulse the last time). So, I might have a solution there as well, but I'll have to test more.


----------



## quakerdoomer (Dec 26, 2022)

twschulz said:


> Good to know quakerdoomer. I can add that I run the standard user-agent string. Since I only run Teams in Chrome and it "works", I haven't bothered changing things. I do mess around with the user agent string in Firefox, but normally, I just change the OS string to "FreeBSD not Linux" and things mostly work there.
> 
> I will also add that I created a virtual OSS device for the microphone and speaker combo, and it seemed to clear up the audio issues (at least people didn't complain like when I used pulse the last time). So, I might have a solution there as well, but I'll have to test more.


Even I am using virtualoss but in my case I have no option since my internal microphone is unrecognized, so I am using an external one.
I am going to go back to ungoogled-chromium (which I had dropped suspecting that to have some audio incompatibility) and test if that too works fine now. Happy Holidays!


----------

