You are here

SMPlayer single instance issue

16 posts / 0 new
Last post
ChocOrange
Offline
Last seen: 1 year 3 weeks ago
Joined: 2018-03-15 17:28
SMPlayer single instance issue

How can I make a new video reuse an existing instance of SMPlayer?

When loading a video in SMPlayer (smplayerportable.exe) and then using openwith for another video file a new instance of SMPlayer is opened (ie 2 are running). Even setting windows file association to smplayerportable.exe opens a new instance.

What I've tried / verified:
SMPlayer is set to only use one instance.
Setting AllowMultipleInstances=false in the .ini does nothing (yes it's been moved to the correct location as the splash screen gets disabled)

Downloading the portable version from their website correctly uses just one instance.

Interestingly, if I run the SMPlayer portable from their web site then attempt to load a file in the Portable Apps version it gives the message that only one instance can be used.

Using PotPlayer Portable Apps version has no such issue, and correctly reuses the first instance.

Any ideas on how to run a single reusable instance of SMPlayer?
Thanks.

John T. Haller
John T. Haller's picture
Offline
Last seen: 1 hour 42 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
via SMPlayerPortable.exe?

Are you opening the next video via SMPlayerPortable.exe? That's the only way that it is supported for most apps.

Sometimes, the impossible can become possible, if you're awesome!

ChocOrange
Offline
Last seen: 1 year 3 weeks ago
Joined: 2018-03-15 17:28
I am most definitely opening

I am most definitely opening via SMPlayerPortable.exe.

As Stated "Even setting windows file association to smplayerportable.exe opens a new instance."

Give it a try and see what happens your end. I think it's a bug.

Edit: Why was my bump 7 days later deleted? It was asking if others could reproduce the issue.

ChocOrange
Offline
Last seen: 1 year 3 weeks ago
Joined: 2018-03-15 17:28
Anyone?

Can anyone confirm that a default Portable 'install' of SMPlayer always uses a new instance for a movie opened in smplayerportable.exe?

I know people are busy but 2 weeks later and a single post from John that didn't even test it. Opening 2 movies would have confirmed or refuted it. Seriously, how long does that take to potentially provide proof that SMPlayer is fundamentally broken.

MiK
Offline
Last seen: 9 months 2 weeks ago
Joined: 2008-08-14 18:25
Confirmed - It Opens Second Instance

I've tested it, the way you describe, using "Open with", and can confirm that it opens a second instance for the second file, and then it always reuses the first instance for the third, fourth, and so on, file.

However, with the first instance closed, and the second one still opened, it then keeps using it as a single instance, i.e. without opening another instance. It does not behave the same way with the second instance closed, and the first one kept opened.

Plus, tried a trick with adding the following lines to ini files, but to no avail:
[instances]
single_instance_enabled=true

Tested in a new installation, using the following (default) location:
C:\PortableApps\SMPlayerPortable\SMPlayerPortable.exe

ChocOrange
Offline
Last seen: 1 year 3 weeks ago
Joined: 2018-03-15 17:28
Many thanks for confirming MiK

Hopefully we can get a fix in the Portable apps version.
As I said in the OP, the portable version from SMPlayer's site works correctly.

MiK
Offline
Last seen: 9 months 2 weeks ago
Joined: 2008-08-14 18:25
You are welcome

As to a fix, since you are the only one reporting about this issue, this is probably going to take a while.

With regard to this issue, with two instances, there's one more observation, I'd like to share.

When testing, as described in my previous post, my attention caught a temporary file named "qtsingleapp-smplay-ca73-1-lockfile", and the way the app handles it.
As its name suggests it has something to do with 'qt single app and smplayer'.
The file with its directory is created upon app launch, in the following location:
C:\Users\...\AppData\Local\Temp\SMPlayerPortableTemp\
And the whole thing is removed upon app closing.

For comparison, the portable edition app from the publisher, creates the lockfile directly in "Temp" subfolder, and it doesn't remove it when closed:
C:\Users\...\AppData\Local\Temp\

Back to PortableApps edition, if, and when, the second instance is triggered, in addition to the above described directory, it creates a second lockfile, including its "Temp" subfolder, in the following location:
C:\PortableApps\SMPlayerPortable\Data\Temp\
And this one remains, i.e. the app does not remove it.

I find this behavior rather awkward. It might be that single instance isn't handled properly because of this.

ChocOrange
Offline
Last seen: 1 year 3 weeks ago
Joined: 2018-03-15 17:28
Workaround found from your info

If the file "...\SMPlayerPortable\Data\Temp\qtsingleapp-smplay-ca73-1-lockfile" is set to read then only a single instance is ever used.

If it's not read only then two instances are used

Thanks for pointing me in the direction of a workaround

MiK
Offline
Last seen: 9 months 2 weeks ago
Joined: 2008-08-14 18:25
I'm amazed

I would never guess that setting that 0 bytes lockfile to read-only has such an effect on the app, as to prevent it from launching. It's not intuitive at all.

Beside testing your workaround, I've tested it also on the portable edition app from the publisher, to see how this actually works, and checking at the same time that this wasn't something caused by the PortableApps launcher.

Thank you for sharing it, I could not find anything about it on the web.

John T. Haller
John T. Haller's picture
Offline
Last seen: 1 hour 42 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Possible Fix

With SMPlayer Portable closed, explore to the SMPlayerPortable\App\AppInfo\Launcher directory and open up SMPlayerPortable.ini in your text editor of choice. In the first section, Launch, add the following line after SupportsUNC=yes:

CleanTemp=false

This should fix the issue.

Sometimes, the impossible can become possible, if you're awesome!

MiK
Offline
Last seen: 9 months 2 weeks ago
Joined: 2008-08-14 18:25
Tested

I've tested it, and it works, however would not call it a fix yet for the reason that if a user wanted the opposite, i.e. multiple instances, it's not possible to do so by switching off the single instance setting in Preferences.

And, regarding preferences in general, if you haven't noticed it yet, John, there's a problem with keeping custom settings, as no changes are written to the smplayer.ini file.

I've taken a look at the first PortableApps edition, version 0.6.9, noticing that it handles the smplayer.ini, and other files, differently, and custom settings are retained, as the changes are written to the ini file.

So the issue with remembering custom settings was apparently introduced later on.

John T. Haller
John T. Haller's picture
Offline
Last seen: 1 hour 42 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Working Here

I fired up SMPlayer Portable, opened Options, Unchecked Remember settings for all files under Media settings, clicked OK, closed the app. On reopen, it was remembered fine. Closed the app. Deleted Data. Opened, and it was back to initial values.

Please give an exact use case for me to reproduce your issue in a separate bug report.

Sometimes, the impossible can become possible, if you're awesome!

MiK
Offline
Last seen: 9 months 2 weeks ago
Joined: 2008-08-14 18:25
Exact Steps

1) New installation:
SMPlayerPortable_20.6.0.paf.exe
C:\PortableApps\SMPlayerPortable\SMPlayerPortable.exe

