Hacker News new | past | comments | ask | show | jobs | submit login
Chromium: Improve support for Nintendo Switch gamepads (googlesource.com)
61 points by pplonski86 6 days ago | hide | past | web | favorite | 59 comments

This is a pretty smart move, considering that rumors point to Google's "game streaming service" being available on every device that runs Chrome, without additional installation. That would mean a launch across:

* Windows

* Mac

* ChromeOS

* Linux

* Mobile

...overnight. Pretty compelling way to draw in new users given millions of people already own a Switch controller and could start without needing to buy Google's one.

Is there a reason to believe this is a Google strategic change instead of some individual Chromium hacker who happens to own a Switch and wants to use its controller for fun? (I don't see any more context on the bug, so it seems to be it could be either.)

The author has a @google.com email address.

I'm neither confirming nor denying this theory since I have no idea, but googlers can and do work on stuff that has nothing to do with their job function, even aside from formal 20% projects.

Also, I don't know if it's commonplace anymore, but I remember in the past a lot of people that worked on Chrome had @chromium.org addresses, too.

I feel like if it was unrelated to their official work they wouldn't use a google.com address?

No, we use our @google.com address for anything that might fall under the copyright assignment rules of our employment agreement. I won't debate whether those rules are actually enforceable - I have no idea - but if you're actually curious, the documentation is mostly public.


I see, thanks!

No, the policy is to use your google.com address, with some exceptions[1]. This confuses a lot of people, as things done for fun by one person on weekends (maybe not even official 20% time) are mixed in with official projects.

[1]: https://opensource.google.com/docs/patching/

Is this for patches that occur on your own time without company resources? Even in jurisdictions (like CA) where they can't enforce ownership over what you did?

I am neither a Googler nor a laywer, but I think yes and yes - if you don't care about copyright ownership and only licensing (which most of the time is fine - you usually only care if you either want to commercialize it later or you want to make sure either you have standing to sue infringers or Google doesn't), there's an easy process for open-sourcing something and letting Google retain ownership, and a much more involved process for confirming that Google doesn't own it. So it's easier to let Google claim copyright and not argue about whether they really have had ownership.

Some relevant links are https://opensource.google.com/docs/releasing/ for the personal-project-with-Google-copyright flow and https://opensource.google.com/docs/iarc/ for the personal-copyright flow.

That doesn't tell you much - it's not unrelated to their official work, it's just not related to company priorities. If it's a project you work on at / for work, copyright is likely still owned by the employer. See also the number of personal projects that are not official Google projects at https://github.com/google .

Sure, still could be personal interest. I certainly commit things to my employer's source control that are personally interesting and not company strategic priorities (but still correct changes to make) on occasion.

> Google's "game streaming service"

A number of companies, both startups and established game companies, have tried this. It's not taken off because you can't beat latency.

I used the Google project stream beta. I have a gigabit internet connection but live a few hundred miles from a Google data center. The experience was pretty good. Assassin's Creed is not super latency sensitive, and most of the time I didn't even notice. I'd probably prefer to stream 1080p60 than play at 30fps on a console.

I'm still not convinced it can be commercially successful though: not that many people have a good enough connection, and most people who care about games at all will already have a better way to play them.

The Project Stream test was encoded at 60FPS, but the game was only running at 30FPS.

Very easy to compress a frame that's identical to the previous one. I guess they should wind it up to 120Hz to make it look even better..

Nvidia GeForce now has millions of users. What does "not taken off" even mean? I play Fortnite in GeForce now basically all the time.

