Oh, those dmesg might be insightfull I hope. Will actually spend some time on them tonight.
Thanks, good to hear! I recompiled with the snippet from this comment applied, but sadly that doesnāt make a difference.
I know you are streaming 4k, could you try 1080p and h264
Oh sorry, I failed to mention that, I do stream 1080p. I tried both H264 and H265, same result.
Ok, then Uām guessing Kodi does something to the VideoProcessing unit and doesnāt reset it back to previus state (like before video is plated).
And I wonder, Do you get the reversed behavior, if ml-em been runn succesfully, can Kodi play video efterwards?
Yes, Kodi plays video fine afterwards.
Read you last comment on Github about fps, thatās the if statement, to %60 if to clear/render the buffer, which seemed to be unstable in my case, if it was my old Intel sending to much garbage frames, this cleared it for me so that i didnāt get like 20 secs of flow, 4 secs of freeze and 1-10 secs flow and complete freezeā¦
ā%60 is the modula of 60 framesā to be clear. My edition to the code which i wanted to have tested for improvement or regression.
Now I got a clean enviroment again and i get as good as i can get it from shell. Now i havenāt configure a clean exit from stream yet, using ctrl+c in shell via ssh.
You black after running ml-emb, do you get it while the kodi interface or only when starting a video in kodi ??
I got a black screen direct in kodi-ui but heard navigation sounds. Changed a sys/class setting restarted medicaneter and voila kodi UI and video playingā¦
You can exit cleanly by pressing Ctrl+Alt+Shift+Q on your keyboard or Play+Back+LeftShoulder+RightShoulder on your controller.
If I understand correctly, the modulo change should fix the increasing latency? If so Iāll try it next time I have access to my Vero.
I misunderstood the code at first, but then I realized the static
in static int framecount
means that the variable will be declared once and the value kept in subsequent calls. This means that framecount
is increased every time aml_submit_decode_unit
is called. I missed that detail the first time, thinking that framecount
would always be 1
. TIL.
I only get a black screen in Moonlight if I:
- Play a video in Kodi before starting MBE.
- Uncomment the line
write_bool("/sys/class/graphics/fb1/blank", true);
insrc/platform.c
, which clears framebuffer 1. - Run
echo 1 > /sys/class/graphics/fb1/blank
before starting MBE, which effectively does the same
I never have had a black screen in Kodi.
I donāt know (yet) what āclearing the framebufferā exactly means and why there are two framebuffers fb0
and fb1
, but they seem to be affecting eachother. Setting fbX/blank
to true
/1
clearly results in a black screen at some point in ML or Kodi. I donāt have access to my Vero right now, but when I do, Iāll experiment a bit with the values of fb0/blank
and fb1/blank
and observe the effects on Kodi and Moonilght.
I tried to apply the framecount
fix you mentioned, but Iām having trouble compiling MLE. I think there might be a dependency mismatch between libamcodec-osmc
and libamcodec-dev-osmc
, after an update. When I run apt install libamcodec-dev-osmc
it fails with:
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libamcodec-dev-osmc : Depends: libamcodec-osmc (= 2.2.0-2) but 2.2.0-3 is to be installed
E: Unable to correct problems, you have held broken packages.
If I try to install (downgrade) with apt install libamcodec-osmc=2.2.0-2
it errs with E: Version '2.2.0-2' for 'libamcodec-osmc' was not found
.
Running dpkg -l | grep libam
yields:
rc libamcodec-dev-osmc 2.2.0-2 armhf libamcodec
ii libamcodec-osmc 2.2.0-3 armhf libamcodec
Currently, running cmake ../
in MLE fails with -- Performing Test HAVE_BICS_AES - Failed
.
Hereās the full CMake output: https://paste.osmc.tv/owomalesub.lua
Hereās the full CMakeError.log: https://paste.osmc.tv/olayihaxup.js
It says src.c:(.text+0xa): undefined reference to '__builtin_cpu_supports'
. So thatās probably whatās causing the error. But the weird thing is that I didnāt have this error before.
Iām not sure if the package and the cmake
error are related, at least I cannot find any relation between the two.
Ok, apparently the two problems are related. I was able to circumvent the dependency issue by running:
apt download libamcodec-dev-osmc
sudo dpkg -i --ignore-depends=libamcodec-osmc libamcodec-dev-osmc_2.2.0-2_armhf.deb
Now moonlight builds again.
Itās a bit cheating, but I can imagine the dependency requirements of both are a bit too strict and the library versions match, just the package increments donāt (if I read the versions correctly). So I expect that this will work fine. @sam_nazarko, might you be interested in this information?
I reported this problem earlier to him, but I might have blamed PEBKAC, either way it will be managed. I do belie Iāve solved it it by looking into staging repo. and found a dev 2.2.0-3, and grabbed that manually and āapt-get / dpkgā installed the downloaded package.
I suggest you try that, if you have the time.
Itās solved in the repository now.
You should keep both packages in sync.
OK, so I would like to try this out on my Vero 4k+.
Where do I start?
Hi @andoramb happy to hear about your willingness to test.
1st post give you instructions on how to get ml-emb. up, then @cavejohnson had a modified Lunaclient for kodi.
Been focus on a few other projects at the same time so this has fallen on the back burner, right now my Vero4 is headless so Iām pressed to test anything on it. But Iāll help as good as i can.
Good luck, and Iāll be monitoring here or pm if you have issues/ just want to talk about it.
Well, it works at first try ā¦ Iāve successfully compiled it and it launches somehow.
Bitrate and resolution remains to be tested, but
at the first start Iāve got no controls. need to check how to connect the kb/mouse or a gamepad
ā¦ is flawless at 1920*1080, 60fps
Iām now having a look at this launch script, not sure if this is the best place though as it has some difficulties
So I got this setup and running on my Vero V, after trying with the git repo at moonlight-stream/moonlight-embedded
and failing for 6 hours straight. Overall itās working great, 1080p 60hz, buttery smooth, feeding PS3 controller data back to the host with no noticeable lag.
Iām running this via SSH, by stopping the mediacenter
service and starting moonlight via CLI.
When running at 20Mbps, I noticed that it looks like either the host sends a key-frame, or the client ādecodes a full frameā 3 times a second, because, especially on static images, the image starts super clear, and then deteriorates, until the next āfull frameā is received (very similar to the video shown in this Github post, but 3 times a second.)
Running it at 100Mbps this is barely noticeable - so Iām not sure if this is a side effect of encoding/compression on the host or client side. Other than that I see moonlight generating the following logs on repeat at random interval - faster than once a second, but they donāt sound like a problem to me:
Waiting for IDR frame
Requesting IDR frame on behalf of DR
IDR frame request sent
Waiting for IDR frame
Requesting IDR frame on behalf of DR
IDR frame request sent
My configuration is as follows:
Host:
Windows 10 w/Sunshine
i9 9900k
Nvidia 3080Ti
32GB RAM
Client:
Vero V w/Philips 77OLED
Moonlight w/Config:
address = 192.168.10.10
width = 1920
height = 1080
fps = 60
bitrate = 100000
codec = h265
platform = aml
remote = no
Another issue I still need to verify is that if I run moonlight after playing a video on Kodi, I just get audio and black screen. I think some thing needs resetting, which once I figure it out, can just be part of the launch script. So all in all, this is good stuff and well done. If you need help testing any updates, feel free to ping me. Iāll be providing updates here with my progress on getting this integrated into Kodi.
I pushed the bitrate up to 250000, and the result was almost an exact replica of whatās on the host machine (verified using nmon
that eth0
was receiving 30MB/s of data). Tried setting fps to 120, but the latency was too high and frames were being dropped.