JPersson77 / LGTVCompanion

Power On and Off WebOS LG TVs together with your PC
MIT License
992 stars 40 forks source link

Error "Failed to connect to named pipe. Service may be stopped" #93

Closed WilliamLeGod closed 1 year ago

WilliamLeGod commented 1 year ago

So I've been experiencing a slow HDMI input switch for awhile now and couldn't find out why and up until recently when I tried to use command line to switch input right after windows boot up, I notice the error :"Failed to connect to named pipe. Service may be stopped".

ONLY AFTER ~10 seconds, the command line of switching input comes through and no more error.

So my setup: Ps5, Xbox, Nintendo Switch and PC use all 4 HDMI ports. Whenever I boot my PC from other input and wait for them to switch to PC input, I have to wait pretty long (~10 seconds) and the time match with the root of the error I found

I really hope there is an explanation for this error weather it is my system or the App

(Command line to switch input: "C:\Program Files\LGTV Companion\LGTV Companion.exe" -sethdmi1 Device1 -screenon Device1)

Appreciate your work as always bro!

JPersson77 commented 1 year ago

Hi @WilliamLeGod the service should start immediately upon system boot, right before the login screen. Your error message indicates however that the service is not running. Since it seem to start working after while maybe double check that the service is still set to start automatic. Open the run box with WIN+R, type services.msc and scroll down to LGTV Companion and double click it. Check that startup type is automatic and not automatic(delayed) or manual,

LMKHIG so we can troubleshoot further if needed

WilliamLeGod commented 1 year ago

@JPersson77 Thanks for the quick reply! I just checked and it is set as "Automatic" so I don't think this is the issue :(

WilliamLeGod commented 1 year ago

Upon windows boot right after restarting, I checked the LGTV Companion services and noticed its status is "Stopped" and right after ~10 seconds, it automatically changed to "Running"

JPersson77 commented 1 year ago

Thanks for the info, so it seems apparent that the service is slow to start. I've specified in the install routine for the service that it shall be dependent on three other services. Dhcp client, Dns cliet, Server. Can you check if you can spot one of them being slow to initialise by checking similarly to what you did for the app's service?

WilliamLeGod commented 1 year ago

Thanks for the info, so it seems apparent that the service is slow to start. I've specified in the install routine for the service that it shall be dependent on three other services. Dhcp client, Dns cliet, Server. Can you check if you can spot one of them being slow to initialise by checking similarly to what you did for the app's service?

You are right! Yesterday I noticed that too so I troubleshooted like this: 1/ All 3 services are running immediately, no delay 2/ I tried opening Steam and see that it connected the the Internet immediately 3/ I tried Edge browser but it delay the exact same amount of time as LG companion service (~10) until it can connect to the internet 4/ I guess maybe Server service is the issue but don't know how to fix it :( (I noticed this happens after windows update once before and now again, really don't want to reinstall windows )

JPersson77 commented 1 year ago

First thing I would try is to update your network interface driver.

If that does not do anything, maybe we could try a debug build to pinpoint what is going wrong / is delayed. I would claim that the issue is with your system rather than the app at this point, but maybe we can figure something out nevertheless. I will be quite busy with personal stuff this week however. Maybe join the discord channel for more effective communication

JPersson77 commented 1 year ago

Hi @WilliamLeGod any updates on this?

WilliamLeGod commented 1 year ago

@JPersson77 Hey sorry for my late reply!

It is 100% my system, reinstalling windows will fix that delay internet issue, I wish I have the knowledge to troubleshoot each of those individual service instead of having to reinstall windows :(

JPersson77 commented 1 year ago

Closing this issue. Feel free to reopen as needed