It seems like the "obvious" way for Google to do this is to have a thin client with smarts instead of just a video terminal, similar to line editing and local echo in terminals (or Mosh's predictive input). The Chromecast is a smart thin client: when you play YouTube videos, it's actually running YouTube in a Chromium instance on the Chromecast, not streaming it from your laptop or phone, even though you control it from your laptop or phone. And with Google's experience in NaCl, WebAssembly, WebGL, etc., it wouldn't surprise me if they figured out how to ship enough of the game locally but still do heavy processing on the server.

Of course, it's technically involved to make a local client for every video game they want to support. With local echo or even YouTube the scope of the problem is smaller.

Steam in-home streaming over gigabit LAN seems to be the best case scenario for this tech, and for me that is still not good enough for most of the games I like to play.

Not every gamer cares about latency.

Personal opinion: I suspect it's something most gamers care about even if they don't realise they do. If your controls feel disconnected from your gaming experience then you will get frustrated pretty quick.

If there's enough of it, yes they do.

Not being a C/C++ programmer, I wonder why they postfix their variables with "underscore"?


e.g: switch_pro_4, dualshock_ps4_, ...

It does not happen for all variables, what is this convention? :o

Google C++ style guide. It's for instance variables on classes, to distinguish from local variables.


Is there a reason for not using 'this'? I assume the risk is that you might have a scope where both this->foo and foo are valid and it's unclear which is which. You have no ambiguitiy with this->foo_, and foo (and if you forget 'this', foo_ is still clear).

I assume it's because if a dev forgets a this somewhere as a caller/accessor, you now have two problems; whereas if they forget a _, it doesn't compile.

Rules like this are usually less about risk, and more about conveying information. If I see a variable ending in "_", I immediately know to look for its definition in the class rather than the local scope.

It's unidiomatic?

> scope where both this->foo and foo are valid and it's unclear which is which

Ideally you'd turn on the compiler option to warn about scope hiding.

Maybe, though it's a common thing I've seen in setter functions or constructors:

Eg void set_foo(int foo) {this->foo = foo;}

six characters to type vs 1 ?

You can argue that either way.

Seeing 'this' unambiguously implies instance variable. Otherwise you have to spot the underscore and be aware of the conventions in the codebase. A good IDE should highlight class variables vs locals, though.

On the other hand code can get really messy with boilerplate like this everywhere, and I personally agree with you. Although I believe Google also promotes human-readable variables over less typing.

I actually think implicit "this" is a language wart. I think C++, C#, Java, Swift, etc.. would all be better languages if they required `this`. As it is, nearly every one of them ends up needing a per team naming convention to help make the code readable.

     int area(int width) {
       return width * height;
What is "height". Is it a global variable? variable in some outer scope? A member/property of the current object? Absolutely no idea.

I think it's because they're member variables. It makes them clear they're not local to the method.

At a quick glance, that does seem to be a difference with the postfixed variables! Have not yet encountered something like that in the languages I've worked with. ^^

Wait til you discover Hungarian notation?

That one I actually did encounter somewhere in high school, when a lecturer used it in Visual Basic, for some reason. xD

OT: I'm quite disappointed by the switch hardware. We're using it lightly in our family, not tugging it around or travel with it. Mostly game with it docked. Ca 1 year old at this time.

The controllers have both been plagued by the issue of dust entering the analog sticks, making it drift. You can't calibrate this away (tried it). Nor did it for us help with a spray can of air to blow it away, but perhaps I was holding it wrong (snark). Had to send it away for repair and they changed both analog sticks.

A new set of controllers (ie two sticks) also cost almost twice what an official PS4 dualshock controller costs. A single costs about as much as a PS4DS. Also, the PS4 one feels so much more robust.

For a controller that is meant to be used on the go, I find the poor dust-resistance and high cost of replacement very off-putting. I get the feeling that they, or something else on the switch, is gonna break again soon.

Puh, sorry for the rant.

A rant this is. Send them in. You‘ll get new ones without flaws.

Dragging my Switch everywhere haven’t had a single problem ever with my joy cons not with the pro Controller. Friends had problems, got their joy cons replaced - all good now.

Do you mean there is a new controller version that is more robust, or simply replaced with ones that aren't (yet) dusty?

If the latter, it's just a question of time before one has to do the same ordeal again. I'd prefer the problem not to arise in the first place. But good thing Nintendo are generous with replacements.

No, he is saying the vast majority of people don't have those issues so short of exagerating* you probably have deficient ones, and simply need to get them exchanged for new ones .

* you know, like saying "oh this issue is really bothing me but no I won't change them because it would just happen again anyway I'm sure of it even though most of others aren't affected". This is a definite case of "the user is not looking for a solution, but for a chance to rant", we've all seen it one time or another

If i put my leg between my console and the controller, it sometimes lags or don't register an input.

I still loved donkey kong and zelda and mario. I accepted, at that point, that nintendo just sucks in developing hardware.

The usb c port is btw. on the bottom. you can't play and load your switch without having something which keeps that cable away if you like to use the little stand feature of your switch. Smart right?

There was a specific hardware / RF design issue with the first-gen left joycons that caused a weak signal and resulted in lag or bad inputs. If you have that one, get it fixed. Nintendo was (at the time) fixing them all for free. There are also youtube videos of how to do the fix yourself for a couple of bucks.

They still fix it for free, at least in europe.

just as another anecdote, we have had ours since launch and haven't had much issue with the joycons. I've had a small issue with the d-pad on the official pro-controller. But we bought a 3rd party pro controller this last Christmas and although it doesn't feel like it has the same quality, its been easier to be much more precise with it.

Completely agree re: costs though. 80$ for the pro controller is 30$ too much. Joycons too.

On the other end, my kid has played my launch day version nearly every day and haven't had an issue yet.

I made a gist from the base64 patch for easier reading: https://gist.github.com/localhostdotdev/f07d7ba7ae6cac4ea1c8...

Is there a plan to support Chrome in the Nintendo Switch? The rumours (which are mainly speculation or clickbait pages) talk about just supporting the gamepads.

Maybe to add controller support for the upcoming Google game streaming console?

If the Switch used a modern webkit/blink and kept it up to date that would close some of the popular jailbreak methods.

Huh that's weird. I was a beta tester of Project Stream during the holiday season. I travelled with a Pixelbook and before my travel I tested all my controllers: PS4/Xbox/Nintendo and even an NVIDIA shield controller. Only Nintendo Pro Switch controller can be paired with the Chromebook.

The only problem is that A/B and X/Y is different between Xbox and Nintendo controller and you need to press B when the game tells you to press A. But it's a minor issue.

> The only problem is that A/B and X/Y is different between Xbox and Nintendo controller and you need to press B when the game tells you to press A. But it's a minor issue.

It's also different with Xbox and PS4 controllers. It's something I got used to a while ago after using DS3 controllers in Windows games.

Lots of PC games nowadays detect PS4 controllers and properly adjust UI (or even work with the lightbar), but I doubt Project Stream / browser controller APIs get that level of info.

I was also a beta tester of Project Stream. DualShock 4 controllers can be paired with Pixelbooks. I know because that's what I used.

The first shield controller was wifi-direct and so compatible with almost nothing. The new one is Bluetooth.

Do you know which one you had?

Well except two points:

- Switch doesn't even have a browser (it does technically, but it's internally used and you need to hack the switch to be able to use the browser)

- Nintendo could easily change this if they wanted, of course, but considering their history of tight control over the platform, I don't think they'd be willing.

This is for support for Nintendo Switch gamepads when connected to a normal computer over USB or Bluetooth, not for running Chromium itself on the Switch console.

Wonder why not write it in Go or Rust, c++ limits contribution to old developers only

None of my friends know c++

But all of them know Go or Rust.

Well the first thing to realise is that you live in a bubble.

Yes, I am in SV. It's a bubble but that shouldn't be a problem, everyone around me is Rust and Go hacker

I'm not in SV but have worked in a few different areas/industries and all are big C++ houses. I'm not old :)

I'm in a bubble too. I couldn't name a single friend or colleague who uses Rust or Go.

Just for example, scanning the jobs in my city the most in demand are c#, java and c++ in that order.

Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact