INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: client/server on same pc  (Read 1088 times)

DotJun

  • Recent member
  • *
  • Posts: 37
client/server on same pc
« on: January 20, 2023, 03:43:48 am »

Can both client and server versions of MC run on the same pc? If yes, will the server be able to serve the client that is installed on that same pc?
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72446
  • Where did I put my teeth?
Re: client/server on same pc
« Reply #1 on: January 20, 2023, 04:03:43 am »

I think so.  Try it.  Panel can.

But why?
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2620
Re: client/server on same pc
« Reply #2 on: January 20, 2023, 04:28:14 am »

You can't have MC running on 2 different users at the same time. MC throws an error saying it's already running.
Maybe JRiver can fix this, it should be possible.

edit: typo - you can NOT ...
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9143
Re: client/server on same pc
« Reply #3 on: January 20, 2023, 06:40:13 am »

There's a setting in options somewhere that allows multiple instances to run. Might it work if that were enabled? I'd be amazed if it did!

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2620
Re: client/server on same pc
« Reply #4 on: January 20, 2023, 06:56:52 am »

I wasn't aware of that option. I just tested and it DOES work :)
You need to set the flag on both accounts first, then you can start the server on one account, switch to the other and connect to 127.0.0.1:52199.

The downside is that you need to login to both accounts for this to work, as MC Server does not run as a service (maybe it can be done with NSSM or similar tool?)
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9143
Re: client/server on same pc
« Reply #5 on: January 20, 2023, 01:21:48 pm »

Well, consider me amazed 😄

I also echo Jim's question... Why?

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2620
Re: client/server on same pc
« Reply #6 on: January 20, 2023, 04:17:50 pm »

Well if you have a single family PC connected to the TV, you may want to have your main user account with full permissions and other account(s) that can only View without a chance to mess things up. Sort of like Netflix, you open the app and you can have multiple users, each with their own settings, preferences, history, etc. It would be nice to have in MC.

I guess Party Mode may be a way of having a second read-only user in that scenario, but it still needs to be activated by the main user.
Logged

markf2748

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 828
Re: client/server on same pc
« Reply #7 on: January 20, 2023, 06:30:35 pm »

MC Server does not run as a service (maybe it can be done with NSSM or similar tool?)
Now I'm more than a little confused.  What about the setting:
Options > Startup > Windows Startup > Run on Windows startup:  Media Center and Media Server

Along with setting JRiver Media Center Service to Startup Type: Automatic in Windows Services,  I thought that used to make MC available before user login.  But now I find that does not happen.

Win 11 Pro 64-bit  MC 30.0.48
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2620
Re: client/server on same pc
« Reply #8 on: January 21, 2023, 05:14:12 am »

Right, the "run at windows startup" is actually after user login, and the current Service is not the Media Server, it's likely just to provide access to some functions as System/Administrator.
Logged

DotJun

  • Recent member
  • *
  • Posts: 37
Re: client/server on same pc
« Reply #9 on: January 21, 2023, 06:57:37 am »

Ok so here's the reason why:

Right now I'm running mc server in a windows vm on my unraid server and mc client on my htpc. If I can run both instances of mc server and client on my windows os htpc then I can drop the vm from my unraid server. The reasoning is because my unraid server is also my transcoding machine that's pretty much at 100% load 24/7 for the past 8+ years and not having to dedicate a core to the windows vm means more clocks towards transcoding.

Anyway, thank you all so much for the help!
Logged

DotJun

  • Recent member
  • *
  • Posts: 37
Re: client/server on same pc
« Reply #10 on: January 21, 2023, 07:01:25 am »

Now I'm more than a little confused.  What about the setting:
Options > Startup > Windows Startup > Run on Windows startup:  Media Center and Media Server

Along with setting JRiver Media Center Service to Startup Type: Automatic in Windows Services,  I thought that used to make MC available before user login.  But now I find that does not happen.

Win 11 Pro 64-bit  MC 30.0.48

Wait, would this setting mean that mc can startup as server and in the same instance be used to display movies in theater view? In all the years that I've owned mc I've actually never tried to use theater view on it since it has always been located on my headless server.
Logged

macdonjh

  • Citizen of the Universe
  • *****
  • Posts: 538
Re: client/server on same pc
« Reply #11 on: January 21, 2023, 10:59:35 am »

There's a setting in options somewhere that allows multiple instances to run. Might it work if that were enabled? I'd be amazed if it did!

I will confirm MC will not run simultaneously in separate User Accounts on the same computer without that/ those setting(s) enabled.  I tried that and found I had to Exit MC and log out of one User Account before MC would run in the other User Account. 

I can see another use for simultaneously running MC from multiple User Accounts on the same computer: multiple Zones.  Kind of like zybex's Netflix analogy.  One family member is using MC to watch a movie in Zone 1 while another family member is listening to music in Zone 2.  That's actually kind of similar to the use case I am working to set up at my house.  The difference is we have more than one computer in the house and we haven't had a case where more than one group of people needs access to MC on the same computer at the same time.  So for us, individual installations on individual computers is simpler.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4231
Re: client/server on same pc
« Reply #12 on: January 21, 2023, 11:08:23 am »

Right now I'm running mc server in a windows vm on my unraid server and mc client on my htpc. If I can run both instances of mc server and client on my windows os htpc then I can drop the vm from my unraid server. The reasoning is because my unraid server is also my transcoding machine that's pretty much at 100% load 24/7 for the past 8+ years and not having to dedicate a core to the windows vm means more clocks towards transcoding.
Wait, would this setting mean that mc can startup as server and in the same instance be used to display movies in theater view? In all the years that I've owned mc I've actually never tried to use theater view on it since it has always been located on my headless server.
that's right, you don't need 2 separate instances running. Just run it once on your htpc and make sure media network is on + media center & server set to run at startup + probably minimise to system tray as well
Logged

