[Unofficial] moonlight-embedded

I think he talks about the nightly build:
http://coreelec.relkai.org/addons/19.2/Amlogic-ce/arm/script.luna/script.luna-1.0.0-matrix.125.zip

Maybe there is something wrong in addon build script.

EDIT:
From nightly server:

objdump -x moonlight  | awk '/NEEDED/ {print $2}'
libm.so.6
libgamestream.so.4
libavcodec.so.58
libavutil.so.56
libX11.so.6
libEGL.so.1
libGLESv2.so.2
libasound.so.2
libpulse-simple.so.0
libpulse.so.0
libevdev.so.2
libudev.so.1
libdl.so.2
libmoonlight-common.so.4
libpthread.so.0
libc.so.6

The problem is that jre.zulu addon with X11 is build before moonlight-embedded. Then moonlight-embedded picks it up.

This patch disable this behavior but I’m sure there should be clean way of disabling X11?

--- a/CMakeLists.txt	2021-08-21 19:35:18.000000000 +0200
+++ b/CMakeLists.txt	2021-08-24 11:44:28.875680700 +0200
@@ -23,10 +23,8 @@ pkg_check_modules(UDEV REQUIRED libudev)
 pkg_check_modules(SDL sdl2>=2.0.4)
 pkg_check_modules(AVCODEC libavcodec)
 pkg_check_modules(AVUTIL libavutil)
-pkg_check_modules(XLIB x11)
 pkg_check_modules(VDPAU vdpau)
 pkg_check_modules(LIBVA libva)
-pkg_check_modules(LIBVA_X11 libva-x11)
 pkg_check_modules(PULSE libpulse-simple)
 pkg_check_modules(CEC libcec>=4)
 pkg_check_modules(EGL egl)

I have managed to fix some bugs you guys have reported.

Please check this one out.
If moonlight is not launching, go to settings and click on ā€œSelect launch scriptsā€ under Helper. Permissions might not be set correctly.

I’d like to make the following commits:

  • luna: upgrade package
  • moonlight: remove package (the one that’s showing the addon is no longer maintained)
  • moonlight-embedded: add building patch (or smth like that)
    Would that work for you?
    script.luna-1.0.1-matrix.126.zip (2.6 MB)

@smg04, have very quickly tried it and happy to report that the games list now presents correctly and all now seems to work well.

The first time i connected after updating the add on, I was in a strange 4:3 aspect ratio, but rebooted box and tried again and it was OK.

Oh yeah,
I forgot to mention that. Moonlight takes the last aspect ratio given to the decoder, so if you watched something in Kodi in 4:3, it’s gonna play in 4:3. I have to figure out how to provide aspect ratio to the decoder…

@smg04, ah yes that makes sense then, as my little boy was watching the classic Fireman Sam series this afternoon!

@smg04, that latest update seems to have fixed the issues I was encountering other than the remote not working.

Since this was working in the pre-1.0.0 update I had a look in the launch script in there and copied the following line:

