MayaPosch/NymphCast

Support a CLI (non-GUI) mode on the server

PureTryOut opened this issue ยท 10 comments

I'm thinking of using NymphCast server on a Plasma Bigscreen setup. For that I rather not have the server show it's UI fullscreen on top of the Plasma Bigscreen UI. Rather I have it run on the background (probably with some --cli argument) and only show up when something is being cast to it, then go to the background again when casting is done/over.

I have added a new option to the configuration file, enable_screensaver, which can be used to enable the screensaver mode. The provided nymphcast_video_config.ini file now enables video playback without screensaver (window hidden when no playback), and nymphcast_screensaver_config.ini to enable video playback with screensaver active.

Please let me know if it's working for you :)

I'd love to try, but the latest git master fails to build for me (using latest nymphrpc from git) ๐Ÿ˜…

In file included from gui.cpp:10:
gui.h:23:10: fatal error: nymphcast_client.h: No such file or directory
   23 | #include "nymphcast_client.h"
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from nc_apps.cpp:16:
nc_apps.h:33:10: fatal error: nymphcast_client.h: No such file or directory
   33 | #include "nymphcast_client.h"
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
g++ -Os -fomit-frame-pointer -Wall -fPIC -fno-strict-aliasing -o obj-x86_64-alpine-linux-musl/as_builder.o -c ../../source/as_builder.cpp
make: *** [Makefile:142: obj/x86_64-alpine-linux-musl/gui.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [Makefile:142: obj/x86_64-alpine-linux-musl/nc_apps.o] Error 1
In file included from ffplay/types.h:39,
                 from ffplay/ffplay.h:29,
                 from NymphCastServer.cpp:33:
ffplay/cmdutils.h:640:34: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
  640 |     snprintf(name, sizeof(name), "0x%"PRIx64, ch_layout);
      |                                  ^
In file included from NymphCastServer.cpp:64:
nc_apps.h:33:10: fatal error: nymphcast_client.h: No such file or directory
   33 | #include "nymphcast_client.h"
      |          ^~~~~~~~~~~~~~~~~~~~

Ah yes, sorry about that... due to the newly integrated GUI and standalone operating mode, the libnymphcast dependency was added to the server.

I'll be updating the README to reflect these changes :)

So it comes down to installing src/client_lib before compiling src/server? Yeah no can do in distribution packaging. We don't install stuff to the system, we install it to a packaging specific directory which then gets packaged into a installable-by-the-systems-package-manager archive. Also, building and installing are strictly separate steps in at least the Alpine build system. You're just not supposed to install anything when you're still building everything.

It seems the following does the trick for now though:

make -C src/client_lib
cp src/client_lib/nymphcast_client.h src/server/
make -C src/server

A bit of a hack but it works ๐Ÿคท

EDIT: Never mind, I didn't get to the linking part yet...

/usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lrmlui
/usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lnymphcast

The RmlUI dependency has been removed in the current version.

Libnymphcast is a dependency much like NymphRPC at this point, I guess. That definitely raises a lot of interesting questions regarding the build process and indeed packaging. I'd be more than happy to entertain thoughts on how to improve/fix this :)

Maybe it would be good to just split out repositories. NymphRPC being a dep isn't a problem as it's treated as a separate package, libnymphcast could do the same. It would need it's own releases but I guess it could just release in sync with NymphCast.
For development you can just include it as a git submodule.

I had almost forgotten about Git submodules. That might be the appropriate use for them. Perhaps an overarching 'NymphCast' project which has all of the current functionality in it as individual submodules. Somewhat like a virtual package :)

I'm currently cleaning up the codebase as development on V0.1-alpha is winding down (slight detour in the GUI mode). This is probably the right time to do the repo split before moving to the Beta testing phase.

That sounds good yes. At some point you could consider moving the repos to it's own nymphcast org ๐Ÿ˜‰

Anyway for distribution packaging, just make sure every repo used gets it's own releases or at least git tags. Git submodules are great for development, not so much for packaging.

Yup, builds successfully now with libnymphcast as it's own package ๐Ÿ‘

Can also confirm that the default video config now does exactly what I want: only popup when something is being cast to it.
Now I just need a new (alpha) release of all involved packages (nymphrpc, libnymphcast and nymphcast) ๐Ÿ˜„