https://bugs.kde.org/show_bug.cgi?id=492316

            Bug ID: 492316
           Summary: Set playback stream type to "Audio"?
    Classification: Applications
           Product: Elisa
           Version: 24.08.0
          Platform: Arch Linux
                OS: Linux
            Status: REPORTED
          Severity: wishlist
          Priority: NOR
         Component: general
          Assignee: matthieu_gall...@yahoo.fr
          Reporter: trilader+kdeb...@gmail.com
  Target Milestone: ---

I've noticed that Elisa creates a new stream for each file played. My issue is
that I'd like to play music via my speakers but movies via my headphones. If I
change the output device for Elisa to be the speakers, start playback and they
open a movie (with mpv) it also plays on the speakers. If I then move the mpv
stream back to my headphones, the next time Elisa opens a new stream it also
gets played on the headphones again.

Currently when playing audio with Elisa (using the libvlc backend) the
PipeWire/PulseAudio streams introspection output looks like this:

```
trilader@eldingar ~ % wpctl inspect 422
id 422, type PipeWire:Interface:Node
    adapt.follower.spa-node = ""
    application.icon-name = "elisa"
    application.id = "org.kde.elisa"
    application.language = "en_US.UTF-8"
  * application.name = "Elisa"
    application.process.binary = "elisa"
    application.process.host = "eldingar"
    application.process.id = "7415"
    application.process.machine-id = "51231c1673024639abcd3cce5e316627"
    application.process.session-id = "2"
    application.process.user = "trilader"
    application.version = "24.05.2"
  * client.api = "pipewire-pulse"
  * client.id = "388"
    clock.quantum-limit = "8192"
  * factory.id = "7"
    library.name = "audioconvert/libspa-audioconvert"
  * media.class = "Stream/Output/Audio"
    media.name = "audio stream"
  * media.role = "Movie"
    node.autoconnect = "true"
    node.latency = "1764/44100"
    node.loop.name = "data-loop.0"
  * node.name = "Elisa"
    node.rate = "1/44100"
    node.want-driver = "true"
    object.register = "false"
  * object.serial = "81288"
    port.group = "stream.0"
    pulse.attr.maxlength = "4194304"
    pulse.attr.minreq = "14112"
    pulse.attr.prebuf = "0"
    pulse.attr.tlength = "42336"
    pulse.server.type = "unix"
    stream.is-live = "true"
    window.x11.display = ":1"
```

Note that media.role is set to "Movie" instead of "Audio" which would be more
appropriate (and might resolve the device assignment issue described above).

With the libvlc backend this is easily possible by calling
`libvlc_media_player_set_role(d->mPlayer, libvlc_role_Music);` in the
AudioWrapper ctor in audiowrapper_libvlc.cpp.

With the Qt Multimedia backend it's likely not possible to implement at the
moment as the stream type support got removed from Qt
(QMediaPlayer::setAudioRole() got removed about 3 years ago in
https://github.com/qt/qtmultimedia/commit/634894a8a83b021386da8c2672628b0b26185ef3
.)

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to