Prevent error message when opening second instance of Yawcam

Questions? Suggestions? Need help? Talk about anything related to Yawcam...
theoldschool
Posts: 56
Joined: Mon Dec 29, 2008 6:24 pm

Prevent error message when opening second instance of Yawcam

Postby theoldschool » Tue Dec 29, 2009 5:30 pm

Is there any way of suppressing the error message "Another instance of Yawcam is already running. Do you want to start a second instance?"?
I am using 2 webcams streaming images to 2 different webpages and want them both to start automatically with windows startup without me having to press "OK" to start the second instance of Yawcam.

Advertisement



tellmewhy
Posts: 425
Joined: Tue Dec 11, 2007 11:19 am

Postby tellmewhy » Tue Dec 29, 2009 6:16 pm

There is no way to do so with the software.
Maybe someone can find a work arround.

malun
Site Admin
Posts: 1495
Joined: Sun Jan 04, 2004 1:29 pm

Postby malun » Fri Jan 01, 2010 3:38 pm

I made a small hack for this in a beta version:
Yawcam_BETA_2010-01-01.exe

Use this version and create a text file named "disablerunningcheck.txt". Place the text file in the directory ".yawcam" located at your home directory.
In windows vista or windows 7 this could typically be:
C:\Users\username\.yawcam
and in windows 2000 or windows xp:
C:\Documents and Settings\username\.yawcam

where username is the name of the account you are using.

If this is done, Yawcam will not check if other instances of Yawcam is running...

/malun

theoldschool
Posts: 56
Joined: Mon Dec 29, 2008 6:24 pm

Postby theoldschool » Fri Jan 01, 2010 7:03 pm

Thanks, malun - it works OK without the error message but I've found a couple of problems:

I open the first instance of Yawcam & I've set it up with camera #1 and all the appropriate settings for streaming port, text overlay, ftp upload etc. but when I open the second instance I get an error message saying "Yawcam cannot connect to the webcam. Please check that no other application is using it....." I then change the camera to #2 which is OK but I notice that all the settings for the first instance of Yawcam (camera, streaming port, text overlay, ftp upload etc.) are being used for the second instance hence the error message as the second instance is trying to use the same camera & settings as the first instance. It looks as if there is only one set of settings which is being used by both instances of Yawcam

The second problem is that I can't display any of the extra variables I've set up in the extravars folder, except for {temperature} whereas when using the old version I can show them OK in my text overlay

Any suggestions?

theoldschool
Posts: 56
Joined: Mon Dec 29, 2008 6:24 pm

Postby theoldschool » Fri Jan 01, 2010 9:23 pm

Ah! I've discovered the problem - in the new version the extravars and the settings are now stored in the .Yawcam directory in Documents and Settings\Users directory not in the Program Files as before. As there's only one .Yawcam directory both instances have to use the same settings file whereas before each directory in Program Files had its own settings file. Any way round this malun? I suppose I could run my first instance as an earlier version of Yawcam with the settings in the Program Files and the second instance as the latest version which wouldn't give the warning message?

malun
Site Admin
Posts: 1495
Joined: Sun Jan 04, 2004 1:29 pm

Postby malun » Sat Jan 02, 2010 12:17 am

Yes, you are right, didn't think of that. Yawcam uses the settings located in the home directory for the user running Yawcam. There is however a workaround...

1) Install the first yawcam instance as usual and run it like usual.
2) Make a copy of the yawcam program directory (typically: C:\Program Files\Yawcam) and name the copy Yawcam2. You will now have two program directories for Yawcam:
C:\Program Files\Yawcam
and
C:\Program Files\Yawcam2
3) Create a new directory c:\yawcamsettings
4) Create a new directory c:\yawcamsettings\yawcam2

Now it's time to edit two files in here:
C:\Program Files\Yawcam2
If you are using windows xp or 2000 you can edit the files with notepad as usual, so jump to step 8 below.
If you are using windows vista or 7 you have to run the editor as an administrator, so continue at step 5.

5) Click on the windows start button and type "notepad" in the search field.
6) In the result list, right click on Notepad and choose "Run as administrator"
7) Now open the file in Notepad by clicking "File -> Open..." and browse to the file.

8) Edit the file C:\Program Files\Yawcam2\service_profile.cfg to contain one line like this:
C:\yawcamsettings\yawcam2
9) Edit the file C:\Program Files\Yawcam2\launcher.cfg
Add the word service on the last line. If it's correct the last line will end with: yawcam.Main service

