Bug #457

Problem with single instance in Windows (Audacious 3.5)

Added by Pascual Lucero about 2 years ago. Updated almost 2 years ago.

Status:Closed Start date:July 27, 2014
Priority:Major Due date:
Assignee:- % Done:

100%

Category:core
Target version:3.5.2
Affects version:3.5.1

Description

Hello,

As a long time Audacious user (since version 2.1) in Linux and Windows, from time to time I write here to report some issues. These are the latest I found:

1) The single instance in Windows works in the sense that if you have opened Audacious and want to reproduce another file, it opens in the same instance. And that's why Audacious is my default music player in Windows. However, a problem arises if you select different music files (in Windows Explorer) and try to open all of them (i.e, after selecting the files, I use the context menu and select "Open in Audacious", or double click if Audacious is the default player). The normal behavior in other players is that a temporary playlist is added and all files selected appear in that list. But when I use Audacious, multiple instances are opened, one for each file selected.

Thanks for your attention!

Associated revisions

Revision c6778d0c
Added by John Lindgren almost 2 years ago

Use D-Bus name ownership to implement single-instance behavior correctly. Closes: #457.

Revision 20695f9c
Added by John Lindgren almost 2 years ago

Use D-Bus name ownership to implement single-instance behavior correctly. Closes: #457.

History

#1 Updated by John Lindgren almost 2 years ago

  • Description updated (diff)

Well, the root problem is that Windows Explorer shouldn't be starting a separate Audacious process for each file. The only way to "fix" this seems to be to change the file association in the registry to use DDE [1]. Of course, that would require adding DDE support to Audacious, which isn't going to happen in the near future.

I did fix a race condition in the Audacious startup code, so that only one of the processes will declare itself the "server", which the others will try to connect to. However, the D-Bus messages seem to be getting lost, so only one file ends up in the playlist. I'm not sure yet if this is something that can be fixed in Audacious or if it's a defect in the Windows D-Bus implementation we use.

[1] http://en.wikipedia.org/wiki/Dynamic_Data_Exchange

#2 Updated by John Lindgren almost 2 years ago

  • Category set to core
  • Status changed from New to Closed
  • Target version set to 3.5.2
  • % Done changed from 0 to 100
  • Affects version 3.5.1 added

Fixed the problem that was causing D-Bus messages to get lost. All the "Open" commands will get sent to a single instance now:
https://github.com/audacious-media-player/audacious/commit/57895d5073675bac9bb54d9576fc0ed33a89009a

Keep in mind that because Windows Explorer is telling Audacious to open the files separately, not as a group, there are a couple of problems that we can't fix on the Audacious side:
  • If you have the "Clear the playlist when opening files" option checked, the playlist will get cleared before each file is added, just as if you opened each file separately.
  • The files won't get added to the playlist in any particular order. Windows is a multitasking system, so it's a race to see which client process gets the server's attention first.

So, in the end, you would be better off using drag-and-drop instead.

Also available in: Atom PDF