Unity-Technologies / com.unity.webrtc

WebRTC package for Unity
Other
759 stars 197 forks source link

[BUG]: PeerConnection Sample not working on Android devices #907

Closed richard-vock closed 1 year ago

richard-vock commented 1 year ago

Package version

3.0.0-pre.4

Environment

* OS: Windows 10 / Android 29/33
* Unity version: 2021.3.23f1

Android devices are a
- Snapdragon XR2 dev board running an Android SDK Version 29
- Google Pixel 6 (to rule out device-related issues) running Android SDK Version 33

Steps To Reproduce

  1. Run un-altered sample (in fact calling never works on Android for all the samples).
  2. Start a call

Current Behavior

On windows all is fine (same LAN), on Android the offer created by RTCPeerConnection.createOffer returns an almost empty SDP despite video track added previously:

v=0
o=- 7622688367073879725 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0
a=extmap-allow-mixed
a=msid-semantic: WMS 741ec402-90c3-4f84-8866-ca2fd8b88b15
m=video 9 UDP/TLS/RTP/SAVPF 127 121 125 120 123 118 39 40 117 116 122
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:+o3h
a=ice-pwd:gYjRIkqLN+5G8ImN68EizAlH
a=ice-options:trickle
a=fingerprint:sha-256 11:8D:FA:E9:2C:F4:AB:A5:CA:A7:AC:85:B0:05:95:69:CD:0A:2B:5A:91:C2:F8:41:9A:75:A3:C4:DF:EB:EA:19
a=setup:actpass
a=mid:0
a=extmap:1 urn:ietf:params:rtp-hdrext:toffset
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:3 urn:3gpp:video-orientation
a=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:5 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/color-space

The configuration is the default one using the Google STUN server, networks were a NAT'ed LAN for the dev board or a 5G wiki network for the Pixel (to rule out network specific filters/firewall issues). The NAT'ed LAN is the same one as for the Windows PC where the sample runs just fine. Changed player settings were only the switch to IL2CPP & ARM64 as well as requiring internet access permission (the latter out of desperation).

Any idea what might be the cause of this?

Expected Behavior

Successful negotiation/signalling.

Anything else?

No response

karasusan commented 1 year ago

Did you set "menu" scene as an initial scene like this? image

This is the settings in my environment. image

richard-vock commented 1 year ago

Menu is the starting scene and settings are also the same. I noticed today though that after a reboot the Pixel device works and the XR2 dev board does not, suggesting that these had different issues.

Most importantly network issues are on the table again - I will have to do more tests.

richard-vock commented 1 year ago

While it is on a (V)LAN it does seem to be an issue with my company's network/firewall configuration. In any case I got it to work and it doesn't seem to be a library issue, so I'm gonna close this.

Thanks for the help anyway!