Skip to content

libvlc: Set media player role to "Music"

Daniel Schulte requested to merge trilader/elisa:set-media-stream-type into master

Reason for the change

PipeWire/WirePlumber stream restore function often uses the streams media.role property to restore stream volume and output device when a new stream is stated. By default libvlc doesn't have a value set for the relevant property, resulting in media.role = "Movie" being the default. This is annoying (to me) as I'd like to use a different device (speakers) for music playback than for video playback (my headphones).

Test plan

I inspected the audio stream generated by Elisa with this patch applied. I first get the stream ID using wpctl status and then inspecting the correct stream using wpctl inspect xxx. It now (correctly) reports media.role = "Music" instead of media.role = "Movie" like before.

Stream restore is also working correctly with this patch applied:

  1. Play a video using e.g. mpv. Note which output device and playback volume are used for it. Quit mpv.
  2. Start Elisa and play a song and pause it after a bit.
  3. Either while still playing or when paused, change the volume and/or stream output device to something else.
  4. Pause the stream.
  5. Start playing a video (again) using e.g. mpv. Without the patch applied it should be using the same device/volume that Elisa is set to. With it applied it should be using whatever was used previously.
  6. Switch mpv to another audio device and/or change the playback volume.
  7. Start playing a new track in Elisa, either by clicking "Next track" or clicking one (even the same, already paused file works) in the playlist.
  8. Elisa starts a new stream. With the patch applied the stream should go to the device set in step 3 with the same volume it had before. Without the patch the stream uses the same properties as mpv in step 6.

Screenshots or screen recordings

Bugs fixed

BUG: 492316

Edited by Daniel Schulte

Merge request reports

Loading