Bug 135292

Summary: Evolution [GTK] Mail 3.10.4 and 3.12.4 can't read audio attachments from the integrated reader inline
Product: WebKit Reporter: meets
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: cgarcia, clopez, mcatanzaro, mcrha, pnormand
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
test.c used to test with a pure webkitgtk
none
wk2 port of test.c none

Description meets 2014-07-25 09:18:35 PDT
Created attachment 235522 [details]
test.c used to test with a pure webkitgtk

I am using Archlinux with Evolution 3.12.4, gtk3 3.12.2, along with webkitgtk 2.4.4; and client and friend of mine uses Xubuntu with Evolution 3.10.4, gtk+3.0 (3.10.8-0ubuntu1) and libwebkitgtk-3.0-0 (2.4.0-1ubuntu2), 

Evolution used to allow listening to a sound file attached to a mail directly from within the UI, until Evolution switched for webkitgtk instead of their old plugin. (My friend and client used an old version of Evolution in Ubuntu 12.04 LTS so far, the 3.2.3 default provided in Ubuntu Precise). 

Now, instead of being able to use it by a simple click (see the attached image: http://meets.free.fr/evolution/test-webkitgtk/wav-and-ogg-files-in-mail-result-2.png ) what is needed is to click on the arrow above, in order to display what sound applications are available, and select one. (It is less direct and takes a bit more time, which for some users is much less well).

I have been testing "in and out" with a developer of Evolution since yesterday. Attached is the log of our discussions related to this issue:
http://pastebin.fr/36519

Here is the list of gstreamer files I have in my system:
extra/gst-libav 1.2.4-2 
extra/gst-plugins-base 1.2.4-1 
extra/gst-plugins-base-libs 1.2.4-1 
extra/gst-plugins-good 1.2.4-1 
extra/gst-plugins-ugly 1.2.4-1 
extra/gstreamer 1.2.4-1 
extra/gstreamer0.10 0.10.36-4 
extra/gstreamer0.10-bad 0.10.23-8 
extra/gstreamer0.10-bad-plugins 0.10.23-8 (gstreamer0.10-plugins) 
extra/gstreamer0.10-base 0.10.36-3 
extra/gstreamer0.10-base-plugins 0.10.36-3 (gstreamer0.10-plugins)  
extra/gstreamer0.10-ffmpeg 0.10.13-2 (gstreamer0.10-plugins) 
extra/gstreamer0.10-good 0.10.31-6  
extra/gstreamer0.10-good-plugins 0.10.31-6 (gstreamer0.10-plugins)  
extra/gstreamer0.10-ugly 0.10.19-11  
extra/gstreamer0.10-ugly-plugins 0.10.19-11 (gstreamer0.10-plugins) 
    
and also libwebp 0.4.0.

The tests he did and have me do are clear to him, the issue comes from webkitgtk. You will find attached the test.c file which was compiled and used to test with the command line provided in the first line (commented) of the test.c file.

The test.c opens a dialog with a WebKitWebView containing two audio references, one to a local file (this doesn't allow to play it, because it is forbidden to open file:// uris) and one inline encoded. The later works fine in Fedora 20 environment.

Let me know if you need me to do some more tests, such as compile webkitgtk with some specific options or so? I would try to do it.

Thanks for work!

Best regards,
Mélodie
Comment 1 Philippe Normand 2014-07-28 04:03:48 PDT
Hi Melodie, I just came back from holidays today, I'll try to check this bug tomorrow. Thanks for the report!
Comment 2 Philippe Normand 2014-07-29 00:40:42 PDT
I'm not sure to understand what's the issue exactly.

The test case you attached is for WebKit1 which is no longer supported but anyway. :)

What's supposed to happen when that test program is executed? Here the first audio element doesn't load because I don't have that wav file and the second audio element is a silence sound which plays fine here.
Comment 3 meets 2014-07-29 02:56:13 PDT
Hi Philippe, 

Thank you for answering so fast.

The test file has been provided to me by Milan Crha, from the Redhat development project. I uploaded a copy of the sound files so you can get them, here: http://meets.free.fr/evolution/

From the command lines used shown in the screen-shots in this directory: http://meets.free.fr/evolution/test-webkitgtk/ you might think the newer GTK3 version of WebKit has been used at some time during the tests. (Is that right?)

The result expected from the test was to check weather the issue was coming from Evolution or rather from WebKitGTK. 

I am sending a mail to Milan Crha to show him your answer, and maybe could you talk together about this bug? This would seem more relevant to me, as I don't have coding skills.

Best regards, 
Mélodie
Comment 4 Philippe Normand 2014-07-29 07:24:40 PDT
Focusing on WebKit2 because this is what we support from now on.

I'm going to attach a wk2 port of test.c, changing local:// to file:// as base_uri works around the problem but I think that for a clean solution we need to reopen and land  #130398.
Comment 5 Philippe Normand 2014-07-29 07:25:16 PDT
Created attachment 235688 [details]
wk2 port of test.c
Comment 6 Philippe Normand 2014-07-29 07:33:57 PDT
(In reply to comment #3)
> Hi Philippe, 
> 
> Thank you for answering so fast.
> 
> The test file has been provided to me by Milan Crha, from the Redhat development project. I uploaded a copy of the sound files so you can get them, here: http://meets.free.fr/evolution/
> 
> From the command lines used shown in the screen-shots in this directory: http://meets.free.fr/evolution/test-webkitgtk/ you might think the newer GTK3 version of WebKit has been used at some time during the tests. (Is that right?)
> 

No. Both WebKit1 and WebKit2 support GTK3. The biggest difference between WK1 and WK2 is that WK2 has a multi-process architecture. And of course their API is slightly different :) You can do a diff of the 2 versions of the test case to see how they differ.
Comment 7 meets 2014-07-29 12:55:29 PDT
Hi,

You just forgot to adjust the command line I need to start in the console (first line with the comments : "/* gcc test.c -g -O0 -o test `pkg-config --cflags --libs gtk+-3.0 webkitgtk-3.0` && ./test */").

If I try to adapt and use it with the right argument (your file name):

=-=-=-=-=-=-=
$ LANG=C gcc test-wk2.c -g -O0 -o test `pkg-config --cflags --libs gtk+-3.0 webkitgtk-3.0` && ./test
/tmp/ccbZhRIw.o: In function `main':
/tmp/test-wk2.c:23: undefined reference to `webkit_settings_new'
/tmp/test-wk2.c:50: undefined reference to `webkit_web_view_load_html'
collect2: error: ld returned 1 exit status

=-=-=-=-=-=-=

So you need to be very precise regarding instructions for testing because I don't know how to adapt it the right way.
Comment 8 Carlos Alberto Lopez Perez 2014-07-29 17:06:36 PDT
(In reply to comment #7)
> Hi,
> 
> You just forgot to adjust the command line I need to start in the console (first line with the comments : "/* gcc test.c -g -O0 -o test `pkg-config --cflags --libs gtk+-3.0 webkitgtk-3.0` && ./test */").
> 
> If I try to adapt and use it with the right argument (your file name):
> 
> =-=-=-=-=-=-=
> $ LANG=C gcc test-wk2.c -g -O0 -o test `pkg-config --cflags --libs gtk+-3.0 webkitgtk-3.0` && ./test
> /tmp/ccbZhRIw.o: In function `main':
> /tmp/test-wk2.c:23: undefined reference to `webkit_settings_new'
> /tmp/test-wk2.c:50: undefined reference to `webkit_web_view_load_html'
> collect2: error: ld returned 1 exit status
> 
> =-=-=-=-=-=-=
> 
> So you need to be very precise regarding instructions for testing because I don't know how to adapt it the right way.

Try this:

gcc test-wk2.c -g -O0 -o test  `pkg-config --cflags --libs gtk+-3.0 webkit2gtk-3.0`

And ensure you have the wekit2gtk development headers installed (On Debian testing/sid or Ubuntu trusty/utopic systems they are provided by the package libwebkit2gtk-3.0-dev)
Comment 9 Milan Crha 2014-07-29 21:37:54 PDT
(In reply to comment #2)
> What's supposed to happen when that test program is executed? Here the first audio element doesn't load because I don't have that wav file and the second audio element is a silence sound which plays fine here.

The test works here (Fedora) the same as for you, the first file doesn't play (due to forbidden file:// URIs), the second plays fine, because it has assigned the data inline. This is how Evolution (an email client) does that, but it's not ported to webkit2 yet. The test.c is a minimal reproducer. The problem is that Melodie's system doesn't play any of the files, even it seems like he has the same packages installed.

A better question would be, from my point of view, to know what he should have available locally to get the second file played, because it seems there's missing something. If you can give any pointers how to troubleshoot this, then it'll be great.
Comment 10 Philippe Normand 2014-07-30 00:08:45 PDT
(In reply to comment #9)
> (In reply to comment #2)
> > What's supposed to happen when that test program is executed? Here the first audio element doesn't load because I don't have that wav file and the second audio element is a silence sound which plays fine here.
> 
> The test works here (Fedora) the same as for you, the first file doesn't play (due to forbidden file:// URIs), the second plays fine, because it has assigned the data inline. This is how Evolution (an email client) does that, but it's not ported to webkit2 yet. The test.c is a minimal reproducer. The problem is that Melodie's system doesn't play any of the files, even it seems like he has the same packages installed.
> 

Wow, ok I was totally confused by the initial bug description then. Thanks for the clarification.

> A better question would be, from my point of view, to know what he should have available locally to get the second file played, because it seems there's missing something. If you can give any pointers how to troubleshoot this, then it'll be great.

To play that audio data: uri all you should need is gstreamer core, -plugins-base and -plugins-good. Can you please do this:

GST_DEBUG_NO_COLOR=1 GST_DEBUG=5 ./test 2> gst.log

and try to play the second audio element? Then attach the log on this bug, gzipped.
Comment 11 Philippe Normand 2014-09-23 02:32:01 PDT
Any news on this?
Comment 12 meets 2014-09-24 04:49:11 PDT
(In reply to comment #11)
> Any news on this?

I haven't had news from this. Do I need to do something to help get through it? I have also been busy and lost sight about if I had a task to do to help, not sure about how Milan Crha and you have progressed.
Comment 13 Michael Catanzaro 2014-09-24 06:00:44 PDT
From comment #10:

"To play that audio data: uri all you should need is gstreamer core, -plugins-base and -plugins-good. Can you please do this:

GST_DEBUG_NO_COLOR=1 GST_DEBUG=5 ./test 2> gst.log

and try to play the second audio element? Then attach the log on this bug, gzipped."
Comment 14 Philippe Normand 2014-11-18 09:14:46 PST
Is this still an issue?
Comment 15 meets 2014-11-18 09:24:13 PST
Hello!

Evolution 3.12.8 : now it works!!

I don't know if it does in the former versions. I guess I'll have to try booting to Ubuntu (I do have a Unicorn/14.10 version).

Thanks a lot for your work!

Best regards,
Mélodie
Comment 16 Philippe Normand 2014-11-18 09:26:34 PST
Cool, I'm closing this bug then :)
Comment 17 meets 2014-11-18 09:47:57 PST
I am sending a mail to the original user who has shown this bug to me. Hopefully it works in his version too. (Ubuntu Trusty Tahr).

Best regards,
Mélodie