D14397: Port audio notification to libcanberra

Harald Sitter noreply at phabricator.kde.org
Thu Jul 26 10:44:32 BST 2018


sitter added a comment.


  Canberra's primary advantage over phonon is that it can directly use pulseaudio/alsa, bypassing the entire sound system middleware madness and leveraging PA's builtin caching mechanism. i.e. if a sound notification is played a bunch of times it will be cached in-between, making subsequent playbacks much cheaper, until the sound gets pressured out of the cache. This is opposed to phonon, where a playback is a full state cycle, such that playing the same sound multiple times means reading&&piplining it over and over again, even when the raw output PCM didn't even change. Also full-disclosure: there was a proposal for implement this functionality in Phonon, but that was years ago and never materialized, so I think canberra is the way forward here.
  
  > We probably lose the ability to play sound on Windows and Mac? How does it work there normally? (We could just make it do QApplication::beep() if a sound is configured :p)
  
  from IRC:
  
  - gstreamer is technically x-platform, whether one actually wants to attempt building and using it on these platforms is another question I suppose
  - one could write native plugins for canberra on windows/mac; or write a vlc plugin as libvlc is generally easier to use on windows I find (or we could ask videolan if they want to write it for us ;))
  
  > I'm wondering if we can also get rid of the custom QStandardPaths lookup we have in there given libcanberra is meant to support xdg sound scheme spec?
  
  Probably yes. Three problems come to mind:
  
  - our sounds aren't actually in the form of a theme (yet!)
  - notification sounds may be paths to random files (this mostly only maters as far as which CA properties need setting)
  - we have no capability to actually set a theme from the UI, and our icon names are not really theme compliant (in that we have sounds that are in xdg-sound-theme, but have a different name)
  
  All things consider what we could do as a first step is pack our sounds into a proper theme and adjust our file naming, then use that as "default" theme and whenever a notification sound is not an absolute path we'll let canberra resolve it against our theme.

REPOSITORY
  R289 KNotifications

REVISION DETAIL
  https://phabricator.kde.org/D14397

To: broulik, #frameworks, dfaure, davidedmundson, sitter, drosca, kfunk, rjvbb
Cc: kde-frameworks-devel, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180726/0ab47812/attachment.html>


More information about the Kde-frameworks-devel mailing list