10) Start the second instance of Yawcam by running:
C:\Program Files\Yawcam2\Yawcam.exe
This version will now use settings located here:
c:\yawcamsettings\yawcam2\.yawcam
Browse to this path and see that the .yawcam directry has been created.
11) You now want to create a text file disablerunningcheck.txt here:
c:\yawcamsettings\yawcam2\.yawcam\disablerunningcheck.txt
to get rid of the question when starting the second instance of Yawcam.


I hope the explanation was clear enough...

/malun

theoldschool
Posts: 56
Joined: Mon Dec 29, 2008 6:24 pm

Postby theoldschool » Sat Jan 02, 2010 8:59 am

Yes, that works fine thanks.
I've changed the location of the new yawcamsettings directory to the C:\Documents and Settings\User directory and modified the service_profile.cfg file appropriately rather than have it in the root directory just to "hide" it for my personal preference and it works just as well there.
I've also edited the tray icon file by putting a number 1 in it so I can see which icon relates to which running.
An excellent program!!

malun
Site Admin
Posts: 1495
Joined: Sun Jan 04, 2004 1:29 pm

Postby malun » Sat Jan 02, 2010 3:27 pm

Nice!
The optimal solution would of course be if Yawcam could connect to several cameras from one instance. This is however a large change in Yawcam. We'll see about that in the future...

/malun

Niklas
Posts: 8
Joined: Mon Jan 04, 2010 12:52 pm

Postby Niklas » Mon Jan 04, 2010 1:30 pm

I have one problem with this. One of the processes are complaining about not able to connect to the camera when i start the app. It also gives me the same message when i change any setting in the program. I need to "reconnect" the same camera to make it work again.

malun
Site Admin
Posts: 1495
Joined: Sun Jan 04, 2004 1:29 pm

Postby malun » Tue Jan 05, 2010 12:49 am

Only one software can connect to the camera at the same time. (At least if it is a vfw or wdm device like a usb webcam)
Are you trying to connect multiple instances of yawcam to the same device?

What kind of camera is it?

/malun

Niklas
Posts: 8
Joined: Mon Jan 04, 2010 12:52 pm

Postby Niklas » Tue Jan 05, 2010 12:52 am

malun wrote:Only one software can connect to the camera at the same time. (At least if it is a vfw or wdm device like a usb webcam)
Are you trying to connect multiple instances of yawcam to the same device?

What kind of camera is it?

/malun


I have 2 cameras.

Sweex NightCam 1,3M.


Works great with software like webcamxp.

malun
Site Admin
Posts: 1495
Joined: Sun Jan 04, 2004 1:29 pm

Postby malun » Tue Jan 05, 2010 1:00 am

So you are running two instances, and only one gives you the error message?
What happens if you only start instance nr. 2 and don't start instance nr. 1? Do you still get the error message, or does it only occur when you are running two instances simultaneously?

/malun

Niklas
Posts: 8
Joined: Mon Jan 04, 2010 12:52 pm

Postby Niklas » Tue Jan 05, 2010 1:09 am

malun wrote:So you are running two instances, and only one gives you the error message?
What happens if you only start instance nr. 2 and don't start instance nr. 1? Do you still get the error message, or does it only occur when you are running two instances simultaneously?

/malun


Only when i run two. Its the first one that complains.
Do i need to add the "service"-stuff to the first instance?

Start 2 first and then 1: err msg at start.
Start 1 first and then 2: no err. msg.
If i go into settings and press OK i get the msg regardless of how i started the instances.

I need to change camera (same camera as always) every time to make it work again.

malun
Site Admin
Posts: 1495
Joined: Sun Jan 04, 2004 1:29 pm

Postby malun » Tue Jan 05, 2010 1:27 am

No need for the "service"-stuff on the first instance.
Are you using the forcevideoformat.txt-hack on any of the instances?

/malun

Niklas
Posts: 8
Joined: Mon Jan 04, 2010 12:52 pm

Postby Niklas » Tue Jan 05, 2010 1:28 am

malun wrote:No need for the "service"-stuff on the first instance.
Are you using the forcevideoformat.txt-hack on any of the instances?

/malun


No. I have only used the GUI (except for the disablerunningcheck.txt-file).


Return to “General”

Who is online

Users browsing this forum: Google Adsense [Bot] and 8 guests