Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brave Ads are not delivered on Wayland #13833

Closed
tmancey opened this issue Jan 29, 2021 · 25 comments
Closed

Brave Ads are not delivered on Wayland #13833

tmancey opened this issue Jan 29, 2021 · 25 comments

Comments

@tmancey
Copy link
Contributor

tmancey commented Jan 29, 2021

Description

Steps to Reproduce

  1. View an ad

Actual result:

Ad is not delivered

Expected result:

Ad should be delivered

Reproduces how often:

Easily reproduced

Brave version (brave://version info)

Version/Channel Information:

  • Can you reproduce this issue with the current release? Yes
  • Can you reproduce this issue with the beta channel? Yes
  • Can you reproduce this issue with the nightly channel? Yes

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields? N/A
  • Does the issue resolve itself when disabling Brave Rewards? N/A
  • Is the issue reproducible on the latest version of Chrome? N/A

Miscellaneous Information:

Brower state changed to onunidle and Browser state changed to onidle do not appear in the logs. Investigate why these events are not triggered from Chromium.

@tmancey tmancey added the needs-investigation A bug not 100% confirmed/fixed label Mar 6, 2021
@tmancey tmancey changed the title Browser state changes are not recorded for Brave Ads on NixOS Linux Browser state changes are not recorded for Brave Ads on Wayland Jul 30, 2021
@tmancey tmancey changed the title Browser state changes are not recorded for Brave Ads on Wayland Brave Ads are not delivered on Wayland Jul 30, 2021
@Digitalone1
Copy link

Since Chromium does not have Wayland native support yet, an investigation on how Xwayland works might help.

Native support will be implemented in the future by Ozone platform.

@kcalvelli
Copy link

Since Chromium does not have Wayland native support yet, an investigation on how Xwayland works might help.

Native support will be implemented in the future by Ozone platform.

Sure it does. This is an issue when running Brave with --enable-features=UseOzonePlatform --ozone-platform=wayland

@Digitalone1
Copy link

It seems this issue isn't making progress. Anyway I don't understand a thing. Wasn't custom icon notification supposed to resolve this problem on Wayland?

Are custom notifications enabled or they're still in testing stage?

@tmancey
Copy link
Contributor Author

tmancey commented Sep 16, 2021

@kcalvelli are you saying that the issue only occurs when running Brave with --enable-features=UseOzonePlatform --ozone-platform=wayland?

@kcalvelli
Copy link

@kcalvelli are you saying that the issue only occurs when running Brave with --enable-features=UseOzonePlatform --ozone-platform=wayland?

In my experience, this is an issue when running with those flags in a native Wayland session (where GDK_BACKEND=wayland). I have not tested XWayland (where GDK_BACKEND=x11). It may also be an issue there.

@Digitalone1
Copy link

It's an issue also for GDK_BACKEND=x11

Tons of following lines in brave://rewards-internals/

ERROR:publisher.cc(774)] Publisher info not found

@tmancey
Copy link
Contributor Author

tmancey commented Sep 19, 2021

This log entry is not related to ad delivery

@kcalvelli
Copy link

Installed 1.30.86 today, and decided to run Brave in a Wayland session native GDK_BACKEND=wayland /usr/bin/brave-browser-stable --enable-features=UseOzonePlatform --ozone-platform=wayland %U. To my surprise, I received ads. They were custom, not native and the placement was right in the middle of the browser. But there were ads!

@Digitalone1
Copy link

So the problem is not resolved, but the custom ads are a workaround.

@Digitalone1
Copy link

This is custom, right?

custom_ad

@AdnanHodzic
Copy link

Installed 1.30.86 today, and decided to run Brave in a Wayland session native GDK_BACKEND=wayland /usr/bin/brave-browser-stable --enable-features=UseOzonePlatform --ozone-platform=wayland %U. To my surprise, I received ads. They were custom, not native and the placement was right in the middle of the browser. But there were ads!

Also running the same Brave version but installed as a snap, been running it for an hour and didn't see any ads.

GDK_BACKEND=wayland /snap/bin/brave --enable-features=UseOzonePlatform %U

@Digitalone1
Copy link

@AdnanHodzic add --ozone-platform=wayland

On my system, Gnome Wayland, it's not needed to add GDK_BACKEND variable.

Anyway the screenshot I posted is a system notification ad because afterward I got a custom ad, so this seems to be resolved.

@AdnanHodzic
Copy link

AdnanHodzic commented Sep 29, 2021

@Digitalone1 yea, it seems like this doesn't work with snap package.

