Bug 347075 - Audio file loaded from wrong path (relative / absolute)
Summary: Audio file loaded from wrong path (relative / absolute)
Status: RESOLVED WORKSFORME
Alias: None
Product: konversation
Classification: Applications
Component: notifications (show other bugs)
Version: 1.6
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: David Edmundson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-02 16:46 UTC by Jack
Modified: 2021-01-01 04:39 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Test patch (391 bytes, patch)
2015-05-04 14:46 UTC, Martin Klapetek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jack 2015-05-02 16:46:42 UTC
When trying to use a sound file for notifications, Konversation loads these file from an incorrect path.
I specified "/usr/share/sounds/sound.ogg", however Konversation uses the path "//home/jack//usr/share/sounds/sound.ogg" (visible on the command line).

Konversation should distinguish between relative and absolute path

Reproducible: Always

Steps to Reproduce:
1. Go to Settings -> Configure Notifications
2. Select a sound file with an absolute path
3. Try to play it.

Actual Results:  
Konversation throws the following errors on the command line:
[00000000019b89c8] pulse audio output error: PulseAudio server connection failure: Connection refused
[0000000001980c18] pulse audio output error: PulseAudio server connection failure: Connection refused
[0000000001980c18] core audio output error: no suitable audio output module
[00007f41cc001078] filesystem access error: cannot open file //home/jack//usr/share/sounds/KDE-Im-Irc-Event.ogg (No such file or directory)
[00007f41cc001078] core access error: File reading failed
[00007f41cc001078] core access error: VLC could not open the file "//home/jack//usr/share/sounds/KDE-Im-Irc-Event.ogg" (No such file or directory).
[0000000001ab5e68] core input error: open of `file:////home/jack//usr/share/sounds/KDE-Im-Irc-Event.ogg' failed
[0000000001ab5e68] core input error: Your input can't be opened
[0000000001ab5e68] core input error: VLC is unable to open the MRL 'file:////home/jack//usr/share/sounds/KDE-Im-Irc-Event.ogg'. Check the log for details.
Comment 1 Eike Hein 2015-05-03 00:40:10 UTC
Reassigning to the relevant product.
Comment 2 Martin Klapetek 2015-05-04 07:53:55 UTC
Thanks for the report, can you locate "konversation.notifyrc" file and grep for "Sound="? Does it have the absolute path in there? Or the one with //home?
Comment 3 Jack 2015-05-04 08:00:34 UTC
(In reply to Martin Klapetek from comment #2)
> Thanks for the report, can you locate "konversation.notifyrc" file and grep
> for "Sound="? Does it have the absolute path in there? Or the one with
> //home?

find ~/ -iname "konversation.notifyrc" revealed two files for me. I am not sure which one is actually used, therefore I am posting both:

$ cat ~/.config/konversation.notifyrc | grep "Sound="
  Sound=file:///usr/share/sounds/KDE-Im-Irc-Event.ogg
  Sound=file:///usr/share/sounds/KDE-Im-Irc-Event.ogg
  Sound=/usr/share/sounds/KDE-Im-Irc-Event.ogg
  Sound=/usr/share/sounds/KDE-Im-Irc-Event.ogg
  Sound=file:///usr/share/sounds/KDE-Im-Irc-Event.ogg
  Sound=
  Sound=file:///usr/share/sounds/KDE-Im-Irc-Event.ogg
  Sound=/usr/share/sounds/KDE-Im-Irc-Event.ogg
  Sound=/usr/share/sounds/KDE-Im-Irc-Event.ogg

$ cat ~/.kde4/share/config/konversation.notifyrc | grep "Sound="
  Sound=file:///usr/share/sounds/KDE-Im-Irc-Event.ogg
  Sound=file:///usr/share/sounds/KDE-Im-Irc-Event.ogg
  Sound=file:///usr/share/sounds/KDE-Im-Irc-Event.ogg
  Sound=file:///usr/share/sounds/KDE-Im-Irc-Event.ogg
  Sound=file:///usr/share/sounds/KDE-Im-Irc-Event.ogg
  Sound=file:///usr/share/sounds/KDE-Im-Irc-Event.ogg
  Sound=file:///usr/share/sounds/KDE-Im-Irc-Event.ogg
  Sound=file:///usr/share/sounds/KDE-Im-Irc-Event.ogg

The paths specified in both files seem to be fine.
Comment 4 Martin Klapetek 2015-05-04 08:05:58 UTC
I assume you're using the kf5-based konversation, right? That would be the first file.

Can you now just check that the event where the sound fails is the one with "file://" or the one starting with "/usr" directly? 

(just open that file in some editor/less/cat and see if the "[Event/.." above the "Sound" matches the even you've configured)
Comment 5 Jack 2015-05-04 08:24:48 UTC
(In reply to Martin Klapetek from comment #4)
> I assume you're using the kf5-based konversation, right? That would be the
> first file.
kactivities-frameworks 5.9.0-1
> Can you now just check that the event where the sound fails is the one with
> "file://" or the one starting with "/usr" directly? 
Both fail. E.g.:

[Event/highlight]
Action=Sound
Execute=
KTTS=
Logfile=
Sound=file:///usr/share/sounds/KDE-Im-Irc-Event.ogg

[Event/kick]
Action=Sound
Execute=
KTTS=
Logfile=
Sound=/usr/share/sounds/KDE-Im-Irc-Event.ogg
TTS=

The error message is exactly the same for both (see example in original post).
Comment 6 Martin Klapetek 2015-05-04 11:51:17 UTC
Ok, I'm honestly unsure where that mangled path comes from, almost certainly not from KNotification as that simply just loads the path without doing anything special - notifybyaudio.cpp line 63:

QUrl soundURL = QUrl(soundFilename);

and all the tests I do with that work as expected, including setting custom sounds from the KCM.

What frameworks version are you running (in any kf5 app -> Help -> About KDE)? Are you on self-compiled system or using distro packages? What if you switch the Phonon backend to GStreamer? And finally, are you able to test patches?
Comment 7 Jack 2015-05-04 12:23:39 UTC
(In reply to Martin Klapetek from comment #6)
> Ok, I'm honestly unsure where that mangled path comes from, almost certainly
> not from KNotification as that simply just loads the path without doing
> anything special - notifybyaudio.cpp line 63:
> 
> QUrl soundURL = QUrl(soundFilename);
> 
> and all the tests I do with that work as expected, including setting custom
> sounds from the KCM.
> 
> What frameworks version are you running? 
KDE Frameworks Version 5.9.0 (Konversation 1.6)
> Are you on self-compiled system or using distro packages?
Official packages from ArchLinux (https://www.archlinux.org/packages/extra/x86_64/konversation/) 
> And finally, are you able to test patches?
Yes.

However, I just downgraded from Konversation 1.6-1 to 1.5.1-1(still had it in my package cache) and sound works again!
This is the terminal output:
 [00000000017a5c88] pulse audio output error: PulseAudio server connection failure: Connection refused
 (at this point I can hear the sound)

What was changed from 1.5 to 1.6?
Comment 8 Martin Klapetek 2015-05-04 14:46:47 UTC
Created attachment 92412 [details]
Test patch

Ok, here's a simple patach against knotifications - just compile it, run konversation again, wait for the sound to play and then look for "@@@@>" in the output and paste the whole line.

Thanks
Comment 9 Jack 2015-05-05 20:21:04 UTC
Looks like I did something wrong. What I did:
git clone git://anongit.kde.org/knotifications.git;
git apply (your-patch)
git status (-> patch is applied)
cmake -DCMAKE_INSTALL_PREFIX=/usr/;
make;
sudo make install;

Output of Konversation 1.6:
Calling notify on "Taskbar"
0 77594647
[0000000003454518] pulse audio output error: PulseAudio server connection failure: Connection refused
[0000000002d39618] pulse audio output error: PulseAudio server connection failure: Connection refused
[0000000002d39618] core audio output error: no suitable audio output module
[00007fd3e8001078] filesystem access error: cannot open file //tmp//usr/share/sounds/KDE-Im-Irc-Event.ogg (No such file or directory)
[00007fd3e8001078] core access error: File reading failed
[00007fd3e8001078] core access error: VLC could not open the file "//tmp//usr/share/sounds/KDE-Im-Irc-Event.ogg" (No such file or directory).
[000000000346c188] core input error: open of `file:////tmp//usr/share/sounds/KDE-Im-Irc-Event.ogg' failed
[000000000346c188] core input error: Your input can't be opened
[000000000346c188] core input error: VLC is unable to open the MRL 'file:////tmp//usr/share/sounds/KDE-Im-Irc-Event.ogg'. Check the log for details.

