Need alpha-testers for moonlight on Vero 4/5

Moonlight-embedded has come far enough to start testing in wider environments. Depending on streaming servers capability we have seen odd results. Before majority of the focus is set on the client side, it would be good to have a list of issues to work out.

ex.:

  1. 60hz 4k, with Nvidia-gpu server, just needs 1 patch and works almost flawlessly.
  2. 60hz 720p, with Intel gen4 iGPU server, needs multiple patches and “works”.

Need to test multiple server encoders hardware/software. Intel/AMD/Nvidia and h264/h265…

If we get to a point where we can identify most problem, we should be able to code solutions for the AML bits. How it works for OSMC on Pi i can’t speak of yet, due to lack of hardware. But I’m not a stranger to folks reporting issues here as well, but no promises made.

Plan is to make a OSMC-launch script and utilize Luna launcher for the gui. But before we have a clear eye on the possible issues depending on server-encoding, it might be a fools errand to make a launcher work when the client isn’t even stable on 25% of cases.

In order to keep the OSMC-Vero part isolated to the main tree, I’ve forked moonlight-embedded and renamed it.

Install instructions:
When ever you see [some text], it’s a description of what is supposed to be there with out the [ ]

sudo apt-get update
sudo apt-get install git libopus0 libexpat1 libasound2 libudev1 libavahi-client3 \ 
libcurl4 libevdev2 libssl-dev libopus-dev libasound2-dev libudev-dev \
libavahi-client-dev libcurl4-openssl-dev  libevdev-dev libexpat1-dev libpulse-dev \
uuid-dev cmake make gcc g++

Depending on your client hardware change the userland:

  • vero3-userland-dev-osmc for Vero4(k)
  • vero5-userland-dev-osmc for VeroV

sudo apt-get install [correct userland-dev for you] libamcodec-dev-osmc

git clone https://github.com/zjoasan/moonlight-embedded.git
cd moonlight-embedded
git submodule update --init --recursive
mkdir build
cd build/
cmake ../
make -j4

Next step would be to install, but there are some path dependencies that isn’t working for OSMC right now, this might change.

------[instead of make install ...]------
mkdir /home/osmc/moonlight
cp moonlight /home/osmc/moonlight/
cp libmoonlight-aml.so /home/osmc/moonlight/
cp ../moonlight.conf /home/osmc/moonlight/
cp ../third_party/SDL_GameControllerDB/gamecontrollerdb.txt /home/osmc/moonlight/
------------------------------------------------

This changes in moonlight.conf are made for ease in error checking:
#address = 1.2.3.4 /remove # and input the IP-number of your streamsever
#platform = default /remove # and put aml instead of default
#app = Steam / remove # and change to Desktop

Now that you have edited the .conf file it’s time to pair and start trying.

In console (ssh), navigate to your moonlight directory:

./moonlight pair [your sunshine servers ip-number]
./moonlight stream -app Desktop

Later fps, resolution, bitrate might be edited for test purpose.

Next step will be Luna launcher, but it will be worked on mean while we are testing this.

On my vero4k I can only get audio working, gives just a black screen. I did try other resolutions / codecs but none seemed to work. I can succesfully use moonlight client on my android phone or the flatpak version on a linux machine, host is windows 11 with sunshine v0.23.1, nvidia rtx 3070

osmc@osmc:~/moonlight$ ./moonlight stream -app Desktop
Connecting to 192.168.1.10...
RTSP port: 48010
Initializing platform...done
Resolving host name...done
Initializing audio stream...done
Starting RTSP handshake...Audio port: 48000
Video port: 47998
Control port: 47999
done
Initializing control stream...done
Initializing video stream...done
Initializing input stream...done
Starting control stream...done
codec_init amstream version : 2.0
set_decoder_config
Starting video stream...VFM map: [00]  default { }
done
Starting audio stream...done
Starting input stream...done
EVIOCGRAB failed with error 16
Received first video packet after 100 ms
Received first audio packet after 400 ms
Initial audio resync period: 500 milliseconds
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
Waiting for IDR frame
Requesting IDR frame on behalf of DR
IDR frame request sent
Waiting for IDR frame

...
... IDR frame messages keep repeating ...
...

I’m so sorry, will have to check which commit i must have missed, since i had it running here before I commit “all” the changes to a fresh fork on Github. I suspect I know, what’s missing. I’m a bit out of time tonight, but I’ll ping you here when I made another round of test locally.

Ugh, maybe it was because I didn’t reboot the vero… now it works!

I built moonlight (without make install) from the official repo and noticed that in their wiki it says to boot the machine.

Is there any way to display the decoding times on moonlight-embedded? I didn’t find any option for this. It feels that your fork works a little bit better regarding on the decoding time but it seems to be “pulsing” like every 2 seconds and the image gets a little bit choppy. (2560x1440@60 h265 bitrate 20 000)

the build from official repo doesn’t have this intervalled choppines but the decoding time seems to be worse, I’d say unplayable where as your fork feels like almost playable?

Thank you for the feedback, when it comes to the actual streaming, i lack the resource currently to work with those resolutions or codec.

I had no luck in recreate the issue on my vero4k so thanks for that aswell.

If you don’t mind a re-compile, locate a %20 in aml.c under src/video, and try to tweak the 20 value up or down, it’s a tweak to lessen the load on the frame buffer, theoretically 20 is a third if 60, and it works for me with lower res and another codec. But another moderator here had 4h res 60hz and h265 on a Vero5, “playable” as I understood.