Skip to content

Add OSMC launcher & some small fixes#2

Open
agboom wants to merge 3 commits into
TheChoconut:matrixfrom
agboom:matrix
Open

Add OSMC launcher & some small fixes#2
agboom wants to merge 3 commits into
TheChoconut:matrixfrom
agboom:matrix

Conversation

@agboom

@agboom agboom commented Aug 19, 2024

Copy link
Copy Markdown

Hi @TheChoconut, I've been tinkering with Luna to get Moonlight working on a Vero V and I thought I'd share these changes. Let me know what you think.

Comment on lines +12 to +15
LD_PRELOAD="/usr/local/lib/libmoonlight-aml.so /usr/osmc/lib/libamavutils.so /usr/osmc/lib/libamadec.so /usr/osmc/lib/libamcodec.so" \
moonlight stream \
-platform aml \
-app "$@" >> logfile 2>&1

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I based this on moonlight-stream/moonlight-embedded#573 (comment)

If I understand correctly, -platform aml forces the video to run with the Amlogic hardware
.

Comment on lines +117 to +124
# pipe launch script output to Kodi logger
# moonlight launcher output should be logged to a file to prevent chatty Kodi logs (see any launch.sh)
with launch_cmd.stdout:
for line in iter(launch_cmd.stdout.readline, b''):
self.logger.info(f'{line}')
with launch_cmd.stderr:
for line in iter(launch_cmd.stderr.readline, b''):
self.logger.error(f'{line}')

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This helps me to debug things if the launch script fails.

Comment on lines +62 to +63
host = self.plugin.getSetting('host_addr')
moonlightOut = subprocess.check_output(['moonlight', 'list', host], cwd=binary_path, timeout=5, encoding='utf-8', start_new_session=True)

@agboom agboom Aug 19, 2024

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds the configured host address as argument to moonlight. Without it, Luna would err on my system.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is because I don't have any mDNS configured on my network. Is this something we need to take into account?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking more closely, I think this is because the written config file is not read. Luna writes moonlight.conf to one of these paths:

  • /etc/moonlight.conf
  • The binary path that MLE is installed in (e.g. /usr/local/bin/moonlight.conf)
  • If above aren't writable, it falls back to the addon path (e.g. ~/.kodi/addons/script.luna/moonlight.conf).

According to the docs, MLE only tries to read from the first one by default or from $XDG_CONFIG_HOME/moonlight/moonlight.conf.

So I think I need to change this to either pass the config path explicitly, or write the config file to $XDG_CONFIG_HOME/moonlight/moonlight.conf always. What do you think?

- Add platform-specific fixes to `osmc_vero` launcher
@fahdr

fahdr commented Jul 13, 2025

Copy link
Copy Markdown

Does this fix Luna in corelec?

@TyrHeimdalEVE

Copy link
Copy Markdown

Does this fix Luna in corelec?

I don't think Luna itself is the issue, but how outdated the (bundled) version of moonlight is. 😞

I'd fix it, but have no proper build environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants