Page 1 of 3

AllShare (MirrorLink, Miracast...) not working after rooting

Posted: Fri Jan 23, 2015 3:01 pm
by majonezz
Partial success on UE55H6640SL with 2130.0 firmware.
-Recording device is necessary, otherwise SamyGO won't load at all
-AllShare (MirrorLink, Miracast...) not working after rooting. TV is showing "loading" while device is trying to connect. But it won't load.

Re: AllShare (MirrorLink, Miracast...) not working after roo

Posted: Fri Jan 23, 2015 3:27 pm
by juusso
@majonezz, can you attach /mnt/samy.log and /mnt/samygo.log here. Thanks!

Re: AllShare (MirrorLink, Miracast...) not working after roo

Posted: Fri Jan 23, 2015 7:55 pm
by majonezz
juuso, attached below. Thanks for your interest.

Re: [!!!] Rooting H series (updated 18.01.2015)

Posted: Sat Jan 24, 2015 8:24 am
by juusso
@majonezz, for your particular problem, i moved you to separate topic. Pls. download the samyext4.img.zip and replace it on your root usb. Boot TV and give both logs here. Thanks!

Re: AllShare (MirrorLink, Miracast...) not working after roo

Posted: Sat Jan 24, 2015 5:44 pm
by majonezz
Updated USBstick with new image, but it gets even worse ;) MirrorLink still not working and now i have two virtual drives:
-SamyGO Virt.
-FileCD Gadget
...but both of them contain nothing.

Re: AllShare (MirrorLink, Miracast...) not working after roo

Posted: Sat Jan 24, 2015 5:57 pm
by juusso
If you want samba share, rename 04_04_samba.init.dis -> 04_04_samba.init (now samba is disabled by default). Sure, edit credentials inside script (user and password). Unplug TV from electricity for fem minutes.
Do not care about second virt usb, this is just script and modules issue (i have already fixed it). Temporal solution. Open 02_04_vusb.init
Replace "Virt" to "Gadget" in row 68. You should have:

Code: Select all

dev="sdj" # set fallback if someting wrong with modules
for i in /sys/block/sd?/device/model ; do
if [ `cat $i | grep -c "Gadget"` -gt "0" ] ; then
No idea about allshare. Does it work if you boot TV up without rooting usb?

p.s. samyext4.img updated.

Re: AllShare (MirrorLink, Miracast...) not working after roo

Posted: Sun Jan 25, 2015 10:20 am
by majonezz
Updated dongle with new version and now samba autodiscover works fine without any trimmings. About MirrorLink - it works just fine when the dongle is not plugged to tv, so i bet it's related to rooting stuff. Is there any way to stream exlink debug output to file or stdout? It would be much easier to debug things that way. MirrorLink is using integrated wlan card to make direct connection with android device. I will try to investigate this deeper. Thanks anyway ;)

Edit: It looks like tv is using p2p0 interface to establish connection via Miracast. I grabbed some packets while the device was connecting to the tv. Maybe we could compare this dump with a dump of proper Miracast transmission?
tcpdump -i p2p0 -s 65535 -w /../../someplace_in_smb_dir/mirrorlink.pcap

Re: AllShare (MirrorLink, Miracast...) not working after roo

Posted: Sun Jan 25, 2015 6:34 pm
by sectroyer
majonezz wrote:Updated dongle with new version and now samba autodiscover works fine without any trimmings. About MirrorLink - it works just fine when the dongle is not plugged to tv, so i bet it's related to rooting stuff.
I think it's related to your DLNA server. For me it works like a charm :)
majonezz wrote: Is there any way to stream exlink debug output to file or stdout? It would be much easier to debug things that way. MirrorLink is using integrated wlan card to make direct connection with android device. I will try to investigate this deeper.
You can see ExLink output in telnet if you run this command:

Code: Select all

while true; do cat /proc/dtvlogd; done

Re: AllShare (MirrorLink, Miracast...) not working after roo

Posted: Mon Jan 26, 2015 1:02 pm
by majonezz
Hi there. Thanks for a hint - now i can see more. My investigation goes forward and i figured out that if i'm fast enough and initiate Mirrorlink connection before SamyGO has started, then Mirrorlink works just fine. And then i can sniff and debug some more :). The bug has something to do with DRM. Look at my debug output when Mirrorlink works ok:

