Page 11 of 11

Re: UMSP Plugin Development

PostPosted: Mon Feb 23, 2015 12:32 am
by avkiev
mad_ady wrote:many of my plugins have folder images stored on picasa web and have https links for res.

Images - yes, no problem.
But Video - doesn't support https.

Just try this link:
Code: Select all
https://d2pq0u4uni88oo.cloudfront.net/projects/1046910/video-467616-h264_high.mp4

Can you create VideoItem with this url ?

Re: UMSP Plugin Development

PostPosted: Mon Feb 23, 2015 1:34 am
by mad_ady
Ok, I've tried and it isn't playing...

Here's the debug output of MediaLogic:
Code: Select all
[INFO:MediaPlayer:mp_open:306]enter 1424683464
[INFO:MediaPlayer:MA_ParseMetaData:268]metaData->fullUrl https://d2pq0u4uni88oo.cloudfront.net/projects/1046910/video-467616-h264_high.mp4
./src/httpAPI/url.c,url_init,425 server ip:255.255.255.255, local ip:192.168.1.7, netmask:255.255.255.0
server_type = 0x0 private_data =
[INFO:MediaPlayer:MA_ParseMetaData:281]the service type is 1
[INFO:MediaPlayer:MA_ParseMetaData:330]MIME_TYPE from meta-dat is *
File:./src/dlna/dlna.c, Line:385: type == DLNA_FLAGS----
#####tempstr=00000000001000000000000000000000
File:./src/dlna/dlna.c, Line:377: type == DLNA_PS------
[INFO:MediaPlayer:MA_ParseMetaData:354]DLNA_0P= 1,DLNA_CI=0,DLNA_PS=0
[INFO:MediaPlayer:MA_ParseMetaData:421]metaData->fileSize=1
[INFO:MediaPlayer:MA_ParseMetaData:443]duration=0,width=0,height=0
Get parseRet = 1 protection_type = 0
[INFO:MediaPlayer:MA_HttpPrepareProc:925]MA_HttpPrepareProc playerContext->status=0
https: Success
(MPAuxiliary.c , 937 )server_type = 0
[ERR:MediaPlayer:MA_HttpPrepareProc:944]get server property failed
[ERR:MediaPlayer:mp_open:424] errNo=-8
SMD_SendMallocCommand enter
SMD_SendCommand 8
SMD_GetCommand 4 4
get code = 1 num = 2
SMD_SendCommand 8
SMD_GetCommand 4 7
[ERR:MediaPlayer:mp_open:578]Leave MP_CreateInstance with error
SMD_SendMallocCommand enter
SMD_SendCommand 8
SMD_GetCommand 4 4
get code = 1 num = 2
SMD_SendCommand 8
SMD_GetCommand 4 7
player->audiotrack.totaltrack = 0
player->audiotrack.curtrack = 0
playlist_set_error_map[387], rnd status: 4
playlist_set_error_map[388], The 0th item is bad. mark it
media_play_basic_timer[577], state: 1, error_code:10
Active button: [OK]



It probably displays that the file can't be played.
As you can see, you can pass a https url through UMSP, but the question is - why can't it be played...
The debugging messages give the following clues:
* https: Success -> does this mean that HTTPS handshake was successful?
*[ERR:MediaPlayer:MA_HttpPrepareProc:944]get server property failed
[ERR:MediaPlayer:mp_open:424] errNo=-8

These messages probably cause the failure... What property did it want to get? I don't know...

I tried to download the file to see if it plays offline:
Code: Select all
# wget "https://d2pq0u4uni88oo.cloudfront.net/projects/1046910/video-467616-h264
_high.mp4" -O testhttps.mp4
--2015-02-23 11:29:34--  https://d2pq0u4uni88oo.cloudfront.net/projects/1046910/video-467616-h264_high.mp4
Resolving d2pq0u4uni88oo.cloudfront.net... 54.192.47.35, 54.230.46.49, 54.230.46.38, ...
Connecting to d2pq0u4uni88oo.cloudfront.net|54.192.47.35|:443... connected.
ERROR: cannot verify d2pq0u4uni88oo.cloudfront.net's certificate, issued by `/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=Terms of use at https://www.verisign.com/rpa (c)10/CN=VeriSign Class 3 Secure Server CA - G3':
  Unable to locally verify the issuer's authority.
