BelledonneCommunications / linphone-android

Linphone.org mirror for linphone-android (https://gitlab.linphone.org/BC/public/linphone-android)
https://linphone.org
GNU General Public License v3.0
1.1k stars 672 forks source link

No video on Wireguard due to "linphoneUtils.checkIfNetworkHasLowBandwidth" returning true #2151

Closed fseebach closed 1 week ago

fseebach commented 3 months ago

Hi all,

i found a Problem while using linphone through Wireguard.

I connect linphone to asterisk. Everything works fine as long as i'm connected directly on the local network.

If i connect through wireguard, video is not working. I turned Debug Logs on and found that video is disabled due to linphone thinking i'm on a low bandwith connection (I'm definitly not. 4g+ (german network))

2024-04-22 15:01:24:604 [org.linphone/linphone-android] MESSAGE [Context] Answering call Java object [org.linphone.core.CallImpl@f18e620], native pointer [0x758d149358] 2024-04-22 15:01:24:608 [org.linphone/linphone-android] WARNING [File Utils] External storage is mounted 2024-04-22 15:01:24:610 [org.linphone/linphone-android] WARNING [Context] Enabling low bandwidth mode!

I build a version where LinphoneUtils.checkIfNetworkHasLowBandwidth() returns false always and the problem is gone.

I dont know enough of Android Development to "fix" the bug.

Is there a possible Fix? Or at least the possibility to include a config option to disable the lowBandwith check entirely?

fseebach commented 3 months ago

Note: It took me several hours to find the Problem. At first i thought Networking or Asterisk was the Problem. Maybe, if there is no fix: Could you introduce a hint at the frontend that "low bandwith mode" is enabled to make troubleshooting easier

Viish commented 3 months ago

Hi @fseebach,

The [Context] Enabling low bandwidth mode only happens when the detected network type is NETWORK_TYPE_EDGE, NETWORK_TYPE_GPRS, or NETWORK_TYPE_IDEN, so I guess Wireguard (I'm not familiar with it) creates.

Anyway there is currently no way to disable easily this behavior (except rebuilding the app from source youself and installing it to your device), but we'll make sure the next release (6.0.0) either fixes it or has a way to disable that.

Cheers,

Viish commented 3 months ago

I've made some tests with Wireguard, and indeed it creates a GPRS network, hence the issue if you use it over a mobile network (over a WiFI network the issue doesn't happen as our checkIfNetworkHasLowBandwidth() only returns true for mobile networks.

Viish commented 1 week ago

checkIfNetworkHasLowBandwidth() is no longer used in 6.0.0 alpha now available in master branch.