[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Re: Review Request: Rework KMix DBus API and add KMix plasma
From:       "Igor Poboiko" <igor.poboiko () gmail ! com>
Date:       2011-03-14 20:17:50
Message-ID: 20110314201750.10266.78147 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> On March 14, 2011, 7:06 p.m., Diego Casella wrote:
> > Ok, sorry again for my late reply :(
> > Services are working great, however, I think you should refactor the way the \
> > 'mixer' DataEngine works, because it doesn't completely performs what it is \
> > supposed to. Let me explain better: when you invoke the "mixer" DataEngine, you \
> > get only the audio cards names, and nothing more. You have to query() the \
> > DataEngine, passing one of those names, to receive further infos about the \
> > specific control of that audio card (this is what I, and I think other people \
> > does, expect when using this DataEngine). And this is kinda bad because, since \
> > the DataEngine doesn't automatically updates when the volume changes level/state \
> > (see my previous comment), I have to call a query() every N milliseconds and \
> > then, for each control, check is something has changed and do a manual update of \
> > the plasmoid if needed. Long story short: instead of returning a "Mixers" \
> > datasource, with key set to "Mixers" again, you should return a datasource with \
> > all the MIXER_ID's and, for each of them, all their detailed infos (volume and \
> > mute state included), so we can get all we need in one shot :) (You could run \
> > "plasmaengineexplorer" and watch a couple of engines, such as \
> > 'org.kde.activities', 'hotplug' or 'tasks' to see what I mean) 
> > Note that this will fix also the update() issue because, with the current \
> > implementation, the plasmoid won't update unless the value of one of the "Mixers" \
> > keys changes (since it contains only the audio card names, it means we will be \
> > notified of changes only if an audio card has been plugged/removed). 
> > Anyways, these are my two cent: Aaron, what do you think about it?

I thought that the 'dataUpdated' signal is emitted every time data changes (even from \
inside the dataengine - in our case, I update the mute/volume by DBus signals from \
inside the dataengine, and it updates automatically in plasmaengineexplorer), and \
there is no need to poll the dataengine. The other problem is that actually the \
plasmoid needs information only about few controls (one or a bit more sliders in \
plasmoid). So is there a need to set ALL the controls (by default)? And again, what \
is the difference between adding these sources by default and querying it, for \
example, on plasmoid start? I guess I misunderstood something, but don't you anyway \
need to poll these sources to get all changing data? And one more issue - there are \
three types of datasources: one basic (called "Mixers", provides info about available \
Mixers/soundcards), some for mixers/soundcards (which provides information about its \
controls) and some for controls (which provides information about all its state - \
volume level, mute, etc). Should I add all these sources? And should I add it \
automatically add all sources for plugged devices-sources?

Huh, I asked so many questions.. The things you are talking about are easy-to-fix, I \
maybe just don't understand correctly what you need :)


- Igor


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://svn.reviewboard.kde.org/r/6587/#review9984
-----------------------------------------------------------


On March 8, 2011, 7:01 p.m., Igor Poboiko wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/6587/
> -----------------------------------------------------------
> 
> (Updated March 8, 2011, 7:01 p.m.)
> 
> 
> Review request for Plasma and Diego Casella.
> 
> 
> Summary
> -------
> 
> This patch reworks KMix DBus API and adds a plasma dataengine+service as a frontend \
> to information provided by DBus. New DBus structure is:
> - /Mixers
> used to get some global information, such as available mixers list and global \
>                 master mixer
> - /Mixers/MIXER_ID
> used to get information about mixer with id=MIXER_ID. It provides such information \
>                 as list of available controls, name of this mixer, id, etc
> - /Mixers/MIXER_ID/CONTROL_ID
> used to get and set information about control. Such information as volume level, \
> mute, name of control, etc. It also adds a DBus signals which are emitted when new \
> mixer/control appears, or volume level changes. It also splits all dbus-related \
> code to separate class, DBus{KMix,Mixer,Control}Wrapper. 
> The Plasma Dataengine:
> By default, the only available source is "KMix". It provides information global \
> information about KMix: is KMix running, and list of available mixers. (its IDs) \
> Source for every mixer is called by it's ID (for example, "ALSA::HDA_Intel:1"). \
> This source provides such information about current Mixer as: it's readable name, \
> is it opened, its balance and list of available controls. It also adds basic \
> sources for every control, which provides only information about its readable name \
> Sources for controls are called by 'MIXER_ID/CONTROL_ID' (for example, \
> "ALSA::HDA_Intel:1/Master:0"). If you request this source, it will provide such \
> information as its readable name, is it muted and its volume level (which are \
> updates automatically, using DBus signals). There is a service available for \
> controls sources. It provides such methods as setVolume() and setMute(). 
> It doesn't close bug 171287, but it becomes one step closer to its solving :)
> 
> And, I'm not very familiar with CMake, but it would be great idea to make plasma \
> part optional. 
> 
> This addresses bug 171287.
> https://bugs.kde.org/show_bug.cgi?id=171287
> 
> 
> Diffs
> -----
> 
> /trunk/KDE/kdemultimedia/kmix/CMakeLists.txt 1223808 
> /trunk/KDE/kdemultimedia/kmix/apps/kmix.cpp 1223808 
> /trunk/KDE/kdemultimedia/kmix/core/mixdevice.h 1223808 
> /trunk/KDE/kdemultimedia/kmix/core/mixdevice.cpp 1223808 
> /trunk/KDE/kdemultimedia/kmix/core/mixer.h 1223808 
> /trunk/KDE/kdemultimedia/kmix/core/mixer.cpp 1223808 
> /trunk/KDE/kdemultimedia/kmix/dbus/dbuscontrolwrapper.h PRE-CREATION 
> /trunk/KDE/kdemultimedia/kmix/dbus/dbuscontrolwrapper.cpp PRE-CREATION 
> /trunk/KDE/kdemultimedia/kmix/dbus/dbusmixerwrapper.h PRE-CREATION 
> /trunk/KDE/kdemultimedia/kmix/dbus/dbusmixerwrapper.cpp PRE-CREATION 
> /trunk/KDE/kdemultimedia/kmix/dbus/dbusmixsetwrapper.h PRE-CREATION 
> /trunk/KDE/kdemultimedia/kmix/dbus/dbusmixsetwrapper.cpp PRE-CREATION 
> /trunk/KDE/kdemultimedia/kmix/dbus/org.kde.kmix.control.xml PRE-CREATION 
> /trunk/KDE/kdemultimedia/kmix/dbus/org.kde.kmix.mixer.xml PRE-CREATION 
> /trunk/KDE/kdemultimedia/kmix/dbus/org.kde.kmix.mixset.xml PRE-CREATION 
> /trunk/KDE/kdemultimedia/kmix/gui/kmixdockwidget.cpp 1223808 
> /trunk/KDE/kdemultimedia/kmix/plasma/CMakeLists.txt PRE-CREATION 
> /trunk/KDE/kdemultimedia/kmix/plasma/engine/CMakeLists.txt PRE-CREATION 
> /trunk/KDE/kdemultimedia/kmix/plasma/engine/mixer.operations PRE-CREATION 
> /trunk/KDE/kdemultimedia/kmix/plasma/engine/mixerengine.h PRE-CREATION 
> /trunk/KDE/kdemultimedia/kmix/plasma/engine/mixerengine.cpp PRE-CREATION 
> /trunk/KDE/kdemultimedia/kmix/plasma/engine/mixerservice.h PRE-CREATION 
> /trunk/KDE/kdemultimedia/kmix/plasma/engine/mixerservice.cpp PRE-CREATION 
> /trunk/KDE/kdemultimedia/kmix/plasma/engine/plasma-engine-mixer.desktop \
>                 PRE-CREATION 
> /trunk/KDE/kdemultimedia/kmix/tests/CMakeLists.txt 1223808 
> 
> Diff: http://svn.reviewboard.kde.org/r/6587/diff
> 
> 
> Testing
> -------
> 
> KMix from KDE SC 4.6.0 compiles ok with this patch, and patch applies to current \
> trunk. Tested on system with one card and with ALSA backend, so I don't know is \
> plasma dataengine works correctly with plugging/unplugging mixers (but it should). \
> All DBus methods/properties works fine, signals are emitted, volume can be set \
> using DBus methods. 
> Plasma dataengine was tested using plasmaengineexplorer. 
> All works fine except the one thing. When I request an source for Mixer, it also \
> adds soucres for controls. And then when I request source for already available \
> Control, it doesn't react anyhow. But when I set "Update every % ms", and click \
> "Reqeust", it works fine. If I request a source for control BEFORE requesting the \
> source for mixer, all works fine too (without setting "Update every % ms"). I don't \
> know is it a plasmaengineexplorer bug, or my. 
> 
> Thanks,
> 
> Igor
> 
> 


[Attachment #5 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://svn.reviewboard.kde.org/r/6587/">http://svn.reviewboard.kde.org/r/6587/</a>
  </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On March 14th, 2011, 7:06 p.m., <b>Diego \
Casella</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  <pre style="white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Ok, sorry again for my late reply :( Services are working great, \
however, I think you should refactor the way the &#39;mixer&#39; DataEngine works, \
because it doesn&#39;t completely performs what it is supposed to. Let me explain \
better: when you invoke the &quot;mixer&quot; DataEngine, you get only the audio \
cards names, and nothing more. You have to query() the DataEngine, passing one of \
those names, to receive further infos about the specific control of that audio card \
(this is what I, and I think other people does, expect when using this DataEngine). \
And this is kinda bad because, since the DataEngine doesn&#39;t automatically updates \
when the volume changes level/state (see my previous comment), I have to call a \
query() every N milliseconds and then, for each control, check is something has \
changed and do a manual update of the plasmoid if needed. Long story short: instead \
of returning a &quot;Mixers&quot; datasource, with key set to &quot;Mixers&quot; \
again, you should return a datasource with all the MIXER_ID&#39;s and, for each of \
them, all their detailed infos (volume and mute state included), so we can get all we \
need in one shot :) (You could run &quot;plasmaengineexplorer&quot; and watch a \
couple of engines, such as &#39;org.kde.activities&#39;, &#39;hotplug&#39; or \
&#39;tasks&#39; to see what I mean)

Note that this will fix also the update() issue because, with the current \
implementation, the plasmoid won&#39;t update unless the value of one of the \
&quot;Mixers&quot; keys changes (since it contains only the audio card names, it \
means we will be notified of changes only if an audio card has been plugged/removed).

Anyways, these are my two cent: Aaron, what do you think about it?</pre>
 </blockquote>







</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I thought that the \
&#39;dataUpdated&#39; signal is emitted every time data changes (even from inside the \
dataengine - in our case, I update the mute/volume by DBus signals from inside the \
dataengine, and it updates automatically in plasmaengineexplorer), and there is no \
need to poll the dataengine. The other problem is that actually the plasmoid needs \
information only about few controls (one or a bit more sliders in plasmoid). So is \
there a need to set ALL the controls (by default)? And again, what is the difference \
between adding these sources by default and querying it, for example, on plasmoid \
start? I guess I misunderstood something, but don&#39;t you anyway need to poll these \
sources to get all changing data? And one more issue - there are three types of \
datasources: one basic (called &quot;Mixers&quot;, provides info about available \
Mixers/soundcards), some for mixers/soundcards (which provides information about its \
controls) and some for controls (which provides information about all its state - \
volume level, mute, etc). Should I add all these sources? And should I add it \
automatically add all sources for plugged devices-sources?

Huh, I asked so many questions.. The things you are talking about are easy-to-fix, I \
maybe just don&#39;t understand correctly what you need :)</pre> <br />








<p>- Igor</p>


<br />
<p>On March 8th, 2011, 7:01 p.m., Igor Poboiko wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://svn.reviewboard.kde.orgrb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for Plasma and Diego Casella.</div>
<div>By Igor Poboiko.</div>


<p style="color: grey;"><i>Updated March 8, 2011, 7:01 p.m.</i></p>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">This patch reworks KMix DBus API and adds a plasma dataengine+service as \
a frontend to information provided by DBus. New DBus structure is:
 - /Mixers
used to get some global information, such as available mixers list and global master \
                mixer
 - /Mixers/MIXER_ID
used to get information about mixer with id=MIXER_ID. It provides such information as \
                list of available controls, name of this mixer, id, etc
 - /Mixers/MIXER_ID/CONTROL_ID
used to get and set information about control. Such information as volume level, \
mute, name of control, etc. It also adds a DBus signals which are emitted when new \
mixer/control appears, or volume level changes. It also splits all dbus-related code \
to separate class, DBus{KMix,Mixer,Control}Wrapper.

The Plasma Dataengine:
By default, the only available source is &quot;KMix&quot;. It provides information \
global information about KMix: is KMix running, and list of available mixers. (its \
IDs) Source for every mixer is called by it&#39;s ID (for example, \
&quot;ALSA::HDA_Intel:1&quot;). This source provides such information about current \
Mixer as: it&#39;s readable name, is it opened, its balance and list of available \
controls. It also adds basic sources for every control, which provides only \
information about its readable name Sources for controls are called by \
&#39;MIXER_ID/CONTROL_ID&#39; (for example, &quot;ALSA::HDA_Intel:1/Master:0&quot;). \
If you request this source, it will provide such information as its readable name, is \
it muted and its volume level (which are updates automatically, using DBus signals). \
There is a service available for controls sources. It provides such methods as \
setVolume() and setMute().

It doesn&#39;t close bug 171287, but it becomes one step closer to its solving :)

And, I&#39;m not very familiar with CMake, but it would be great idea to make plasma \
part optional. </pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">KMix from KDE SC 4.6.0 compiles ok with this patch, and patch applies to \
current trunk. Tested on system with one card and with ALSA backend, so I don&#39;t \
know is plasma dataengine works correctly with plugging/unplugging mixers (but it \
should). All DBus methods/properties works fine, signals are emitted, volume can be \
set using DBus methods.

Plasma dataengine was tested using plasmaengineexplorer. 
All works fine except the one thing. When I request an source for Mixer, it also adds \
soucres for controls. And then when I request source for already available Control, \
it doesn&#39;t react anyhow. But when I set &quot;Update every % ms&quot;, and click \
&quot;Reqeust&quot;, it works fine. If I request a source for control BEFORE \
requesting the source for mixer, all works fine too (without setting &quot;Update \
every % ms&quot;). I don&#39;t know is it a plasmaengineexplorer bug, or my.</pre>  \
</td>  </tr>
</table>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="https://bugs.kde.org/show_bug.cgi?id=171287">171287</a>


</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>/trunk/KDE/kdemultimedia/kmix/CMakeLists.txt <span style="color: \
grey">(1223808)</span></li>

 <li>/trunk/KDE/kdemultimedia/kmix/apps/kmix.cpp <span style="color: \
grey">(1223808)</span></li>

 <li>/trunk/KDE/kdemultimedia/kmix/core/mixdevice.h <span style="color: \
grey">(1223808)</span></li>

 <li>/trunk/KDE/kdemultimedia/kmix/core/mixdevice.cpp <span style="color: \
grey">(1223808)</span></li>

 <li>/trunk/KDE/kdemultimedia/kmix/core/mixer.h <span style="color: \
grey">(1223808)</span></li>

 <li>/trunk/KDE/kdemultimedia/kmix/core/mixer.cpp <span style="color: \
grey">(1223808)</span></li>

 <li>/trunk/KDE/kdemultimedia/kmix/dbus/dbuscontrolwrapper.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdemultimedia/kmix/dbus/dbuscontrolwrapper.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdemultimedia/kmix/dbus/dbusmixerwrapper.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdemultimedia/kmix/dbus/dbusmixerwrapper.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdemultimedia/kmix/dbus/dbusmixsetwrapper.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdemultimedia/kmix/dbus/dbusmixsetwrapper.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdemultimedia/kmix/dbus/org.kde.kmix.control.xml <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdemultimedia/kmix/dbus/org.kde.kmix.mixer.xml <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdemultimedia/kmix/dbus/org.kde.kmix.mixset.xml <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdemultimedia/kmix/gui/kmixdockwidget.cpp <span style="color: \
grey">(1223808)</span></li>

 <li>/trunk/KDE/kdemultimedia/kmix/plasma/CMakeLists.txt <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdemultimedia/kmix/plasma/engine/CMakeLists.txt <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdemultimedia/kmix/plasma/engine/mixer.operations <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdemultimedia/kmix/plasma/engine/mixerengine.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdemultimedia/kmix/plasma/engine/mixerengine.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdemultimedia/kmix/plasma/engine/mixerservice.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdemultimedia/kmix/plasma/engine/mixerservice.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdemultimedia/kmix/plasma/engine/plasma-engine-mixer.desktop <span \
style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdemultimedia/kmix/tests/CMakeLists.txt <span style="color: \
grey">(1223808)</span></li>

</ul>

<p><a href="http://svn.reviewboard.kde.org/r/6587/diff/" style="margin-left: \
3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>



_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic