I discovered a bug when trying to play a rtsp stream from a camera. Although on other devices it's working ok, specifically on this device it doesn't work. It seems this is the error:
"RTP subsession 'video/H264' failed (getsockname() error: Bad file number)"
I can reproduce the same error message with 2.5.17, 2.9.0, 3.0.13, 3.1.0, 3.1.5, 3.1.7 and 3.2.2 on an old Asus TF700t Android 7.1.2 (custom ROM KatKiss Nougatella #39 (closed)).
It used to work with 3.0.13 on the same hardware with an older version of KatKiss so some system changes must have broken it.
Building current master reveals additional messages:
11-23 12:04:29.359 2905 2905 D VLC : [61baa830/b59] libvlc input: Creating an input for 'rtsp://192.168.1.64:554' 11-23 12:04:29.363 2905 3286 D VLC : [61baa830/cd6] libvlc input: using timeshift granularity of 50 MiB 11-23 12:04:29.363 2905 3286 D VLC : [61baa830/cd6] libvlc input: using default timeshift path 11-23 12:04:29.363 2905 3286 D VLC : [61baa830/cd6] libvlc input: `rtsp://xxxxxx:xxxxxx@192.168.1.64:554' gives access `rtsp' demux `any' path `xxxxxx:xxxxxx@192.168.1.64:554' 11-23 12:04:29.363 2905 3286 D VLC : [804fc3d0/cd6] libvlc input source: creating demux: access='rtsp' demux='any' location='xxxxxx:xxxxxx@192.168.1.64:554' file='(null)' 11-23 12:04:29.363 2905 3286 D VLC : [804fc470/cd6] libvlc demux: looking for access_demux module matching "rtsp": 6 candidates 11-23 12:04:29.364 2905 3286 D VLC : [804fc470/cd6] libvlc demux: version 2016.11.28 11-23 12:04:29.364 2905 3286 W VLC : [804fc470/cd6] libvlc demux: Password in a URI is DEPRECATED 11-23 12:04:29.364 2905 2931 E VLC-std : Opening connection to 192.168.1.64, port 11-23 12:04:29.364 2905 2931 E VLC-std : 554... 11-23 12:04:29.369 2905 2905 I VLC/PlaylistManager: Media.Event.MetaChanged: 12 11-23 12:04:29.369 2905 2905 I VLC/PlaylistManager: Media.Event.MetaChanged: 12 11-23 12:04:29.378 2905 2931 E VLC-std : ...remote connection opened 11-23 12:04:29.378 2905 2931 E VLC-std : Sending request: OPTIONS rtsp://192.168.1.64:554 RTSP/1.0 11-23 12:04:29.378 2905 2931 E VLC-std : CSeq: 2 11-23 12:04:29.378 2905 2931 E VLC-std : User-Agent: LibVLC/3.0.9 (LIVE555 Streaming Media v2016.11.28) 11-23 12:04:29.378 2905 2931 E VLC-std : [...]11-23 12:04:29.396 2905 2931 E VLC-std : o=- 1574510673585279 1574510673585279 IN IP4 192.168.1.6411-23 12:04:29.396 2905 2931 E VLC-std : s=Media Presentation11-23 12:04:29.396 2905 2931 E VLC-std : e=NONE11-23 12:04:29.396 2905 2931 E VLC-std : b=AS:505011-23 12:04:29.396 2905 2931 E VLC-std : t=0 011-23 12:04:29.396 2905 2931 E VLC-std : a=control:rtsp://192.168.1.64:554/11-23 12:04:29.396 2905 2931 E VLC-std : m=video 0 RTP/AVP 9611-23 12:04:29.396 2905 2931 E VLC-std : c=IN IP6 ::11-23 12:04:29.396 2905 2931 E VLC-std : b=AS:500011-23 12:04:29.396 2905 2931 E VLC-std : a=recvonly11-23 12:04:29.396 2905 2931 E VLC-std : a=x-dimensions:1920,108011-23 12:04:29.396 2905 2931 E VLC-std : a=control:rtsp://192.168.1.64:554/trackID=111-23 12:04:29.396 2905 2931 E VLC-std : a=rtpmap:96 H264/9000011-23 12:04:29.396 2905 2931 E VLC-std : a=fmtp:96 profile-level-id=420029; packetization-mode=1; sprop-parameter-sets=******==,******==11-23 12:04:29.396 2905 2931 E VLC-std : a=Media_header:MEDIAINFO=494D4B48010300000400000100000000000000000000000081000000000000000000000000000000;11-23 12:04:29.396 2905 2931 E VLC-std : a=appversion:1.011-23 12:04:29.396 2905 2931 E VLC-std : 11-23 12:04:29.398 2905 2931 E VLC-std : Unable to determine our source address: This computer has an invalid IP address: 0.0.0.011-23 12:04:29.398 2905 3286 W VLC : [804fc470/cd6] libvlc demux: RTP subsession 'video/H264' failed (getsockname() error: Bad file descriptor)11-23 12:04:29.398 2905 3286 D VLC : [804fc470/cd6] libvlc demux: setup start: 0.000000 stop:0.00000011-23 12:04:29.398 2905 3286 E VLC : [804fc470/cd6] libvlc demux: Nothing to play for rtsp://192.168.1.64:55411-23 12:04:29.399 2905 3286 D VLC : [804fc470/cd6] libvlc demux: no access_demux modules matched11-23 12:04:29.399 2905 3286 D VLC : [6861d070/cd6] libvlc stream: creating access: rtsp://xxxxxx:xxxxxx@192.168.1.64:55411-23 12:04:29.399 2905 3286 D VLC : [6861d070/cd6] libvlc stream: looking for access module matching "rtsp": 24 candidates11-23 12:04:29.399 2905 3286 D VLC : [6861d070/cd6] libvlc stream: try to open 'rtsp://xxxxxx:xxxxxx@192.168.1.64:554'11-23 12:04:29.399 2905 3286 D VLC : [6861d070/cd6] libvlc stream: connect to host '192.168.1.64'11-23 12:04:29.399 2905 3286 D VLC : [6861d070/cd6] libvlc stream: net: connecting to 192.168.1.64 port 55411-23 12:04:29.403 2905 3286 D VLC : [6861d070/cd6] libvlc stream: connection succeeded (socket = 80)11-23 12:04:29.403 2905 3286 D VLC : [6861d070/cd6] libvlc stream: net: opening 0.0.0.0 datagram port 935811-23 12:04:29.403 2905 3286 D VLC : [6861d070/cd6] libvlc stream: net: opening 0.0.0.0 datagram port 935911-23 12:04:29.406 2905 3286 E VLC : [6861d070/cd6] libvlc stream: Failed to setup RTSP session11-23 12:04:29.406 2905 3286 D VLC : [6861d070/cd6] libvlc stream: net: connecting to 192.168.1.64 port 55411-23 12:04:29.410 2905 3286 D VLC : [6861d070/cd6] libvlc stream: connection succeeded (socket = 80)11-23 12:04:29.397 2932 2932 I RenderThread: type=1400 audit(0.0:2226): avc: denied { read } for name="max" dev=sysfs ino=3516 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:sysfs:s0 tclass=file permissive=111-23 12:04:29.397 2932 2932 I RenderThread: type=1400 audit(0.0:2227): avc: denied { open } for name="max" dev=sysfs ino=3516 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:sysfs:s0 tclass=file permissive=111-23 12:04:29.417 2905 3286 D VLC : [6861d070/cd6] libvlc stream: rtsp connected11-23 12:04:29.417 2905 3286 W VLC : [6861d070/cd6] libvlc stream: only real/helix rtsp servers supported for now11-23 12:04:29.418 2905 3286 D VLC : [6861d070/cd6] libvlc stream: no access modules matched11-23 12:04:29.397 2932 2932 I RenderThread: type=1400 audit(0.0:2228): avc: denied { getattr } for path="/sys/devices/host1x/syncpt/22/max" dev=sysfs ino=3516 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:sysfs:s0 tclass=file permissive=111-23 12:04:29.430 2905 2905 W VLC/PlaylistManager: Warning: invalid next index, aborted !11-23 12:04:29.431 2905 2905 D VLC : [6f872eb0/b59] libvlc generic: creating audio output11-23 12:04:29.432 2905 2905 D VLC : [687300b0/b59] libvlc audio output: looking for audio output module matching "android_audiotrack": 4 candidates11-23 12:04:29.432 2905 2905 D VLC : [687300b0/b59] libvlc audio output: using audio output module "android_audiotrack"11-23 12:04:29.433 2905 2905 D VLC : [6f872eb0/b59] libvlc generic: keeping audio output11-23 12:04:29.438 2905 2925 D VLC : [61baa830/b6d] libvlc input: Destroying the input for 'rtsp://192.168.1.64:554'11-23 12:04:29.438 2905 2925 D VLC : [6872c930/b6d] libvlc audio output: removing module "android_audiotrack"11-23 12:04:29.705 1416 1449 V Sensors : Changed Polling period to 400ms11-23 12:04:31.459 1416 1416 W WindowManager: Attempted to remove non-existing token: android.os.Binder@e1ccf63
Note the Unable to determine our source address: This computer has an invalid IP address: 0.0.0.0 right before the RTP subsession 'video/H264' failed (getsockname() error: Bad file descriptor)
Apparently, that's a recurring issue with the live555 library:
I've been trying to add traces into the code of GroupsockHelper.cpp to better understand what's going on, the code properly compiles and the lib is built, but my modifications are not taken into account, the resulting APK does not seem to embed the proper libs .
Also, I've noted the changelog for more recent versions of of the live555 lib mentions a lot of fixes but this one in particular grabbed my attention:
2019.05.03:
Made it possible to specify = at compile time - that you don't want to use the multicast loopback
trick for finding your system's IP address. To disable this mechanism, compile
"groupsock/GroupsockHelper.cpp" with "-DDISABLE_LOOPBACK_IP_ADDRESS_CHECK=1".