Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tutorial] Macast as headless DLNA renderer #155

Open
bogie opened this issue Nov 4, 2022 · 5 comments
Open

[Tutorial] Macast as headless DLNA renderer #155

bogie opened this issue Nov 4, 2022 · 5 comments

Comments

@bogie
Copy link

bogie commented Nov 4, 2022

Preface:

I was looking for a project like macast for quite some time, my priorities were not having to run a window manager on my headless living room server and being able to remotely cast video files on my TV.

My setup is a arch-linux server with a TV via HDMI and 5.1 analog sound system via pulseaudio, I use Jellyfin to cast my videos.

Prerequisites:

  • A user called 'macast', which will be used to run Macast
  • A Xserver (I use xorg-server and xorg-apps packages)
  • Systemd

Configuration:

We will need to create and edit a few files by hand(I might create a AUR repository later):

/etc/systemd/system/macast.service

[Unit]
Description=Macast-gui (X11)
After=remote-fs.target systemd-user-sessions.service network-online.target nss-lookup.target sound.target bluetooth.target polkit.service upower.service mysqld.service lircd.service
Wants=network-online.target polkit.service upower.service
[email protected]

[Service]
User=macast
Group=macast
PAMName=login
TTYPath=/dev/tty1
ExecStart=/usr/bin/xinit /usr/bin/macast-gui
ExecStop=/usr/bin/killall --user macast --exact --wait macast-gui.bin
Restart=on-abort
StandardInput=tty
StandardOutput=journal

[Install]
Alias=display-manager.service

Note the User=macast and Group=macast as well as the ExecStop --user macast switch, if you want to use a different user, make your changes here

run
systemctl daemon-reload && systemctl start macast && systemctl stop macast

This will create the macast_setting.json in /home/macast/.config/Macast/

Next edit that file and make sure the following settings are set as follows:
/home/macast/.config/Macast/macast_setting.json

"PlayerPosition": 4,
"PlayerSize":4,

This will run mpv/macast in the center as fullscreen, you can find compatible settings here:

class SettingProperty(Enum):
PlayerHW = 100
PlayerHW_Disable = 0
PlayerHW_Enable = 1
PlayerHW_Force = 2
PlayerSize = 200
PlayerSize_Small = 0
PlayerSize_Normal = 1
PlayerSize_Large = 2
PlayerSize_Auto = 3
PlayerSize_FullScreen = 4
PlayerPosition = 300
PlayerPosition_LeftTop = 0
PlayerPosition_LeftBottom = 1
PlayerPosition_RightTop = 2
PlayerPosition_RightBottom = 3
PlayerPosition_Center = 4
PlayerOntop = 400
PlayerOntop_False = 0
PlayerOntop_True = 1
PlayerDefaultVolume = 500

Usage:

Now run macast:
systemctl start macast
and optionally run macast on boot:
systemctl enable macast

@bogie
Copy link
Author

bogie commented Nov 4, 2022

I did not find out what the difference between macast-cli and macast-gui is, also as a caveat you will not be able to access the context menu of the macast tray icon and as such edit settings on the tv itself.

Maybe we can get a way to access the settings via a browser, as the underlying code is already using web pages for configuration. However when trying to access the settings via the browser(http://ip:49571/dlna/setting.html) I got some vue errors.

Uncaught ReferenceError: VueI18n is not defined
at setting.html:380:18

@xfangfang
Copy link
Owner

Thank you very much for writing such a detailed tutorial for Macast.

macast-gui will try to display an icon in the status bar. It works well on macOS and Windows, but cannot be displayed or clicked on some Linux. (https://github.com/xfangfang/Macast/wiki/Installation#linux)


Uncaught ReferenceError: VueI18n is not defined
at setting.html:380:18

I don't know why this problem occurs. It seems that some dependent files were not packaged when installing the Macast (because I haven't maintained the Macast for a while, so I'm not particularly sure what the problem is). I expect to take the time to rewrite the code related to web pages around the beginning of next year.

@xfangfang xfangfang pinned this issue Nov 5, 2022
@bogie
Copy link
Author

bogie commented Nov 6, 2022

Apparently the AUR targets the dev branch, which has split up the service and settings server. See

self.setting_server.bind_addr = ('localhost', Setting.get_setting_port())

instead of listening on 0.0.0.0, the settings server is forced on localhost, this should be at least configurable.

@pyxdtc
Copy link

pyxdtc commented Nov 9, 2022

xml/setting.html
add this:

<script src="https://unpkg.com/[email protected]/dist/vue-i18n.js"></script>

@2017fighting
Copy link

maybe macast-gui.bin does not exist now, what should i change it to ?

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

No branches or pull requests

4 participants