panon icon indicating copy to clipboard operation
panon copied to clipboard

[BUG] Mixing All Speakers option shows only audio outputs added before panon started

Open marekvospel opened this issue 4 years ago • 5 comments

Desktop (please complete the following information):

  • OS: Arch 5.12.13-arch1-2
  • Version of Plasma Framework: 5.83.0
  • Back-end: PulseAudio (Mixing All Speakers)

Describe the bug Panon only detects new devices when it starts. If a bluetooth / jack / different audio output device is connected while panon is already running, panon won't react to that output stream.

Steps to reproduce

  • Have one device connected and add change your back-end & your panon input device to Mixing All Speakers
  • Start playing some music
  • Connect the second output device and switch to it
  • panon won't react to your music even if music is playing panon-no-activity

marekvospel avatar Jul 09 '21 19:07 marekvospel

It is possible to add this feature (or fix the bug), as far as panon can capture the event when a new device is connected. I believe "org.kde.plasma.private.volume" can capture this event, with its "PulseObject.Ports.length" I guess. But I cannot find its documentation on kde.org to make it work.

rbn42 avatar Jul 11 '21 00:07 rbn42

Specifically, I see Zren using these variables in volumewin7mixer. PulseObject.channels: https://github.com/Zren/plasma-applet-volumewin7mixer/blob/e66e2918bc7572c189f86c4367ae6f21db7b5af0/package/contents/ui/MixerItem.qml#L28 PulseObject.ports: https://github.com/Zren/plasma-applet-volumewin7mixer/blob/e66e2918bc7572c189f86c4367ae6f21db7b5af0/package/contents/ui/MixerItem.qml#L157 But I am not able to import them into panon. conlose.log() shows theses variables are undefined. Does anyone has a clue? What is the correct way to use these APIs?

rbn42 avatar Jul 11 '21 01:07 rbn42

Hi @Zren, could you please give me some advice? or a link to the documentation of this PulseObject variable. Thanks.

rbn42 avatar Jul 11 '21 01:07 rbn42

  • https://invent.kde.org/plasma/plasma-pa/-/blob/master/src/volumeobject.h
  • https://invent.kde.org/plasma/plasma-pa/-/blob/master/src/pulseobject.h
  • https://invent.kde.org/plasma/plasma-pa/-/blob/master/src/pulseaudio.h
  • https://invent.kde.org/plasma/plasma-pa/-/tree/master/src

Zren avatar Jul 14 '21 03:07 Zren

SinkModel, SourceModel etc, inherit AbstractModel, which is an "array" where the child items only have one property, which can be referenced as model.PulseObject in a ListModel, or just as PulseObject.

https://invent.kde.org/plasma/plasma-pa/-/blob/master/src/pulseaudio.cpp#L119

  • Sink/Source instances inherit Device which inherits VolumeObject which inherits PulseObject.
  • SinkInput/SourceOutput inherit Stream which inherits VolumeObject which inherits PulseObject.

Zren avatar Jul 14 '21 03:07 Zren