2) Before any launching, applied the fix to:
C:\PortableApps\SMPlayerPortable\App\AppInfo\Launcher\SMPlayerPortable.ini
CleanTemp=false (on line 7)

3) Launching SMPlayerPortable.exe for testing custom settings:

3.1) Starting with the very first pref I've noticed the issue,
Options > Preferences > Interface > Instances:
- Use only one running instance of SMPlayer
Removed the checkmark, OK
App, Open menu > Quit, and start again
! Preference not retained.

3.2) Another one, tested in same manner as above,
Options > Preferences > Interface > Floating Control:
- Animated - removed checkmark
! Preference not retained.

3.3) And another one,
Options > Preferences > Keyboard and mouse > Mouse:
- Double click > None instead of Fullscreen
- Right click > None instead of Show context menu
! Preferences not retained.

3.4) Pref that does not use Preferences panel,
Options > Statusbar >
- Video info - placed checkmark
! Preference not retained.

3.5) Another one that does not use Preferences panel,
Options > Toolbars > Edit main toolbar >
- Icon size: 24 instead of 32
! Preference not retained.

3.6) And finally,
Options > Preferences > General > General:
- Remember settings for all files (audio track, subtitles...)
Removed the checkmark, OK
App, Open menu > Close, and start again
! Preference not retained.

By the way, I'm not filing an issue report, it was just meant as a side note while testing single instance issue. So, you may copy or move this posting to a suitable place, if there's actually an issue with custom settings.

John T. Haller
John T. Haller's picture
Offline
Last seen: 1 hour 42 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Separate Issue

As mentioned, I have a different result from you with 3.6, so this is a separate issue that I'll need more detail from you. My settings are maintained with or without the CleanTemp change on Windows 10 x64.

Sometimes, the impossible can become possible, if you're awesome!

MiK
Offline
Last seen: 9 months 2 weeks ago
Joined: 2008-08-14 18:25
Issue that is not

It's perfectly okay with me, since it's working for you, and apparently for others, and I don't even use the PAc Edition, as I've had switched completely to portable edition from the publisher, five years ago.

Please, just disregard my postings about the custom settings.

And, I'm out ...

MiK
Offline
Last seen: 9 months 2 weeks ago
Joined: 2008-08-14 18:25
Problem with custom settings narrowed

I've created a seperate topic just to share my later findings. If interested, please see here: https://portableapps.com/node/62989

Log in or register to post comments