sigmaxipi / chromium-for-stadia

Quick hack to get Google Stadia running on unsupported Android devices
155 stars 19 forks source link

Make vp9 codec to run everytime on chromium #11

Open zzepto opened 4 years ago

zzepto commented 4 years ago

Hi, Is it possible to make chromium to force vp9 codec instead of h264? There is a script for tampermonkey on reddit but i didnt find a way to make it work on nvidia shield. Your apk is working great but the picture on nvidia shield chromium is muddy, i have tried this script on laptop and the picture is very clear now. So im sure chromium uses h264 codec

vrodriguezf commented 4 years ago

I use this extension in chromium-dev in Linux with hardware acceleration enabled and it looks better to me too while in VPN. Can you install chromium-dev in nvidia shield?

zzepto commented 4 years ago

I use this extension in chromium-dev in Linux with hardware acceleration enabled and it looks better to me too while in VPN. Can you install chromium-dev in nvidia shield?

I will try but this build is excellent for dualshock4 gamepad as all buttons are correctly working even if controller connected to shield which utilize xbox mappings

vrodriguezf commented 4 years ago

Btw how can you check in Chromium that Stadia is actually running VP9?

zzepto commented 4 years ago

Btw how can you check in Chromium that Stadia is actually running VP9?

I guess with tampermonkey

https://www.reddit.com/r/Stadia/comments/eimw7m/tampermonkey_monitor_your_stream/

vrodriguezf commented 4 years ago

Thanks!

And another one: How can I check that VP9 is running with hardware acceleration?

zzepto commented 4 years ago

Thanks!

And another one: How can I check that VP9 is running with hardware acceleration?

Cant help you with that. Try to contact this guy, he might be able to add hw acceleration check in the next version https://chrome.google.com/webstore/detail/stadia%20-extension/bbhmnnecicphphjamhdefpagipoegijd

vrodriguezf commented 4 years ago

I will, thx!

sigmaxipi commented 4 years ago

It should already be doing this. I had to put in a hack at https://github.com/sigmaxipi/chromium-for-stadia/blob/master/chromiumForStadia.diff#L146 that forced the codec to work around https://github.com/sigmaxipi/chromium-for-stadia/issues/3. That code runs

if (key == "video_codec_implementation_by_codec_key" && value == "{\"vp9\":\"libvpx\"}") {
    return setItem(key, "{\"vp9\":\"ExternalDecoder\"}", exception_state);
}

which should force VP9. If you can figure out how to get an Chrome Dev console on the Shield, you should be able to verify the codec. There may be some other issue resulting in a muddy picture on that device.

vrodriguezf commented 4 years ago

Thanks!

So, if I use getItem in a Chromium console (desktop version) I should be able to monitor the current codec being used?

sigmaxipi commented 4 years ago

I don't think localStorage contains the current codec. I think it just has the list of supported ones. The JS snippet at https://www.reddit.com/r/Stadia/comments/eimw7m/tampermonkey_monitor_your_stream/ shows how to extract the current codec. If you run that bit of JS code in your dev console, you should be able to get the active codec.