tiliado / nuvolaplayer

Nuvola Player - Tight integration of web-based media streaming services with your desktop
https://nuvola.tiliado.eu/
BSD 2-Clause "Simplified" License
334 stars 27 forks source link

Port to Chromium Embedded Framework #372

Closed jiri-janousek closed 6 years ago

jiri-janousek commented 7 years ago

Primary Targets

Unresolved Issues

Testing

jiri-janousek commented 6 years ago

CEF is not compatible with GTK+ 3.22: cztomczak/cefcapi#9

jiri-janousek commented 6 years ago

Neither compatible: 3.20.9-1ubuntu2.1 (Ubuntu 16.10), 3.18.9-1ubuntu3.3 (Ubuntu 16.04).

jiri-janousek commented 6 years ago
jiri-janousek commented 6 years ago
jiri-janousek commented 6 years ago

The first failing commit between 3.15.1 and 3.15.2 is GNOME/gtk@dae447728d

jiri-janousek commented 6 years ago

This works:

GtkWidget* create_gtk_window(char* title, int width, int height) {
    printf("create_gtk_window\n");
    // Create window.
    GtkWidget* window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    ...
    // GTK+ > 3.15.1 uses an X11 visual optimized for GTK+'s OpenGL stuff
    // since revid dae447728d: https://github.com/GNOME/gtk/commit/dae447728d
    // However, it breaks CEF: https://github.com/cztomczak/cefcapi/issues/9
    // Let's use the default X11 visual instead the GTK's blessed one.
    GdkScreen* screen = gdk_screen_get_default();
    GList* visuals = gdk_screen_list_visuals(screen);
    printf("n visuals: %u\n", g_list_length(visuals));
    GdkX11Screen* x11_screen = GDK_X11_SCREEN(screen);
    g_assert(x11_screen != NULL);
    Visual* default_xvisual = DefaultVisual(GDK_SCREEN_XDISPLAY(x11_screen),
        GDK_SCREEN_XNUMBER(x11_screen));
    GdkVisual* default_visual = NULL;
    int i = 0;
    while (visuals != NULL) {
    GdkVisual* visual = GDK_X11_VISUAL (visuals->data);
        if (default_xvisual->visualid == gdk_x11_visual_get_xvisual(
           GDK_X11_VISUAL (visuals->data))->visualid) {
           printf("Default visual %d\n", i);
           default_visual = visual;
        }
        i++;
        visuals = visuals->next;
    }
    gtk_widget_set_visual(GTK_WIDGET(window), default_visual);
    gtk_widget_show_all(window);
    return vbox;
}
jiri-janousek commented 6 years ago

Vala + GTK+ 3 bindings of CEF for Nuvola: cefium

Widevine DRM works (Spotify): cef_spotify

jiri-janousek commented 6 years ago

Blog post: Status of Chromium-based Port of Nuvola

jiri-janousek commented 6 years ago

New issue: Poor performance with NVidia GTX 1070 (driver 387.34) - see tiliado/valacef#1

bartlibert commented 6 years ago

From my initial tests with Google Play Music (with a subscriptions), it seems at least as fast and smooth as the WebKit version on my system (if not smoother) and playing music works as expected. Developer toolbar also does wat is has to.

However, I noticed one big problem: any action in the "overflow menu" (3 dots) does not work, but only if it is called from that menu.

So for example, when pressing "Shuffle" as seen in the screenshot below, it works... screenshot from 2018-01-04 08-06-06 ... but when clicked here it does not (neither do any of the other options). screenshot from 2018-01-04 08-06-38

Same thing for example in the "recent activity" screen (screenshots are in Dutch, but I hope it's clear enough): The "play" button works, but the overflow actions don't. screenshot from 2018-01-04 08-07-11 screenshot from 2018-01-04 08-07-23

In proper Chromium and in the WebKit version these actions work. I have not seens any logs in the terminal, nor in the developer tools console.

jiri-janousek commented 6 years ago

Thanks @bartlibert. I cannot reproduce the issue on my machine. It might disappear after I solve tiliado/valacef#1. Can you reproduce the issue also with Cefium demo browser?

flatpak run --command=Cefium eu.tiliado.NuvolaAppGooglePlayMusic//master --url="https://play.google.com/music/" --disable-flash
bartlibert commented 6 years ago

Hi, I tried testing it with Cefium and got:

[0108/125313.206216:WARNING:browser_main_loop.cc(297)] GLib-GObject: invalid cast from 'GdkWaylandVisual' to 'GdkX11Visual'

Soo... this pointed me to try everything in X11 instead of Wayland and guess what: there it works. So the issue is most likely related to running under Wayland.

jiri-janousek commented 6 years ago

Thanks, @bartlibert. Could you test again under Wayland with Cefium which comes with Nuvola 4.9.93?

bartlibert commented 6 years ago

I don't get the "invalid cast" error anymore and get into google music, but the popup menus are still not working. (No errors in terminal nor web console)

TrevorScheitrum commented 6 years ago

I don't know if this is where I should post this, or if I should create a new issue (clicking report bug took me here instead of the general 'issues' page) But here's my bug report:

OS - Linux Mint 18.3 Hardware - Dell Latitude E5470 Video Hardware - Intel Skylake Integrated Graphics Nuvola Apps Installed version - 4.9.149 Nuvola Spotify App Installed version - 2.4 Nuvola web engine installed version - Experimental Chromium 63.0.3239.109 web engine through the flatpak repo Problem - Launching Spotify through the Chrome-ported Nuvola flatpak crashes randomly during playback or just leaving the window open. Not sure how to collect more details but just wanted to report it in case it hasn't already.

Not sure if this matters but I also have the official spotify app installed through their flatpak as well, 'flatpak list' returns: Ref Options com.spotify.Client/x86_64/stable system,current eu.tiliado.Nuvola/x86_64/master system
eu.tiliado.Nuvola/x86_64/stable system,current eu.tiliado.NuvolaAppSpotify/x86_64/master system,current eu.tiliado.NuvolaAppSpotify/x86_64/stable system
io.github.Pithos/x86_64/stable system,current org.musicbrainz.Picard/x86_64/stable system,current org.freedesktop.Platform.VAAPI.Intel/x86_64/1.6 system,runtime org.freedesktop.Platform.ffmpeg/x86_64/1.6 system,runtime org.freedesktop.Platform/x86_64/1.6 system,runtime org.gnome.Platform/x86_64/3.24 system,runtime org.gnome.Platform/x86_64/3.26 system,runtime

jiri-janousek commented 6 years ago

Hello @TrevorScheitrum. Thanks for reporting your issue. Could you create a new ticket for that with debug logs from Nuvola 4.9.163?

TrevorScheitrum commented 6 years ago

Since posting this report it hasn't crashed, so i'm wondering if my system was low on ram or something. If it starts crashing again I'll try to grab debug logs and open a new issue ticket.

jiri-janousek commented 6 years ago

Recently ported:

Overral progress:

jiri-janousek commented 6 years ago

More scripts ported:

jiri-janousek commented 6 years ago

Closing in favor of #424.