find /sys/bus/usb/devices/*/authorized -exec sh -c 'echo 0 > ${0}; echo 1 > ${0}' {} \;

into the coreelec/prescript.sh file, while also removing python reset_hid.py from both. This worked perfectly for my setup where I can use the remote to control my PC through moonlight and it’s still usable in Kodi after disconnecting.

For context I connect my controller directly to the PC and don’t use moonlight to pass through the controller, so I don’t know if this has negative effects on something else.

@smg04 when you fixed the building of the addon please make a PR with package bump to CE that it will be rebuild for the nightly users.

Is anyone still using Luna on v18 Leia? Is pairing broken, and do streams result in a black screen? No sound. No video. ??? Thanks. I’ll see about fixing things up. Just need reports.

I’m getting only black screens when trying to stream in matrix

Thank you for your bug report.
But I cannot help you if you dont provide me with logs. I need your dmesg output and output of logfile located in /storage/.kodi/addons/script.luna/bin.

These files and info about your nvidia setup (gpu, os, driver version) are required for me to be able to help you.

hi smg! sorry for the lack of details…

My hardware is an OdroidN2 running CE latest version, I’m using your script build 1.0.0 build 125

I’m using sunshine to stream from my PC with amd radeon card, I can use it just fine with moonlight-qt and moonlight android version.

dmesg out:

Sep 12 19:53:41 CoreELEC-1 kernel: vfm_map_store:rm default
Sep 12 19:53:41 CoreELEC-1 kernel: vfm_map_store:add default vdec.h265.00 amvideo
Sep 12 19:53:42 CoreELEC-1 kernel: fb: osd[0] enable: 0 (moonlight)
Sep 12 19:53:42 CoreELEC-1 kernel: fb: osd[1] enable: 0 (moonlight)
Sep 12 19:53:42 CoreELEC-1 kernel: the demux           clock on, ref cnt: 1
Sep 12 19:53:42 CoreELEC-1 kernel: the parser_top      clock on, ref cnt: 1
Sep 12 19:53:42 CoreELEC-1 kernel: the vdec            clock on, ref cnt: 1
Sep 12 19:53:42 CoreELEC-1 kernel: vdec_create instance ffffff801258c000, total 1
Sep 12 19:53:42 CoreELEC-1 kernel: no drmmode
Sep 12 19:53:42 CoreELEC-1 kernel: The fw has been loaded.
Sep 12 19:53:42 CoreELEC-1 kernel: vdec_init, dev_name:ammvdec_h265, vdec_type=VDEC_TYPE_FRAME_BLOCK
Sep 12 19:53:42 CoreELEC-1 kernel: decoder_bmmu_box_alloc_box, tvp_flags = 0
Sep 12 19:53:42 CoreELEC-1 kernel: [0]dynamic_buf_num_margin=8
Sep 12 19:53:42 CoreELEC-1 kernel: [0]double_write_mode=2304
Sep 12 19:53:42 CoreELEC-1 kernel: [0]h265:pts_unstable=0
Sep 12 19:53:42 CoreELEC-1 kernel: [0]h265: ver (201602101,0) decinfo: 1920x1080 rate=1600
Sep 12 19:53:42 CoreELEC-1 kernel: [LOCAL], the fw (hevc_mmu) will be loaded.
Sep 12 19:53:42 CoreELEC-1 kernel: vfm map vdec-map-0 created
Sep 12 19:53:42 CoreELEC-1 kernel: vdec_init, vf_provider_name = vdec.h265.00
Sep 12 19:53:42 CoreELEC-1 kernel: vdec->port_flag=0x102, port_flag=0x10b
Sep 12 19:53:42 CoreELEC-1 kernel: aml_tdm_open
Sep 12 19:53:42 CoreELEC-1 kernel: Not init audio effects
Sep 12 19:53:42 CoreELEC-1 kernel: audio_ddr_mngr: frddrs[0] registered by device ff642000.audiobus:i2s2hdmi
Sep 12 19:53:42 CoreELEC-1 kernel: set mclk:12288000, mpll:24576000, get mclk:12287994, mpll:24575987
Sep 12 19:53:42 CoreELEC-1 kernel: asoc aml_dai_set_tdm_fmt, 0x4011, ffffffc0db910018, id(2), clksel(2)
Sep 12 19:53:42 CoreELEC-1 kernel: aml_dai_set_tdm_fmt(), fmt not change
Sep 12 19:53:42 CoreELEC-1 kernel: dump_pcm_setting(ffffffc0db910018)
Sep 12 19:53:42 CoreELEC-1 kernel:         pcm_mode(1)
Sep 12 19:53:42 CoreELEC-1 kernel:         sysclk(12288000)
Sep 12 19:53:42 CoreELEC-1 kernel:         sysclk_bclk_ratio(4)
Sep 12 19:53:42 CoreELEC-1 kernel:         bclk(3072000)
Sep 12 19:53:42 CoreELEC-1 kernel:         bclk_lrclk_ratio(64)
Sep 12 19:53:42 CoreELEC-1 kernel:         lrclk(48000)
Sep 12 19:53:42 CoreELEC-1 kernel:         tx_mask(0x3)
Sep 12 19:53:42 CoreELEC-1 kernel:         rx_mask(0x3)
Sep 12 19:53:42 CoreELEC-1 kernel:         slots(2)
Sep 12 19:53:42 CoreELEC-1 kernel:         slot_width(32)
Sep 12 19:53:42 CoreELEC-1 kernel:         lane_mask_in(0x0)
Sep 12 19:53:42 CoreELEC-1 kernel:         lane_mask_out(0xf)
Sep 12 19:53:42 CoreELEC-1 kernel:         lane_oe_mask_in(0x0)
Sep 12 19:53:42 CoreELEC-1 kernel:         lane_oe_mask_out(0x0)
Sep 12 19:53:42 CoreELEC-1 kernel:         lane_lb_mask_in(0x0)
Sep 12 19:53:42 CoreELEC-1 kernel: aml_dai_set_tdm_sysclk(), mpll no change, keep clk
Sep 12 19:53:42 CoreELEC-1 kernel: aml_dai_set_tdm_sysclk(), mclk no change, keep clk
Sep 12 19:53:42 CoreELEC-1 kernel: set mclk:12288000, mpll:24576000, get mclk:12287994, mpll:24575987
Sep 12 19:53:42 CoreELEC-1 kernel: aml_dai_set_clkdiv, div 4, clksel(2)
Sep 12 19:53:42 CoreELEC-1 kernel: aml_dai_set_bclk_ratio, select I2S mode
Sep 12 19:53:42 CoreELEC-1 kernel: hdmitx: hw: set audio
Sep 12 19:53:42 CoreELEC-1 kernel: hdmitx: hw: hdmitx tx_aud_src = 1, audio_param->channel_num = 1, hdev->aud_output_ch = 103
Sep 12 19:53:42 CoreELEC-1 kernel: hdmitx: fs = 2, cd = 4, tmds_clk = 148500
Sep 12 19:53:42 CoreELEC-1 kernel: hdmitx: hw: aud_n_para = 6272
Sep 12 19:53:42 CoreELEC-1 kernel: hdmitx: hw: set channel status
Sep 12 19:53:42 CoreELEC-1 kernel: hdmitx: audio: Audio Type: PCM
Sep 12 19:53:42 CoreELEC-1 kernel: hdmitx: hw: set audio
Sep 12 19:53:42 CoreELEC-1 kernel: hdmitx: hw: hdmitx tx_aud_src = 1, audio_param->channel_num = 5, hdev->aud_output_ch = 103
Sep 12 19:53:42 CoreELEC-1 kernel: hdmitx: fs = 3, cd = 4, tmds_clk = 148500
Sep 12 19:53:42 CoreELEC-1 kernel: hdmitx: hw: aud_n_para = 6144
Sep 12 19:53:42 CoreELEC-1 kernel: hdmitx: hw: set channel status
Sep 12 19:53:42 CoreELEC-1 kernel: hdmitx: audio: Audio Type: PCM
Sep 12 19:53:42 CoreELEC-1 kernel: hdmitx: audio: set audio param
Sep 12 19:53:42 CoreELEC-1 kernel: tdm playback mute: 0, lane_cnt = 4
Sep 12 19:53:42 CoreELEC-1 kernel: tdm playback mute: 0, lane_cnt = 4
Sep 12 19:53:43 CoreELEC-1 kernel: asoc-aml-card auge_sound: tdm playback enable
Sep 12 19:53:44 CoreELEC-1 kernel: asoc-aml-card auge_sound: tdm playback stop
Sep 12 19:53:45 CoreELEC-1 kernel: tdm playback mute: 0, lane_cnt = 4
Sep 12 19:53:45 CoreELEC-1 kernel: asoc-aml-card auge_sound: tdm playback enable
Sep 12 19:53:46 CoreELEC-1 kernel: asoc-aml-card auge_sound: tdm playback stop
Sep 12 19:53:46 CoreELEC-1 kernel: tdm playback mute: 0, lane_cnt = 4

Logfile

Moonlight Embedded 2.5.1 (CEC;AML;ALSA;PULSE;EMBEDDED)
Connect to desktop.lan...
Request https://desktop.lan:47984/serverinfo?uniqueid=0123456789ABCDEF&uuid=21c37cbb-32bb-4401-9891-e91030fb305f
Response:
<?xml version="1.0" encoding="utf-8"?>
<root status_code="200"><hostname>felipes-desktop</hostname><appversion>7.1.431.0</appversion><GfeVersion>3.23.0.74</GfeVersion><uniqueid>F011BBE1-66C4-3103-4C85-2A50AB888A29</uniqueid><HttpsPort>47984</HttpsPort><ExternalPort>47989</ExternalPort><mac>00:d8:61:ab:3a:db</mac><MaxLumaPixelsHEVC>1869449984</MaxLumaPixelsHEVC><LocalIP>10.0.0.143</LocalIP><ServerCodecModeSupport>259</ServerCodecModeSupport><SupportedDisplayMode><DisplayMode><Width>1280</Width><Height>720</Height><RefreshRate>10</RefreshRate></DisplayMode><DisplayMode><Width>1280</Width><Height>720</Height><RefreshRate>30</RefreshRate></DisplayMode><DisplayMode><Width>1280</Width><Height>720</Height><RefreshRate>60</RefreshRate></DisplayMode><DisplayMode><Width>1280</Width><Height>720</Height><RefreshRate>90</RefreshRate></DisplayMode><DisplayMode><Width>1280</Width><Height>720</Height><RefreshRate>120</RefreshRate></DisplayMode><DisplayMode><Width>1280</Width><Height>720</Height><RefreshRate>30</RefreshRate></DisplayMode><DisplayMode><Width>1280</Width><Height>720</Height><RefreshRate>60</RefreshRate></DisplayMode><DisplayMode><Width>1280</Width><Height>720</Height><RefreshRate>90</RefreshRate></DisplayMode><DisplayMode><Width>1280</Width><Height>720</Height><RefreshRate>120</RefreshRate></DisplayMode><DisplayMode><Width>1920</Width><Height>1080</Height><RefreshRate>10</RefreshRate></DisplayMode><DisplayMode><Width>1920</Width><Height>1080</Height><RefreshRate>30</RefreshRate></DisplayMode><DisplayMode><Width>1920</Width><Height>1080</Height><RefreshRate>60</RefreshRate></DisplayMode><DisplayMode><Width>1920</Width><Height>1080</Height><RefreshRate>90</RefreshRate></DisplayMode><DisplayMode><Width>1920</Width><Height>1080</Height><RefreshRate>120</RefreshRate></DisplayMode><DisplayMode><Width>1920</Width><Height>1080</Height><RefreshRate>30</RefreshRate></DisplayMode><DisplayMode><Width>1920</Width><Height>1080</Height><RefreshRate>60</RefreshRate></DisplayMode><DisplayMode><Width>1920</Width><Height>1080</Height><RefreshRate>90</RefreshRate></DisplayMode><DisplayMode><Width>1920</Width><Height>1080</Height><RefreshRate>120</RefreshRate></DisplayMode><DisplayMode><Width>2560</Width><Height>1080</Height><RefreshRate>10</RefreshRate></DisplayMode><DisplayMode><Width>2560</Width><Height>1080</Height><RefreshRate>30</RefreshRate></DisplayMode><DisplayMode><Width>2560</Width><Height>1080</Height><RefreshRate>60</RefreshRate></DisplayMode><DisplayMode><Width>2560</Width><Height>1080</Height><RefreshRate>90</RefreshRate></DisplayMode><DisplayMode><Width>2560</Width><Height>1080</Height><RefreshRate>120</RefreshRate></DisplayMode><DisplayMode><Width>2560</Width><Height>1080</Height><RefreshRate>30</RefreshRate></DisplayMode><DisplayMode><Width>2560</Width><Height>1080</Height><RefreshRate>60</RefreshRate></DisplayMode><DisplayMode><Width>2560</Width><Height>1080</Height><RefreshRate>90</RefreshRate></DisplayMode><DisplayMode><Width>2560</Width><Height>1080</Height><RefreshRate>120</RefreshRate></DisplayMode><DisplayMode><Width>3440</Width><Height>1440</Height><RefreshRate>10</RefreshRate></DisplayMode><DisplayMode><Width>3440</Width><Height>1440</Height><RefreshRate>30</RefreshRate></DisplayMode><DisplayMode><Width>3440</Width><Height>1440</Height><RefreshRate>60</RefreshRate></DisplayMode><DisplayMode><Width>3440</Width><Height>1440</Height><RefreshRate>90</RefreshRate></DisplayMode><DisplayMode><Width>3440</Width><Height>1440</Height><RefreshRate>120</RefreshRate></DisplayMode><DisplayMode><Width>3440</Width><Height>1440</Height><RefreshRate>30</RefreshRate></DisplayMode><DisplayMode><Width>3440</Width><Height>1440</Height><RefreshRate>60</RefreshRate></DisplayMode><DisplayMode><Width>3440</Width><Height>1440</Height><RefreshRate>90</RefreshRate></DisplayMode><DisplayMode><Width>3440</Width><Height>1440</Height><RefreshRate>120</RefreshRate></DisplayMode><DisplayMode><Width>1920</Width><Height>1200</Height><RefreshRate>10</RefreshRate></DisplayMode><DisplayMode><Width>1920</Width><Height>1200</Height><RefreshRate>30</RefreshRate></DisplayMode><DisplayMode><Width>1920</Width><Height>1200</Height><RefreshRate>60</RefreshRate></DisplayMode><DisplayMode><Width>1920</Width><Height>1200</Height><RefreshRate>90</RefreshRate></DisplayMode><DisplayMode><Width>1920</Width><Height>1200</Height><RefreshRate>120</RefreshRate></DisplayMode><DisplayMode><Width>1920</Width><Height>1200</Height><RefreshRate>30</RefreshRate></DisplayMode><DisplayMode><Width>1920</Width><Height>1200</Height><RefreshRate>60</RefreshRate></DisplayMode><DisplayMode><Width>1920</Width><Height>1200</Height><RefreshRate>90</RefreshRate></DisplayMode><DisplayMode><Width>1920</Width><Height>1200</Height><RefreshRate>120</RefreshRate></DisplayMode><DisplayMode><Width>3860</Width><Height>2160</Height><RefreshRate>10</RefreshRate></DisplayMode><DisplayMode><Width>3860</Width><Height>2160</Height><RefreshRate>30</RefreshRate></DisplayMode><DisplayMode><Width>3860</Width><Height>2160</Height><RefreshRate>60</RefreshRate></DisplayMode><DisplayMode><Width>3860</Width><Height>2160</Height><RefreshRate>90</RefreshRate></DisplayMode><DisplayMode><Width>3860</Width><Height>2160</Height><RefreshRate>120</RefreshRate></DisplayMode><DisplayMode><Width>3860</Width><Height>2160</Height><RefreshRate>30</RefreshRate></DisplayMode><DisplayMode><Width>3860</Width><Height>2160</Height><RefreshRate>60</RefreshRate></DisplayMode><DisplayMode><Width>3860</Width><Height>2160</Height><RefreshRate>90</RefreshRate></DisplayMode><DisplayMode><Width>3860</Width><Height>2160</Height><RefreshRate>120</RefreshRate></DisplayMode><DisplayMode><Width>3840</Width><Height>15962</Height><RefreshRate>10</RefreshRate></DisplayMode><DisplayMode><Width>3840</Width><Height>15962</Height><RefreshRate>30</RefreshRate></DisplayMode><DisplayMode><Width>3840</Width><Height>15962</Height><RefreshRate>60</RefreshRate></DisplayMFailed to initialize libcec interface
ode><DisplayMode><Width>3840</Width><Height>15962</Height><RefreshRate>90</RefreshRate></DisplayMode><DisplayMode><Width>3840</Width><Height>15962</Height><RefreshRate>120</RefreshRate></DisplayMode><DisplayMode><Width>3840</Width><Height>15962</Height><RefreshRate>30</RefreshRate></DisplayMode><DisplayMode><Width>3840</Width><Height>15962</Height><RefreshRate>60</RefreshRate></DisplayMode><DisplayMode><Width>3840</Width><Height>15962</Height><RefreshRate>90</RefreshRate></DisplayMode><DisplayMode><Width>3840</Width><Height>15962</Height><RefreshRate>120</RefreshRate></DisplayMode></SupportedDisplayMode><PairStatus>1</PairStatus><currentgame>7</currentgame><state>SUNSHINE_SERVER_BUSY</state></root>

GPU: , GFE: 3.23.0.74 (, 7.1.431.0)
Platform AMLogic VPU
Loading mappingfile gamecontrollerdb.txt
Detected Wireless Controller (050000004c050000c405000000010000) on /dev/input/event5 as PS4 Controller
Not mapping meson-ir as a gamepad
Not mapping cec_input as a gamepad
Request https://desktop.lan:47984/applist?uniqueid=0123456789ABCDEF&uuid=9d77be21-4b89-4b8a-b653-9b7397c3bf29
Response:
<?xml version="1.0" encoding="utf-8"?>
<root status_code="200"><App><IsHdrSupported>0</IsHdrSupported><AppTitle>Desktop</AppTitle><ID>1</ID></App><App><IsHdrSupported>0</IsHdrSupported><AppTitle>Steam BigPicture</AppTitle><ID>2</ID></App><App><IsHdrSupported>0</IsHdrSupported><AppTitle>AC Odyssey</AppTitle><ID>3</ID></App><App><IsHdrSupported>0</IsHdrSupported><AppTitle>RDR 2</AppTitle><ID>4</ID></App><App><IsHdrSupported>0</IsHdrSupported><AppTitle>Nioh 2</AppTitle><ID>5</ID></App><App><IsHdrSupported>0</IsHdrSupported><AppTitle>Dark Souls 3</AppTitle><ID>6</ID></App><App><IsHdrSupported>0</IsHdrSupported><AppTitle>Alien Isolation</AppTitle><ID>7</ID></App></root>

Request https://desktop.lan:47984/resume?uniqueid=0123456789ABCDEF&uuid=a6c0bae8-11f4-4aa1-8005-fda188c36625&rikey=1f50713d7b77bc10f8d36287dbcc7211&rikeyid=677264486&surroundAudioInfo=4128774
Response:
<?xml version="1.0" encoding="utf-8"?>
<root status_code="200"><sessionUcodec_init amstream version : 2.0
rl0>rtsp://10.0.0.143:48010</sessionUrl0><resume>1</resume></root>

Stream 1920 x 1080, 60 fps, 20000 kbps
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
Starting video stream...done
Starting audio stream...done
Starting input stream...done
Received first video packet after 100 ms
Assigned Wireless Controller as player 1
Received first audio packet after 1000 ms
Initial audio resync period: 500 milliseconds
Audio block size mismatch (got 992, expected 1008)
Audio FEC has been disabled due to an incompatibility with your host's old software!
Network dropped audio data (expected 102, but received 103)
Alsa shortm write, write 64 frames
Alsa shortm write, write 229 frames
Alsa shortm write, write 219 frames

video just stay frozen



=============== Additional info.

With 0.8.3 it’s playable, but it’s weird. For example, 1080p with 60fps and 20bitrate is way more laggy (unplayable) than 1080p 120fps and 40fps.

dmesg:

Sep 12 20:16:32 CoreELEC-1 kernel: tdm playback mute: 1, lane_cnt = 4
Sep 12 20:16:32 CoreELEC-1 kernel: audio_ddr_mngr: frddrs[0] released by device ff642000.audiobus:i2s2hdmi
Sep 12 20:16:38 CoreELEC-1 kernel: audio_dsp: buf=0
Sep 12 20:16:38 CoreELEC-1 kernel: audio_dsp: IEC958_mode_raw=0
Sep 12 20:16:38 CoreELEC-1 kernel: audio_dsp: IEC958_mode_codec= 0, IEC958 type 2 CH PCM
Sep 12 20:16:38 CoreELEC-1 kernel: audio_dsp: last mode 0,now 0
Sep 12 20:16:38 CoreELEC-1 kernel: aml_tdm_open
Sep 12 20:16:38 CoreELEC-1 kernel: Not init audio effects
Sep 12 20:16:38 CoreELEC-1 kernel: audio_ddr_mngr: frddrs[0] registered by device ff642000.audiobus:i2s2hdmi
Sep 12 20:16:38 CoreELEC-1 kernel: aml_dai_set_tdm_sysclk(), mpll no change, keep clk
Sep 12 20:16:38 CoreELEC-1 kernel: aml_dai_set_tdm_sysclk(), mclk no change, keep clk
Sep 12 20:16:38 CoreELEC-1 kernel: set mclk:11289600, mpll:22579200, get mclk:11289593, mpll:22579186
Sep 12 20:16:38 CoreELEC-1 kernel: asoc aml_dai_set_tdm_fmt, 0x4011, ffffffc0db504018, id(2), clksel(2)
Sep 12 20:16:38 CoreELEC-1 kernel: aml_dai_set_tdm_fmt(), fmt not change
Sep 12 20:16:38 CoreELEC-1 kernel: dump_pcm_setting(ffffffc0db504018)
Sep 12 20:16:38 CoreELEC-1 kernel:         pcm_mode(1)
Sep 12 20:16:38 CoreELEC-1 kernel:         sysclk(11289600)
Sep 12 20:16:38 CoreELEC-1 kernel:         sysclk_bclk_ratio(4)
Sep 12 20:16:38 CoreELEC-1 kernel:         bclk(2822400)
Sep 12 20:16:38 CoreELEC-1 kernel:         bclk_lrclk_ratio(64)
Sep 12 20:16:38 CoreELEC-1 kernel:         lrclk(44100)
Sep 12 20:16:38 CoreELEC-1 kernel:         tx_mask(0x3)
Sep 12 20:16:38 CoreELEC-1 kernel:         rx_mask(0x3)
Sep 12 20:16:38 CoreELEC-1 kernel:         slots(2)
Sep 12 20:16:38 CoreELEC-1 kernel:         slot_width(32)
Sep 12 20:16:38 CoreELEC-1 kernel:         lane_mask_in(0x0)
Sep 12 20:16:38 CoreELEC-1 kernel:         lane_mask_out(0xf)
Sep 12 20:16:38 CoreELEC-1 kernel:         lane_oe_mask_in(0x0)
Sep 12 20:16:38 CoreELEC-1 kernel:         lane_oe_mask_out(0x0)
Sep 12 20:16:38 CoreELEC-1 kernel:         lane_lb_mask_in(0x0)
Sep 12 20:16:38 CoreELEC-1 kernel: aml_dai_set_tdm_sysclk(), mpll no change, keep clk
Sep 12 20:16:38 CoreELEC-1 kernel: aml_dai_set_tdm_sysclk(), mclk no change, keep clk
Sep 12 20:16:38 CoreELEC-1 kernel: set mclk:11289600, mpll:22579200, get mclk:11289593, mpll:22579186
Sep 12 20:16:38 CoreELEC-1 kernel: aml_dai_set_clkdiv, div 4, clksel(2)
Sep 12 20:16:38 CoreELEC-1 kernel: aml_dai_set_bclk_ratio, select I2S mode
Sep 12 20:16:38 CoreELEC-1 kernel: tdm playback mute: 0, lane_cnt = 4
Sep 12 20:16:38 CoreELEC-1 kernel: tdm playback mute: 0, lane_cnt = 4
Sep 12 20:16:38 CoreELEC-1 kernel: asoc-aml-card auge_sound: tdm playback enable
Sep 12 20:16:39 CoreELEC-1 kernel: asoc-aml-card auge_sound: tdm playback stop
Sep 12 20:16:39 CoreELEC-1 kernel: tdm playback mute: 0, lane_cnt = 4
Sep 12 20:16:41 CoreELEC-1 kernel: vfm_map_store:rm default
Sep 12 20:16:41 CoreELEC-1 kernel: vfm_map_store:add default vdec.h265.00 amvideo
Sep 12 20:16:42 CoreELEC-1 kernel: fb: osd[0] enable: 0 (moonlight)
Sep 12 20:16:42 CoreELEC-1 kernel: fb: osd[1] enable: 0 (moonlight)
Sep 12 20:16:42 CoreELEC-1 kernel: the demux           clock on, ref cnt: 1
Sep 12 20:16:42 CoreELEC-1 kernel: the parser_top      clock on, ref cnt: 1
Sep 12 20:16:42 CoreELEC-1 kernel: the vdec            clock on, ref cnt: 1
Sep 12 20:16:42 CoreELEC-1 kernel: vdec_create instance ffffff801265e000, total 1
Sep 12 20:16:42 CoreELEC-1 kernel: no drmmode
Sep 12 20:16:42 CoreELEC-1 kernel: The fw has been loaded.
Sep 12 20:16:42 CoreELEC-1 kernel: vdec_init, dev_name:ammvdec_h265, vdec_type=VDEC_TYPE_FRAME_BLOCK
Sep 12 20:16:42 CoreELEC-1 kernel: decoder_bmmu_box_alloc_box, tvp_flags = 0
Sep 12 20:16:42 CoreELEC-1 kernel: [0]dynamic_buf_num_margin=8
Sep 12 20:16:42 CoreELEC-1 kernel: [0]double_write_mode=2304
Sep 12 20:16:42 CoreELEC-1 kernel: [0]h265:pts_unstable=0
Sep 12 20:16:42 CoreELEC-1 kernel: [0]h265: ver (201602101,0) decinfo: 1920x1080 rate=800
Sep 12 20:16:42 CoreELEC-1 kernel: [LOCAL], the fw (hevc_mmu) will be loaded.
Sep 12 20:16:42 CoreELEC-1 kernel: vfm map vdec-map-0 created
Sep 12 20:16:42 CoreELEC-1 kernel: vdec_init, vf_provider_name = vdec.h265.00
Sep 12 20:16:42 CoreELEC-1 kernel: vdec->port_flag=0x102, port_flag=0x10b
Sep 12 20:16:42 CoreELEC-1 kernel: aml_tdm_open
Sep 12 20:16:42 CoreELEC-1 kernel: Not init audio effects
Sep 12 20:16:42 CoreELEC-1 kernel: audio_ddr_mngr: frddrs[1] registered by device ff642000.audiobus:tdmb
Sep 12 20:16:42 CoreELEC-1 kernel: aml_dai_set_tdm_sysclk(), mpll no change, keep clk
Sep 12 20:16:42 CoreELEC-1 kernel: aml_dai_set_tdm_sysclk(), mclk no change, keep clk
Sep 12 20:16:42 CoreELEC-1 kernel: set mclk:12288000, mpll:24576000, get mclk:12287994, mpll:24575987
Sep 12 20:16:42 CoreELEC-1 kernel: asoc aml_dai_set_tdm_fmt, 0x4011, ffffffc0db4dfa18, id(1), clksel(1)
Sep 12 20:16:42 CoreELEC-1 kernel: aml_dai_set_tdm_fmt(), fmt not change
Sep 12 20:16:42 CoreELEC-1 kernel: dump_pcm_setting(ffffffc0db4dfa18)
Sep 12 20:16:42 CoreELEC-1 kernel:         pcm_mode(1)
Sep 12 20:16:42 CoreELEC-1 kernel:         sysclk(12288000)
Sep 12 20:16:42 CoreELEC-1 kernel:         sysclk_bclk_ratio(4)
Sep 12 20:16:42 CoreELEC-1 kernel:         bclk(3072000)
Sep 12 20:16:42 CoreELEC-1 kernel:         bclk_lrclk_ratio(64)
Sep 12 20:16:42 CoreELEC-1 kernel:         lrclk(48000)
Sep 12 20:16:42 CoreELEC-1 kernel:         tx_mask(0x3)
Sep 12 20:16:42 CoreELEC-1 kernel:         rx_mask(0x3)
Sep 12 20:16:42 CoreELEC-1 kernel:         slots(2)
Sep 12 20:16:42 CoreELEC-1 kernel:         slot_width(32)
Sep 12 20:16:42 CoreELEC-1 kernel:         lane_mask_in(0x2)
Sep 12 20:16:42 CoreELEC-1 kernel:         lane_mask_out(0x1)
Sep 12 20:16:42 CoreELEC-1 kernel:         lane_oe_mask_in(0x0)
Sep 12 20:16:42 CoreELEC-1 kernel:         lane_oe_mask_out(0x0)
Sep 12 20:16:42 CoreELEC-1 kernel:         lane_lb_mask_in(0x0)
Sep 12 20:16:42 CoreELEC-1 kernel: aml_dai_set_tdm_sysclk(), mpll no change, keep clk
Sep 12 20:16:42 CoreELEC-1 kernel: aml_dai_set_tdm_sysclk(), mclk no change, keep clk
Sep 12 20:16:42 CoreELEC-1 kernel: set mclk:12288000, mpll:24576000, get mclk:12287994, mpll:24575987
Sep 12 20:16:42 CoreELEC-1 kernel: aml_dai_set_clkdiv, div 4, clksel(1)
Sep 12 20:16:42 CoreELEC-1 kernel: aml_dai_set_bclk_ratio, select I2S mode
Sep 12 20:16:42 CoreELEC-1 kernel: spdif_a fifo ctrl, frddr:1 type:1, 16 bits, chmask 0x3, swap 0x10
Sep 12 20:16:42 CoreELEC-1 kernel: spdif_info: rate: 48000, channel status ch0_l:0x100, ch0_r:0x100, ch1_l:0x200, ch1_r:0x200
Sep 12 20:16:42 CoreELEC-1 kernel: hdmitx: hw: set audio
Sep 12 20:16:42 CoreELEC-1 kernel: hdmitx: hw: hdmitx tx_aud_src = 1, audio_param->channel_num = 1, hdev->aud_output_ch = 33
Sep 12 20:16:42 CoreELEC-1 kernel: hdmitx: fs = 3, cd = 4, tmds_clk = 148500
Sep 12 20:16:42 CoreELEC-1 kernel: hdmitx: hw: aud_n_para = 6144
Sep 12 20:16:42 CoreELEC-1 kernel: hdmitx: hw: set channel status
Sep 12 20:16:42 CoreELEC-1 kernel: hdmitx: audio: Audio Type: PCM
Sep 12 20:16:42 CoreELEC-1 kernel: hdmitx: audio: set audio param
Sep 12 20:16:42 CoreELEC-1 kernel: audio_ddr_mngr: frddr_set_sharebuffer_enable sel:1, dst_src:3
Sep 12 20:16:42 CoreELEC-1 kernel: tdm playback mute: 0, lane_cnt = 4
Sep 12 20:16:42 CoreELEC-1 kernel: spdif_a fifo ctrl, frddr:1 type:1, 16 bits, chmask 0x3, swap 0x10
Sep 12 20:16:42 CoreELEC-1 kernel: spdif_info: rate: 48000, channel status ch0_l:0x100, ch0_r:0x100, ch1_l:0x200, ch1_r:0x200
Sep 12 20:16:42 CoreELEC-1 kernel: audio_ddr_mngr: frddr_set_sharebuffer_enable sel:1, dst_src:3
Sep 12 20:16:42 CoreELEC-1 kernel: tdm playback mute: 0, lane_cnt = 4
Sep 12 20:16:42 CoreELEC-1 kernel: [0]vh265 cached=16384  need_size=16384 speed= 228 ms
Sep 12 20:16:42 CoreELEC-1 kernel: [0]set pic_list_init_flag 1
Sep 12 20:16:42 CoreELEC-1 kernel: [0]init_buf_spec2 1920 1088
Sep 12 20:16:42 CoreELEC-1 kernel: [0]set pic_list_init_flag to 2
Sep 12 20:16:42 CoreELEC-1 kernel: [0]set pic_list_init_flag to 3
Sep 12 20:16:42 CoreELEC-1 kernel: [0]VH265: output first frame
Sep 12 20:16:43 CoreELEC-1 kernel: asoc-aml-card auge_sound: tdm playback enable
Sep 12 20:16:43 CoreELEC-1 kernel: spdif_a is set to enable
Sep 12 20:16:44 CoreELEC-1 kernel: asoc-aml-card auge_sound: tdm playback stop
Sep 12 20:16:44 CoreELEC-1 kernel: spdif_a is set to disable

log:

Failed to initialize libcec interface
codec_init amstream version : 2.0
EVIOCGRAB failed with error 16
EVIOCGRAB failed with error 16
EVIOCGRAB failed with error 16
Connect to 10.0.0.143...
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
Starting video stream...done
Starting audio stream...done
Starting input stream...done
Assigned Wireless Controller as player 1
Received first video packet after 100 ms
Received first audio packet after 400 ms
Initial audio resync period: 500 milliseconds
Audio block size mismatch (got 832, expected 992)
Audio FEC has been disabled due to an incompatibility with your host's old software!
Network dropped audio data (expected 233, but received 234)
Alsa error from writei: -32
Alsa error from writei: -11
Alsa error from writei: -11
Alsa error from writei: -11
Alsa error from writei: -11
Alsa error from writei: -11
Network dropped audio data (expected 331, but received Unmapped button: 311
Unmapped button: 311
332)
Alsa error from writei: -11
Alsa error from writei: -11
Alsa error from writei: -11
Alsa error from writei: -11
Alsa error from writei: -11
Unrecoverable frame 4455: 8+0=8 received < 30 needed
Unrecoverable frame 4456: 0+1=1 received < 35 needed
Unrecoverable frame 4457: 15+0=15 received < 33 needed
Unrecoverable frame 4458: 7+0=7 received < 33 needed
Unrecoverable frame 4459: 8+0=8 received < 34 needed
Unrecoverable frame 4460: 9+0=9 received < 36 needed
Unrecoverable frame 4461: 7+0=7 received < 32 needed
Unrecoverable frame 4462: 26+1=27 received < 36 needed
Unrecoverable frame 4463: 5+2=7 received < 31 needed
Unrecoverable frame 4464: 2+5=7 received < 30 needed
Network dropped 10 frames (frames 4455 to 4464)
Waiting for IDR frame
IDR frame request sent
Unrecoverable frame 4466: 2+7=9 received < 33 needed
Unrecoverable frame 4467: 23+0=23 received < 35 needed
Unrecoverable frame 4468: 22+8=30 received < 39 needed
Unrecoverable frame 4469: 7+4=11 received < 36 needed
Network dropped 4 frames (frames 4466 to 4469)
Waiting for IDR frame
IDR frame request sent
Unrecoverable frame 4471: 9+4=13 received < 37 needed
Unrecoverable frame 4472: 40+0=40 received < 43 needed
Unrecoverable frame 4473: 13+0=13 received < 38 needed
Unrecoverable frame 4474: 15+8=23 received < 39 needed
Network dropped 4 frames (frames 4471 to 4474)
Waiting for IDR frame
IDR frame request sent
Waiting for IDR frame
Unrecoverable frame 4477: 27+0=27 received < 39 needed
Unrecoverable frame 4478: 23+7=30 received < 39 needed
Network dropped 2 frames (frames 4477 to 4478)
Waiting for IDR frame
IDR frame request sent
Waiting for IDR frame
Waiting for IDR frame
Waiting for IDR frame
Waiting for IDR frame
Waiting for IDR frame
Waiting for IDR frame
Waiting for IDR frame

What is your output of cat /sys/class/vfm/map?
Maybe its vfm mapping… If not, it could be that moonlight embedded isnt compatible with sunshine… I’ll check it out in my free time.

EDIT: I need the output when you play an h265 encoded video in Kodi.

So, it is compatible! I can confirm. I narrowed down my problem to surround, whenever I turn it on, either 5.1 or 7.1 I get a black screen when trying to stream… Is it supposed to add this much more overhead to network? I’m streaming in a 5ghz network that’s capable of easily doing 80mbits and if I use 1080p + surround 5.1 settings and 20mbit bitrate it can’t stream

Oh.
Well, you’re lucky if surround works for you. It’s not about your host or network as much as the ability for your box to correctly play surround audio. The problem is currently only 7.1 should be working, 5.1 works only if you have some kind of special audio hardware but even then its quirky. It’s currently an issue between amlogic’s audio driver and the way moonlight-embedded currently handles audio.
There is an additional branch that the maintainer created for alsa mapping, which should fix the issue, but I haven’t yet tested it. In the future, you will be able to remap your 5.1 surround to 7.1 output that amlogic audio driver supports with 2 silent channels that your amp should be able to decode.

ok! thanks

When I press on pair host with the right ip, it’s showing the code for one second and then it’s disappear and shows fail to pair host. Please help. Tnx

This is currently happening if the PC is already paired. If that’s not the case, try pairing via SSH… I’ll try and investigate the issue.

Thanks for the reply, can you please explain me how to connect using ssh.

Manual pairing via SSH

(It is expected that you have already enabled SSH in CoreELEC settings and that you haven’t changed login credentials or you know the changed values…)
ssh root@coreelec.local (if corelec.local doesn’t work, you can try using IP address of your box)
moonlight pair
Instructions will be displayed in the terminal.
Close the connection with exit.

1 Like