No line with "@@@@" - what does this mean?
But see how I launched konversation from /tmp (instead of /home/jack) and now it is taking that as a 'prefix'? Same applies to any path.
Comment 10 Martin Klapetek 2015-05-06 10:14:17 UTC
Interesting. You should also see a "Calling notify on "Sound"" line in your output.

This would suggest that the sound is not being played by KNotification at all.

Can you try the same thing with say Dolphin? Run Dolphin(kf5) from Konsole, try to delete (shift+del) a file, a dialog will popup, sound should play and you should see some notification output on konsole. Now try to change the sound to some custom one -> System settings -> notifications -> plasma workspace -> warning message. Does it work then?
Comment 11 Jack 2015-05-06 10:55:54 UTC
(In reply to Martin Klapetek from comment #10)
> Interesting. You should also see a "Calling notify on "Sound"" line in your
> output.
No, there is none.
> This would suggest that the sound is not being played by KNotification at
> all.
It sure seems so. Looks like Konversation is trying to contact PulseAudio and afterwards VLC (or the equivalent backend) on its own.
> Can you try the same thing with say Dolphin? 
Dolphin sound (and pretty much all other KDE sounds as far as I can tell) works fine - with custom sound files, too.
However, Konversation does not even manage to play its own, default sound files (e.g. the quit dialog, whose sound file was not changed by me).
Comment 12 Martin Klapetek 2015-05-06 11:01:59 UTC
Ok, thanks. Let's wait for Eike's comment on possible Konversation trying to play the sound directly.
Comment 13 Jack 2015-05-12 14:40:42 UTC
No further comments on this?
Comment 14 Eike Hein 2015-05-12 14:44:20 UTC
Konversation only plays sounds it self for Configure Konversation -> Notifications -> Highlight, but your steps to reproduce start with "1. Go to Settings -> Configure Notifications", which is all KNotify.
Comment 15 Martin Klapetek 2015-05-12 16:58:50 UTC
Fwiw, the posted output is most certainly not from KNotification. Look at http://lxr.kde.org/source//frameworks/knotifications/src/notifybyaudio.cpp#0112 - (line 112) - that line spews a lot of output during sound playing by KNotification, here's an example from one single notification:

knotificationdbustest(300) KNotificationManager::notify: Calling notify on "Sound"
knotificationdbustest(300) NotifyByAudio::stateChanged: Changing audio state from  Phonon::LoadingState  to  Phonon::StoppedState
knotificationdbustest(300) KNotificationManager::notify: Calling notify on "Popup"
knotificationdbustest(300) NotifyByAudio::stateChanged: Changing audio state from  Phonon::StoppedState  to  Phonon::LoadingState
knotificationdbustest(300) NotifyByAudio::stateChanged: Changing audio state from  Phonon::LoadingState  to  Phonon::StoppedState
knotificationdbustest(300) NotifyByAudio::stateChanged: Changing audio state from  Phonon::StoppedState  to  Phonon::LoadingState
knotificationdbustest(300) NotifyByAudio::stateChanged: Changing audio state from  Phonon::LoadingState  to  Phonon::BufferingState
knotificationdbustest(300) NotifyByAudio::stateChanged: Changing audio state from  Phonon::BufferingState  to  Phonon::PlayingState
knotificationdbustest(300) NotifyByAudio::stateChanged: Changing audio state from  Phonon::PlayingState  to  Phonon::BufferingState
knotificationdbustest(300) NotifyByAudio::stateChanged: Changing audio state from  Phonon::BufferingState  to  Phonon::PlayingState

...neither output posted has any of that (or at least the "Calling notify on "Sound"", which is printed _before_ any audio system init happens and not by the plugin itself).

I also reviewed the code and the code is fine; plus comment #11 confirms that with Dolphin. I believe the original steps to reproduce are simply wrong.

Sorry, there's nothing more I can think of that would make this a KNotifications bug.
Comment 16 Jack 2015-06-11 13:28:54 UTC
Is there anything I can do to further improve the understanding / pinpoint this bug?

To this day, this is still an issue for me.

BTW: am I the only one who is experiencing this problem?
Comment 17 Martin Klapetek 2015-06-11 13:38:38 UTC
Go to Configure Konversation -> Notifications -> Highlight and try to disable anything in there. Does it work then?

Note the difference, it's not the same as "Configure Notifications -> Highlight".
Comment 18 Justin Zobel 2020-12-02 06:20:20 UTC
Thank you for the report, Jack.

As it has been a while since this was reported, can you please test and confirm if this issue is still occurring or if this bug report can be marked as resolved.

I have set the bug status to "needsinfo" pending your response, please change back to "reported" or "resolved" when you respond, thank you.
Comment 19 Bug Janitor Service 2020-12-17 04:34:00 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 20 Bug Janitor Service 2021-01-01 04:39:22 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!