Code: Select all

DRMBRIDGE LIB INSIDE MPEG TS HEADER= -1261009672
^^^ DRMBridge Get DRM Type ^^ !!
DRM Type Header= 89
^^^ DRMBridge Open ^^ !!
^^^ DRMBridge Set DRM Type ^^ !!
^^^ DRMBridge Get Rights ^^ !!
^^^ DRMBridge Get License ^^ !!
^^^ DRMBridge Decrypt ^^ !!
^^^ DRMBridge Get DRM Info ^^ !!
^^^DRMBridge Decrypt Data ^^ !!
^^^DRMBridge Close ^^ !!

^^^ DRMBridge Loading Symbol successful ^^ !! 

^^^ DRMBridge Loading Symbol DRMBridgeSetDRMInfo successful ^^ !! 
[alloc_preset_to_context][197] [MPEGTS_IPTV_SERVICE]
[alloc_preset_to_context][253] SERVICE TYPE [3] 
[alloc_preset_to_context][254] TOTAL DURATION [0] 
[alloc_preset_to_context][255] FILE SIZE [0] 
[alloc_preset_to_context][256] NUMBER OF STREAM [2] 

[alloc_preset_to_context][261] [0]th StreamInfo
[alloc_preset_to_context][262] CODEC TYPE [0] 
[alloc_preset_to_context][263] PID [4113]
[alloc_preset_to_context][264] STREAM_TYPE [27] 
[alloc_preset_to_context][265] PCR_PID [4096] 

[alloc_preset_to_context][261] [1]th StreamInfo
[alloc_preset_to_context][262] CODEC TYPE [1] 
[alloc_preset_to_context][263] PID [4352]
[alloc_preset_to_context][264] STREAM_TYPE [15] 
[alloc_preset_to_context][265] PCR_PID [4096] 


 Setting the mpegts preset info for stream[0]
[set_mpegts_presetinfo][5759] selected_stream_index [0] flag[0] 
Add a new programid[0]!
Add a new pid[4096] to program[0]!
[set_mpegts_presetinfo][5831] PIDs added to PMT 4113 
[set_mpegts_presetinfo][5859] Mpegts Stream info is added 

 pixfmt[0], codec_type[0],  H[720], W[1280], StreamType[27], FrameRate[30]
Add a new pid[4113] to program[0]!
[SUCCESS ] NB_STREAMS[1] PID[4113] INDEX[0] CODEC_ID[0x1c] CODEC_TYPE[0x0] 

 Setting the mpegts preset info for stream[1]
[set_mpegts_presetinfo][5759] selected_stream_index [1] flag[1] 
[set_mpegts_presetinfo][5831] PIDs added to PMT 4352 
[set_mpegts_presetinfo][5859] Mpegts Stream info is added 

 sample rate[48000], channel[2],  sample fmt[1]
Add a new pid[4352] to program[0]!
[SUCCESS ] NB_STREAMS[2] PID[4352] INDEX[1] CODEC_ID[0x15002] CODEC_TYPE[0x1] 

 Miracast Patch Working ...
