<table><tr><td style="">kezik updated this revision to Diff 63008.<br />kezik added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D22316">View Revision</a></tr></table><br /><div><div><p>I talked with 4-5 people and they all said that giving real time feedback in the slider is useless and bad, so here's that, the feedback is given on mouse release, and every problem is automatically solved.</p>
<p>If you want more technical details about the alternative version, read the rest of this comment, otherwise just ignore, now everything is fine.</p>
<p><strong>useless part of the comment:</strong></p>
<blockquote style="border-left: 3px solid #8C98B8;
color: #6B748C;
font-style: italic;
margin: 4px 0 12px 0;
padding: 8px 12px;
background-color: #F8F9FC;">
<div style="font-style: normal;
padding-bottom: 4px;">In <a href="https://phabricator.kde.org/D22316#505584" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;">D22316#505584</a>, <a href="https://phabricator.kde.org/p/anthonyfieroni/" style="
border-color: #f1f7ff;
color: #19558d;
background-color: #f1f7ff;
border: 1px solid transparent;
border-radius: 3px;
font-weight: bold;
padding: 0 4px;">@anthonyfieroni</a> wrote:</div>
<div style="margin: 0;
padding: 0;
border: 0;
color: rgb(107, 116, 140);"><p>updateTimer uses slider value and it takes 200 ms to react, so you can sync the timer with keyboard one by increase the interval <a href="https://phabricator.kde.org/source/plasma-pa/browse/master/applet/contents/ui/ListItemBase.qml$198" class="remarkup-link" target="_blank" rel="noreferrer">https://phabricator.kde.org/source/plasma-pa/browse/master/applet/contents/ui/ListItemBase.qml$198</a></p></div>
</blockquote>
<p>I'm not sure if I am understanding this, the timer seems to only provide feedback to the slider .. ?</p>
<p>The main issue here is inside libcanberra (or pulseaudio): in some conditions (I found that the bug occurs mostly if no other sound is playing) ca_context_playing simply does not work correctly, i'm fairly sure that my patch is correct, I tested libcanberra independently and I can confirm that "bug"</p>
<p>I tested that by setting CA_PROP_CANBERRA_CACHE_CONTROL to "never", the problem seems to go away, that's probably suboptimal but it's the only decent workaround I can come up with</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="diff" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);"><span style="color: #000080">diff --git a/applet/contents/ui/ListItemBase.qml b/applet/contents/ui/ListItemBase.qml</span>
<span style="color: #000080">index d962eb5..6bdbcb7 100644</span>
<span style="color: #a00000">--- a/applet/contents/ui/ListItemBase.qml</span>
<span style="color: #00a000">+++ b/applet/contents/ui/ListItemBase.qml</span>
<span style="color: #800080">@@ -190,6 +190,10 @@ PlasmaComponents.ListItem {</span>
// whereas PA rejected the volume change and is
// still at v15 (e.g.).
updateTimer.restart();
<span style="color: #00a000">+</span>
<span style="color: #00a000">+ if (type == "sink") {</span>
<span style="color: #00a000">+ playFeedback(Index);</span>
<span style="color: #00a000">+ }</span>
}
}
<span style="color: #000080">diff --git a/src/qml/volumefeedback.cpp b/src/qml/volumefeedback.cpp</span>
<span style="color: #000080">index 69bc260..3e5abae 100644</span>
<span style="color: #a00000">--- a/src/qml/volumefeedback.cpp</span>
<span style="color: #00a000">+++ b/src/qml/volumefeedback.cpp</span>
<span style="color: #800080">@@ -55,9 +55,9 @@ void VolumeFeedback::play(quint32 sinkIndex)</span>
// NB Depending on how this is desired to work, we may want to simply
// skip playing, or cancel the currently playing sound and play our
<span style="color: #a00000">- // new one... for now, let's do the latter.</span>
<span style="color: #00a000">+ // new one... for now, let's do the former.</span>
if (playing) {
<span style="color: #a00000">- ca_context_cancel(context, cindex);</span>
<span style="color: #00a000">+ return;</span>
}
char dev[64];
<span style="color: #800080">@@ -70,7 +70,7 @@ void VolumeFeedback::play(quint32 sinkIndex)</span>
cindex,
CA_PROP_EVENT_DESCRIPTION, "Volume Control Feedback Sound",
CA_PROP_EVENT_ID, "audio-volume-change",
<span style="color: #a00000">- CA_PROP_CANBERRA_CACHE_CONTROL, "permanent",</span>
<span style="color: #00a000">+ CA_PROP_CANBERRA_CACHE_CONTROL, "never", // XXX workaround a libcamberra bug</span>
CA_PROP_CANBERRA_ENABLE, "1",
nullptr
);</pre></div>
</div></div><br /><div><strong>CHANGES SINCE LAST UPDATE</strong><div><a href="https://phabricator.kde.org/D22316?vs=62863&id=63008">https://phabricator.kde.org/D22316?vs=62863&id=63008</a></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D22316">https://phabricator.kde.org/D22316</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>applet/contents/ui/ListItemBase.qml</div></div></div><br /><div><strong>To: </strong>kezik, Plasma, drosca, davidedmundson, ngraham<br /><strong>Cc: </strong>anthonyfieroni, filipf, ngraham, davidedmundson, plasma-devel, kezik, LeGast00n, jraleigh, fbampaloukas, GB_2, ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart<br /></div>