Tdesktop: Calls make everything else too quiet

Created on 25 Dec 2017  路  30Comments  路  Source: telegramdesktop/tdesktop

Steps to reproduce

  1. Do a call
  2. That's it. This happens every single time. It's not in the version notes, so I'm assuming it's not a feature? It did not happen previously.

Expected behaviour

Everything else should be at the same volume so that I can use their own volume control to adjust.

Actual behaviour

Everything besides the call becomes very quiet.

Configuration

Operating system:
Mac OS X El Capitan 10.11.6

Version of Telegram Desktop:
1.2.1

Used theme:
Default?

Logs:
No logs


Most helpful comment

I found out how to turn off this feature on macOS. Open the Telegram app, click on the burger menu in the top left corner, then on the "Calls" menu voice. In the new popup window locate the gears icon near the top right corner, click on it, then scroll to the bottom of this new "Call Settings" popup, and locate the "Mute other sounds during calls".
Uncheck it.
Make profit!
馃捀

All 30 comments

Hey, this is the same user. I accidentally used an account for a school project to make this post, but this is my personal account.

IIRC on windows system handles this, so maybe it's not a bug instead one OS feature.

Hm, for me TDesktop never caused it, but macOS native Swift app did

As far as I can tell, no such setting exists on Mac.

https://apple.stackexchange.com/questions/189552/facetime-calls-lower-system-volume
It looks such feature exists on macos, idk if it can be fixed on telegram side.

Did you look at that thread though? It's unusable due to System Integrity Protection. Mac has no proper setting or feature for this.

I said "feature exist" not setting exist :) that's why i added "idk if it can be fixed on telegram side."

for the record, my system setting on windows is set to do nothing, and it still happens. This is infuriating. using UWP app

@pressRtowin Windows is another story.

@alexisSruti try printf "p *(char*)(void(*)())AudioDeviceDuck=0xc3\nq" | PATH="/usr/bin:$PATH" lldb -n Telegram. This is a feature, not sure what can be done about it.

@grishka maybe it is possible to expose it in libtgvoip so a hidden setting can be added?

It's a system feature. I'm not sure there's anything that can be done with this except using some undocumented API. I don't really understand what that command @stek29 posted does.

@grishka that snippet attaches debugger to process, and patches CoreAudio`AudioDeviceDuck to be just a ret.

Actually, you can also call that function directly, the full signature is

OSStatus AudioDeviceDuck(AudioDeviceID inDevice, Float32 inDuckedLevel, const AudioTimeStamp* __nullable inStartTime, Float32 inRampDuration);

Of course that can only be done in the non-appstore version since it's a private API. There's a usage example in Chromium sources.

@grishka the point is to avoid that function from being called or make it do nothing.

you can also try to make a weak symbol to override it, but I'm not sure that would not be interfered by dyld shared cache inlining.

anyway, patching private library functions is definitely out of scope of normal apps -- it's apple who should provide an option to disable this questionable behavior.

@stek29 but you can counteract it too by calling it again like that file I linked does. Doesn't require messing with any function internals and hacking things and overwriting machine code which is good enough of a solution for me 馃槅

@stek29 Could this be reconsidered for inclusion as it can apparently be done clearly according to @grishka

It's very annoying
N.b.: Discord's app doesn't do this

The latest version that came out today does have a setting for this.

Just updated, works great!

My audio "Communications" thing on Windows 10 is set to "Do nothing" and every other program respects this. Telegram for the past 2 months has been lowering the volume of all my other programs. But on the volume slider, they're still showing 100% volume....that's the weird thing. Telegram is somehow lowering their volume in some other way. As soon as I end calls, volumes return to normal. It's 100% telegram's fault. Any idea how to fix this?

This issue is about Mac. Are you really sure you have it set to "do nothing"? I don't do anything specifically to lower the volume of other programs. I don't think there's even an API to control that.

My bad, it was the only result related to the issue when I tried googling, I didn't notice it was for Mac. Sorry.

I'm 100% sure it's set to "Do Nothing". I stared at during the call in confusion, even lol. No other program controls volume when I'm in calls. I've never seen anything like this before, either. The sliders all remain at 100% like I said, but the volume gets lowered by like 50% on all other programs during the call. I see no setting about this on the...settings, anywhere, so at first I assumed it was a bug but I suppose it could be a forced "feature". Started happening in January.

Not to derail the mac discussion, but as I also mistakenly commented above, I can 100% verify @Kougeru's report. Telegram is the only app on windows 10 that does not respect this setting. I have it set to do nothing, yet when I start a call, sounds will drop. If I quit the call, then go back to communication settings, change it to something else, then back to do nothing, telegram respects it for a while, but there's telling when it'll revert again.

This setting is applied by the system, not by Telegram. The only thing Telegram does is it specifies that its audio streams are for "communication".

As for Mac, we had to remove this from the app store version because apps that use private APIs make Apple unhappy. But the mac app store is useless anyway, so who cares.

Not sure how the system would specifically only allow telegram to repeatedly ignore this setting. Other voice call applications respect the do nothing setting every time.

My point is that Telegram doesn't contain any code whatsoever to read and respect this setting. I have absolutely no idea whether there is an API to lower the volume of other apps either. This is all done entirely by the system.

The latest version that came out today does have a setting for this.

for Mac? What is it called?

I found out how to turn off this feature on macOS. Open the Telegram app, click on the burger menu in the top left corner, then on the "Calls" menu voice. In the new popup window locate the gears icon near the top right corner, click on it, then scroll to the bottom of this new "Call Settings" popup, and locate the "Mute other sounds during calls".
Uncheck it.
Make profit!
馃捀

Additional info: this setting can only be found in the app that you download from Telegram's website. If you download it from the App Store there is no way to disable the volume ducking mechanism 馃槫

It had to be removed from the app store version because it uses a private API to restore the volume.

I'd suggest to never download app store versions of any Telegram clients unless you deliberately want to suffer.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TotalKrill picture TotalKrill  路  3Comments

qwitriy picture qwitriy  路  3Comments

Yanrishatum picture Yanrishatum  路  3Comments

LeonTheOriginal picture LeonTheOriginal  路  3Comments

FunctionalHacker picture FunctionalHacker  路  3Comments