!!!!!  ~~~ av_find_stream_info return filename(rtsp://192.168.49.1:7236/wfd1.0)
Input #0, wfdrtsp, from 'wfd://192.168.49.1:7236/wfd1.0|AVSYNC=NO|HDCP_PORT=9999|HDCP_VER=HDCP2.1':
  Duration: 00:00:00.00, start: 0.000000, bitrate: N/A
  Program 0 
    Stream #0.0: Video: h264, yuv420p, 1280x720, 30 fps, 30 tbr, 90k tbn, 90k tbc
    Stream #0.1: Audio: aac, 48000 Hz, 2 channels, s16
[FFMPEG][av_seek_available][7159] DURATION ERROR , SO CANNOT SEEK  
These things quoted above do not appear at all when Mirrorlink don't work. Do we messing something with DRM? Any idea?

Re: AllShare (MirrorLink, Miracast...) not working after roo

Posted: Mon Jan 26, 2015 3:07 pm
by sectroyer
majonezz wrote:Hi there. Thanks for a hint - now i can see more. My investigation goes forward and i figured out that if i'm fast enough and initiate Mirrorlink connection before SamyGO has started, then Mirrorlink works just fine. And then i can sniff and debug some more :). The bug has something to do with DRM. Look at my debug output when Mirrorlink works ok:

Code: Select all

DRMBRIDGE LIB INSIDE MPEG TS HEADER= -1261009672
^^^ DRMBridge Get DRM Type ^^ !!
DRM Type Header= 89
^^^ DRMBridge Open ^^ !!
^^^ DRMBridge Set DRM Type ^^ !!
^^^ DRMBridge Get Rights ^^ !!
^^^ DRMBridge Get License ^^ !!
^^^ DRMBridge Decrypt ^^ !!
^^^ DRMBridge Get DRM Info ^^ !!
^^^DRMBridge Decrypt Data ^^ !!
^^^DRMBridge Close ^^ !!

^^^ DRMBridge Loading Symbol successful ^^ !! 

^^^ DRMBridge Loading Symbol DRMBridgeSetDRMInfo successful ^^ !! 
[alloc_preset_to_context][197] [MPEGTS_IPTV_SERVICE]
[alloc_preset_to_context][253] SERVICE TYPE [3] 
[alloc_preset_to_context][254] TOTAL DURATION [0] 
[alloc_preset_to_context][255] FILE SIZE [0] 
[alloc_preset_to_context][256] NUMBER OF STREAM [2] 

[alloc_preset_to_context][261] [0]th StreamInfo
[alloc_preset_to_context][262] CODEC TYPE [0] 
[alloc_preset_to_context][263] PID [4113]
[alloc_preset_to_context][264] STREAM_TYPE [27] 
[alloc_preset_to_context][265] PCR_PID [4096] 

[alloc_preset_to_context][261] [1]th StreamInfo
[alloc_preset_to_context][262] CODEC TYPE [1] 
[alloc_preset_to_context][263] PID [4352]
[alloc_preset_to_context][264] STREAM_TYPE [15] 
[alloc_preset_to_context][265] PCR_PID [4096] 


 Setting the mpegts preset info for stream[0]
[set_mpegts_presetinfo][5759] selected_stream_index [0] flag[0] 
Add a new programid[0]!
Add a new pid[4096] to program[0]!
[set_mpegts_presetinfo][5831] PIDs added to PMT 4113 
[set_mpegts_presetinfo][5859] Mpegts Stream info is added 

 pixfmt[0], codec_type[0],  H[720], W[1280], StreamType[27], FrameRate[30]
Add a new pid[4113] to program[0]!
[SUCCESS ] NB_STREAMS[1] PID[4113] INDEX[0] CODEC_ID[0x1c] CODEC_TYPE[0x0] 

 Setting the mpegts preset info for stream[1]
[set_mpegts_presetinfo][5759] selected_stream_index [1] flag[1] 
[set_mpegts_presetinfo][5831] PIDs added to PMT 4352 
[set_mpegts_presetinfo][5859] Mpegts Stream info is added 

 sample rate[48000], channel[2],  sample fmt[1]
Add a new pid[4352] to program[0]!
[SUCCESS ] NB_STREAMS[2] PID[4352] INDEX[1] CODEC_ID[0x15002] CODEC_TYPE[0x1] 

 Miracast Patch Working ...
!!!!!  ~~~ av_find_stream_info return filename(rtsp://192.168.49.1:7236/wfd1.0)
Input #0, wfdrtsp, from 'wfd://192.168.49.1:7236/wfd1.0|AVSYNC=NO|HDCP_PORT=9999|HDCP_VER=HDCP2.1':
  Duration: 00:00:00.00, start: 0.000000, bitrate: N/A
  Program 0 
    Stream #0.0: Video: h264, yuv420p, 1280x720, 30 fps, 30 tbr, 90k tbn, 90k tbc
    Stream #0.1: Audio: aac, 48000 Hz, 2 channels, s16
[FFMPEG][av_seek_available][7159] DURATION ERROR , SO CANNOT SEEK  
These things quoted above do not appear at all when Mirrorlink don't work. Do we messing something with DRM? Any idea?
No idea :) we even don't use "MirrorLink":) I guess it's up to you to figure it out ;)