To connect to d2pq0u4uni88oo.cloudfront.net insecurely, use `--no-check-certificate'.


... and it looks it's a certificate issue! The wdtv doesn't know who verisign is...

I thought I had fixed the certificates for curl, but even curl does not validate this certificate... I will try to debug the problem more, but I'm not sure I can convince the playback engine to load my certificates...
I'll let you know if I find something...

Re: UMSP Plugin Development

PostPosted: Mon Feb 23, 2015 1:44 am
by avkiev
Thanks.
Looking forward to your investigations

Re: UMSP Plugin Development

PostPosted: Mon Feb 23, 2015 2:23 am
by mad_ady
It doesn't look good. I ran a strace on MediaLogic while trying to play that video in order to capture open calls for outside files (such as certificates), but there are none:

Code: Select all
_newselect(10, [4 8 9], NULL, NULL, {0, 500000}) = 1 (in [9], left {0, 380000})
read(9, "0\20\0\0\0", 5)                = 5
read(9, "\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16) = 16
write(1, "\33[1;43m CODE_EXTENDED_COMMAND_AN"..., 66) = 66
write(1, "InfoParseExtendedCommandServerTy"..., 91) = 91
write(1, "get server_type = 0x0 private_da"..., 42) = 42
_newselect(10, [4 8 9], NULL, NULL, {0, 500000}) = 1 (in [8], left {0, 250000})
read(8, "aZ\0\0\0", 5)                  = 5
read(8, "\0\0\0\0https://d2pq0u4uni88oo.cloud"..., 90) = 86
read(8, 0x719f0e, 4)                    = -1 EAGAIN (Resource temporarily unavailable)
nanosleep({0, 100000000}, NULL)         = 0
read(8, "\315\0\0\0", 4)                = 4
write(1, "SMD_SendMallocCommand enter\n", 28) = 28
_newselect(8, NULL, [7], NULL, {0, 500000}) = 1 (out [7], left {0, 500000})
write(7, "\4\0\0\0\1\0\0\0", 8)         = 8
write(1, "SMD_SendCommand 8\n", 18)     = 18
_newselect(8, [7], NULL, NULL, {0, 500000}) = 1 (in [7], left {0, 500000})
read(7, "\4\0\0\0", 4)                  = 4
read(7, "\1\0\0\0", 4)                  = 4
write(1, "SMD_GetCommand 4 7\n", 19)    = 19
read(8, "1\0https://d2pq0u4uni88oo.cloudfr"..., 205) = 205
_newselect(9, NULL, [8], NULL, {0, 100000}) = 1 (out [8], left {0, 100000})
write(8, "GZ\0\0\0\0\0\0\0https://d2pq0u4uni88oo."..., 91) = 91
_newselect(9, NULL, [8], NULL, {0, 100000}) = 1 (out [8], left {0, 100000})
write(8, "X\0\0\0001\0https://d2pq0u4uni88oo.clo"..., 88) = 88
_newselect(9, NULL, [8], NULL, {0, 100000}) = 1 (out [8], left {0, 100000})
write(8, "\0\0\0\0", 4)                 = 4
_newselect(10, NULL, [9], NULL, {0, 100000}) = 1 (out [9], left {0, 100000})
write(9, "GZ\0\0\0\0\0\0\0https://d2pq0u4uni88oo."..., 91) = 91
_newselect(10, NULL, [9], NULL, {0, 100000}) = 1 (out [9], left {0, 100000})
write(9, "X\0\0\0001\0https://d2pq0u4uni88oo.clo"..., 88) = 88
_newselect(10, NULL, [9], NULL, {0, 100000}) = 1 (out [9], left {0, 100000})
write(9, "\0\0\0\0", 4)                 = 4
_newselect(9, NULL, [8], NULL, {0, 100000}) = 1 (out [8], left {0, 100000})
write(8, "A\4\0\0\0\0\0\0\0", 9)        = 9
_newselect(10, NULL, [9], NULL, {0, 100000}) = 1 (out [9], left {0, 100000})
write(9, "A\4\0\0\0\0\0\0\0", 9)        = 9
_newselect(9, NULL, [8], NULL, {0, 100000}) = 1 (out [8], left {0, 100000})
write(8, "Ev\0\0\0001\0-1\0\0000\0Test 3 generic vide"..., 123) = 123
_newselect(10, NULL, [9], NULL, {0, 100000}) = 1 (out [9], left {0, 100000})
write(9, "Ev\0\0\0001\0-1\0\0000\0Test 3 generic vide"..., 123) = 123
_newselect(10, [4 8 9], NULL, NULL, {0, 500000}) = 1 (in [9], left {0, 360000})
read(9, "i\0\0\0\0", 5)                 = 5
_newselect(9, NULL, [8], NULL, {0, 100000}) = 1 (out [8], left {0, 100000})
write(8, "I\3\0\0\0\0;\0", 8)           = 8
_newselect(10, NULL, [9], NULL, {0, 100000}) = 1 (out [9], left {0, 100000})
write(9, "I\3\0\0\0\0;\0", 8)           = 8
_newselect(10, [4 8 9], NULL, NULL, {0, 500000}) = 1 (in [9], left {0, 500000})
read(9, "i\0\0\0\0", 5)                 = 5
_newselect(9, NULL, [8], NULL, {0, 100000}) = 1 (out [8], left {0, 100000})
write(8, "I\3\0\0\0\0;\0", 8)           = 8
_newselect(10, NULL, [9], NULL, {0, 100000}) = 1 (out [9], left {0, 100000})
write(9, "I\3\0\0\0\0;\0", 8)           = 8
_newselect(10, [4 8 9], NULL, NULL, {0, 500000}) = 1 (in [8], left {0, 460000})
read(8, "c\4\0\0\0", 5)                 = 5
read(8, "\1\0\0\0", 4)                  = 4
write(1, "CODE_PLAY :logic/RenderLogic.c :"..., 46) = 46
_newselect(9, NULL, [8], NULL, {0, 100000}) = 1 (out [8], left {0, 100000})
write(8, "A\4\0\0\0\3\0\0\0", 9)        = 9
_newselect(10, NULL, [9], NULL, {0, 100000}) = 1 (out [9], left {0, 100000})
write(9, "A\4\0\0\0\3\0\0\0", 9)        = 9
_newselect(9, NULL, [8], NULL, {0, 100000}) = 1 (out [8], left {0, 100000})
write(8, "B\4\0\0\0\0\0\0\0", 9)        = 9
_newselect(10, NULL, [9], NULL, {0, 100000}) = 1 (out [9], left {0, 100000})
write(9, "B\4\0\0\0\0\0\0\0", 9)        = 9
futex(0x7181fc, FUTEX_WAKE_PRIVATE, 1)  = 1
_newselect(10, [4 8 9], NULL, NULL, {0, 500000}) = 1 (in [9], left {0, 330000})
read(9, "i\0\0\0\0", 5)                 = 5
_newselect(9, NULL, [8], NULL, {0, 100000}) = 1 (out [8], left {0, 100000})
write(8, "I\3\0\0\0\0;\0", 8)           = 8
_newselect(10, NULL, [9], NULL, {0, 100000}) = 1 (out [9], left {0, 100000})
write(9, "I\3\0\0\0\0;\0", 8)           = 8


It looks like the MediaLogic (like DMAOSD) contains most of the data it needs and does not try to read it from other files. Probably this is why the original firmware only has the certificates for Netflix and nothing else... So, I may not be able to convince it to accept that certificate.

But, it might not be a certificate issue. You could try to do a packet capture, but in a way to allow you to view inside the encrypted session (e.g. with your own server) and see if the WDTV goes beyond certificate exchange and starts to make HEAD/GET requests... However, it looks impossible to fix...

Re: UMSP Plugin Development

PostPosted: Wed Feb 25, 2015 6:23 am
by avkiev
mad_ady wrote:Here's the debug output of MediaLogic

How did you receive this log ?

Re: UMSP Plugin Development

PostPosted: Wed Feb 25, 2015 6:31 am
by mad_ady
http://wiki.wdlxtv.com/UMSP_plugin_development#Troubleshooting.

And for strace, just add "strace" before the command...

Re: UMSP Plugin Development

PostPosted: Wed Feb 25, 2015 11:58 am
by avkiev
Thanks again.

I've solved https-issue:
Code: Select all
$url = str_replace("https://", "http://", $url);

Because server accept http:// as well as https://
Dirty hack :D

Re: UMSP Plugin Development

PostPosted: Wed Feb 25, 2015 11:00 pm
by mad_ady
:lol: Good hack!