markf2748

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 828
Re: client/server on same pc
« Reply #13 on: January 21, 2023, 08:34:40 pm »

Clarification:

Now I'm more than a little confused.  What about the setting:
Options > Startup > Windows Startup > Run on Windows startup:  Media Center and Media Server

Along with setting JRiver Media Center Service to Startup Type: Automatic in Windows Services,  I thought that used to make MC available before user login.  But now I find that does not happen.

Win 11 Pro 64-bit  MC 30.0.48

Right, the "run at windows startup" is actually after user login, and the current Service is not the Media Server, it's likely just to provide access to some functions as System/Administrator.
??

I rechecked the entries in my Windows Startup folder:
C:\Users\xxxx\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

There was a stale shortcut in there to MC29, and no link to MC30.  Deleted the MC29 shortcut and put in a proper shortcut to my current install of Media Center 30.exe
Sure enough... now MC30 starts after Windows reboot, before login!

I originally set this up so that my Android players (MO 4Media, JRemote2, JRiver Panel, Gizmo) and MC client PCs can connect to the Win11 MC server even when I remotely reboot the server PC or it otherwise starts up without a log in.  I checked a minute or two after reboot to let things settle down, and indeed all those Android apps connect and see my DLNA zones, including the Chromecast Audios which MC detects as DLNA targets through BubbleUPnP  :) .  After login, Windows Task Manager > Processes shows both Media Center 30 and Media Center Server running.  Apparently this is a rare scenario for me, or else I would have noticed the misbehavior earlier.


Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2620
Re: client/server on same pc
« Reply #14 on: January 22, 2023, 04:17:39 am »

Sure enough... now MC30 starts after Windows reboot, before login!
Well, not exactly.

The shortcut in the startup folder (in your user profile) CANNOT be executed by windows before the user logs in. It's a user-specific setting, so if the user is not logged in, windows will NOT execute it.

TIL: However, it looks like windows 10/11 will AUTOMATICALLY login to an administrator user profile after reboot when this option is ON:
Windows Settings -> Accounts -> Sign in options -> use my sign-in info to automatically finish setting up after an update

With that enabled, windows will *always* log you in automatically after a reboot (not only after a windows update!) and then lock the desktop - you don't actually see the user login process, but if you check eventvwr timestamps, you see that it happened. As it logs in, it runs all Startup shortcuts as normal so MC is also started. When you then manually login you're only actually unlocking the desktop - it's pretty much instantaneous and you can see all your apps are already started.

I reboot so rarely that I've never noticed this. I'm not sure I like it :/ It does provide a neat way to solve the issue of starting MC server on reboot though. Even with a second user account on the PC, the primary account is logged in automatically so MC server can be made available without having to explicitly login (unlock).

As to the MC Service, it's not required for the MC Media Server - you can stop the service and MC server still works. According to the service description it's needed for IR Remote controls.
Logged

markf2748

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 828
Re: client/server on same pc
« Reply #15 on: January 22, 2023, 04:27:31 pm »

TIL: However, it looks like windows 10/11 will AUTOMATICALLY login to an administrator user profile after reboot when this option is ON:
Windows Settings -> Accounts -> Sign in options -> use my sign-in info to automatically finish setting up after an update

With that enabled, windows will *always* log you in automatically after a reboot (not only after a windows update!) and then lock the desktop - you don't actually see the user login process, but if you check eventvwr timestamps, you see that it happened. As it logs in, it runs all Startup shortcuts as normal so MC is also started. When you then manually login you're only actually unlocking the desktop - it's pretty much instantaneous and you can see all your apps are already started.
Absolutely fascinating. 
(1) Confirmed that the Windows setting is indeed set to "On" for my server PC.
(2) Confirmed, by examining Event Viewer > Windows Logs > Security > search on Event ID 4648 (= "A logon was attempted using explicit credentials"), that a login with my account credentials occurred around the time the login window appeared after reboot, but well before I actually logged in 8 minutes later from the keyboard!  Holy moly!

As to the MC Service, it's not required for the MC Media Server - you can stop the service and MC server still works. According to the service description it's needed for IR Remote controls.
(3) Discovered there is a 100% correlation between MC Options > General > Features > Remote Control and the Media Center Service process running (seen in Task Manager).  Select this option and this process automatically runs when MC starts; uncheck the option and the process does not run at MC startup.
(4) Confirmed all my Android players work when this process is not running.

Since I have no need for Remote Control (not using an IR handheld controller) I can simplify the full shutdown of MC by not running this in the first place (sadly, previously I was going into Task Manager to explicitly shut down this process whenever changing icons).  The name for this option ("Remote Control") and the process name ("JRiver Media Center 30 Service" in Windows Services) need some revision.  Even though the process is somewhat described, as you say, in the Windows Services app, there is of course no description for the corresponding "Media Center Service" in Task Manager.  Obviously I found these names very misleading and had turned on the option long ago when desperately trouble shooting network app control of the server ("sounded like a good idea at the time"  >:( ).

@Master zybex - Thanks again, from a mere mortal who truly appreciates your efforts in unraveling this stuff.

Update 1/23/2023:  (3) above is true when the Windows service is set to Startup Type: Automatic.  Today I find, if set to Startup Type: Manual this service does not startup on my system, even with MC's Remote Control option selected.  I suggest JRiver provide some documentation/guidance on this subject.
Logged
Pages: [1]   Go Up