mpv icon indicating copy to clipboard operation
mpv copied to clipboard

JACK client should stay connected throughout

Open bergfried opened this issue 6 months ago • 0 comments

Expected behavior of the wanted feature

When using JACK (or any other sound server for that matter), the JACK client created by mpv should keep its connections throughout. The current way of creating and destroying a JACK client at various events is fine for simple playback but unsuitable for anything more advanced.

Currently, the client disappears whenever the audio track is changed to "no audio" or when the channel layout is changed, forgetting the connections along the way. (Both might happen when walking through the playlist and encountering media with no audio and/or a channel layout different from the current one.)

There might be more reasons as well, but whatever the reason, the client should stay and also keep its connections throughout once the initial connections are established (see --jack-* options).

I think it would be best to

  • create the JACK client whenever --ao=jack is applied, and
  • that client should immediately get the current maximum number of output ports possible according to the current value(s) of --audio-channels (or 2 in case a maximum number of channels cannot be derived from there), then,
  • the initial connections should be created according to the --jack-* options, and
  • after the initial setup, no changes will be made whatsoever to the client and/or its connections unless
  • --ao is changed to something that does not create a JACK client, in which case the client should be destroyed but
  • can be recreated based on the then-current settings by setting --ao to jack again.

As there might be surprises (especially when using --audio-channels=auto), the proposed behavior should be optional.

Alternative behavior of the wanted feature

No response

Log File

No response

Sample Files

No response

bergfried avatar Jun 09 '25 05:06 bergfried