GDK_BACKEND=wayland /snap/bin/brave --enable-features=UseOzonePlatform --ozone-platform=wayland %U
[2944400:2944400:0929/090459.868846:ERROR:wayland_connection.cc(180)] Failed to connect to Wayland display
[2944400:2944400:0929/090459.868986:FATAL:ozone_platform_wayland.cc(211)] Failed to initialize Wayland platform
[0929/090459.869751:ERROR:process_memory_linux.cc(42)] open: Permission denied (13)
/snap/brave/131/opt/brave.com/brave/brave-browser: line 48: 2944400 Trace/breakpoint trap   (core dumped) "$HERE/brave" "$@"

and same result is when I leave out GDK_BACKEND=wayland

Then I re-installed Brave using apt and running:

/usr/bin/brave-browser-stable --enable-features=UseOzonePlatform --ozone-platform=wayland %U

does display ads, and these definitively don't look like native ads:
alt these are definitively not native ads..

But regardless, this is how I'll start Brave from now on to have/get Brave rewards on Wayland. Thanks for sharing @kcalvelli!

@Digitalone1
Copy link

This seems definitely resolved. I got the first time a system ad and then different custom ads.

@tmancey
Copy link
Contributor Author

tmancey commented Oct 4, 2021

Great. Can you please let us know what command-line args you needed to use to get ads to work. Thanks

@Digitalone1
Copy link

Great. Can you please let us know what command-line args you needed to use to get ads to work. Thanks

On Arch with chromium based browsers there's a convention of using a text file under ~/.config for setting custom flags to append to command line execution. I set the following in brave-flags.conf

--enable-features=UseOzonePlatform
--ozone-platform=wayland

I didn't set the GDK_BACKEND=wayland env variable which I think is already set by Gnome DE by default.

Yesterday I got the last ad, then updated to the last 1.30.87 version and didn't get any ad yet. I will wait some days and report if they will show, otherwise there should be an issue with the latest version or with the packaging or brave-bin on AUR.

I used to build a custom installation from the rpm package, but yesterday I installed brave-bin from AUR which is not built on rmp, but the generic Linux package.

@AdnanHodzic
Copy link

For GNOME users on Debian based distros you can install alacarte package (apt intsall alacarte) which allows you edit menu entries for your applications. Thought that was the easiest way to add the necessary args to Brave browser.

@Digitalone1
Copy link

I just got a custom ad, so it's working also on brave-bin from AUR.

So I confirm ads are showing with the following flags:

--enable-features=UseOzonePlatform
--ozone-platform=wayland

It could be also that it's working even without these flags because the changes in 1.30 were determining to fix the issue. It has to be tested.

@sebkolind
Copy link

I had the same issue and I am running:

Arch Linux
Wayland
Sway
Mako (notifications)
Brave (brave-bin, AUR)

And I can confirm that I receive ads after setting GDK_BACKEND=wayland and adding the flags @Digitalone1 have specified in my ~/.config/brave-flags.conf file. Before doing that ads did not show

@tmancey
Copy link
Contributor Author

tmancey commented Oct 20, 2021

Thank you all for helping resolve this issue. I will discuss internally to see if there is a better way for Wayland users.

@tmancey
Copy link
Contributor Author

tmancey commented Oct 20, 2021

The default Ozone platform is still X11 for CR93 and not Wayland but we don't need to run with --enable-features=UseOzonePlatform or set it in chrome://flags

@tmancey
Copy link
Contributor Author

tmancey commented Oct 20, 2021

Closing this issue as there is a workaround above. Once again, thank you.

@tmancey tmancey closed this as completed Oct 20, 2021
@tmancey tmancey added closed/not-actionable and removed needs-investigation A bug not 100% confirmed/fixed labels Oct 20, 2021
@tmancey tmancey self-assigned this Oct 20, 2021
@Digitalone1
Copy link

The default Ozone platform is still X11 for CR93 and not Wayland but we don't need to run with --enable-features=UseOzonePlatform or set it in chrome://flags

Yes, Chrome 95 enabled ozone by default and there's no possibility to enable/disable it.

--ozone-platform=wayland is still needed and it can be checked under brave://gpu at Ozone platform

XDG_SESSION_TYPE is also set to wayland there.

@aryklein
Copy link

Thanks @Digitalone1! it worked for me as well :-)
No needed to set up GDK_BACKEND=wayland

@snirt
Copy link

snirt commented Dec 28, 2021

Works for me too :)
BTW, to edit the Brave shortcut in Gnome DE, you can add the arguments to /usr/share/application/brave-browser.desktop by editing the Exec line:
Exec={path-to-brave} --enable-features=UseOzonePlatform --ozone-platform=wayland %U

got it from here: https://stackoverflow.com/questions/8850938/how-to-add-arguments-to-links-in-gnome-shell-menu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

7 participants