How To Enable Hardware Acceleration ... - Linux Uprising Blog

文章推薦指數: 80 %
投票人數:10人

This article explains how to enable hardware acceleration in Chromium browser running on Raspberry Pi OS (for Raspberry Pi 4). AboutSubmitATip LinuxUprisingblogHomeHowToEnableHardwareAccelerationInChromiumOnRaspberryPiOS(RPi4) Logix  Updatedon2021-06-08T11:02:02Z chromium, how-to, raspberrypi, videoThisarticleexplainshowtoenablehardwareaccelerationinChromiumbrowserrunningonRaspberryPiOS(forRaspberryPi4). ByenablingGPUacceleration,theCPUusageshouldbemuchlowerwhenplayingsupportedvideos(forexampleonYouTube).Inmycase,usingaRaspberryPi4ModelB,themainChromiumgpuandrendererprocesseswentdownfrom~160%and~130%tounder~30%and23%CPUusage(accordingtohtop)afterenablinghardwareacceleration.Asasidenote,thisisaprerequisiteforanarticleIplanonwritingsoon.RaspberryPiOScomeswitheverythingthat'sneededtorunChromiumwithhardwareaccelerationonaRaspberryPi4,butitdoesn'tworkoutofthebox.ForRaspberryPi4there'snoneedtoinstallextrapackages,enableOpenGL,andsoon,asthosearealreadyenabled.You'llonlyneedtoenablesomeChromiumbrowserflags;belowthere'salsoa"fix"forscreentearingwhichoccurswhenplayinghardware-acceleratedfullscreenvideos.I'vetestedthisusingaRaspberryPi4ModelB(usingRaspberryPiOS),soIcanonlyconfirmthisisworkingforit. Accordingto this,youmayneedtoenableOpenGLwithfake/fullKMSusingraspi-configforolderRaspberryPimodels(I'mnotsureifextrastepsarerequiredonoldermodels).Thisisn'trequiredfortheRaspberryPi4. However,sinceIcanonlytestthisonaRaspberryPi4ModelB,andIdon'tliketowritearticlesaboutthingsIcan'ttestmyself,I'monlyfocusingonRaspberryPi4andinstructionsforitinthisarticle.EnablehardwareaccelerationinChromiumbrowserrunningonRaspberryPiOS(RaspberryPi4)ToenablehardwareaccelerationinChromiumbrowserrunningonRaspberryPiOS(RaspberryPi4),followthe3steps(well,morelike2.5)below: 1.EnablehardwareaccelerationinChromiumbrowser.Enablethefollowingflagsinchrome://flags:Overridesoftwarerenderinglist:chrome://flags/#ignore-gpu-blocklistHardware-acceleratedvideodecodechrome://flags/#enable-accelerated-video-decodeGPUrasterization: chrome://flags/#enable-gpu-rasterizationRestartChromiumwhenyou'redone.2.Ensurethattheh264ifyChromiumextensionisenabled.ChromiumonRaspberryPiOScomeswithuBlockOriginandh264ifyextensionsinstalledbydefault.Makesurethath264ifyisenabled,soYouTubeusesh264-encodedvideosforwhichtheRaspberryPisupportshardware-acceleratedvideodecode.3.Optional:Fixfull-screenvideotearing.Tofixfull-screenvideotearing(fixvia),we'llneedtodisablethecompositor.Todothis,openaterminalontheRaspberryPi,andrunthefollowingcommandtoruntheconsoleversionoftheRaspberryPiSoftwareConfigurationTool:sudoraspi-configUsethe Up / Down arrowkeystonavigatethroughitsmenu,and Tab toselectbuttonslike Finish, OK or Back.Todisablethecompositor,gotoAdvancedOptions->CompositorandchooseNotodisableit.Whenyou'redone,choose Finish andrebootyoursystem.That'sit.YourChromiumwebbrowsershouldnowbehardwareaccelerated,andbeabletoperformhardware-acceleratedvideodecode.Related: HowToEnableHardwareAcceleratedVideoDecodeInGoogleChrome,Brave,VivaldiAndOperaBrowsersOnDebian,UbuntuOrLinuxMintHowtocheckifChromiumbrowserishardwareacceleratedTocheckifChromiumbrowseruseshardwareacceleration,visit chrome://gpu inChromium:Ifhardwareaccelerationisenabled,  itshouldshowallthehardwareacceleration-relatedfieldsingreen.Thisishowitusedtolookbeforeenablingtheflagsmentionedabove(sointhescreenshotbelow,hardwareaccelerationisnotenabled):Tocheckoutifhardware-acceleratedvideodecodingisworkinginChromium,playaYouTubevideo,thenpressCtrl+Shift+iwhichwillopentheChromeDevTools.Next,clickthe3verticaldotsmenufromtheupperright-handsideofChromeDevToolsandchooseMoretools->Media:InthenewMedia DevToolstab,clicktheYouTubevideoontheleft(underPlayers),thenmakesurethePropertiessub-tabisselected,andscrolldowntotheVideoDecodersection.WithChromium88+onRaspberryPiOS,theDecodername valueshouldbeMojoVideoDecoderifhardwareacceleratedvideodecodeisenabledandworking.UpuntilChromium86(I'mnotsureaboutversion87),thedecoderwasnamedMmalVideoDecoderwhenhardware-acceleratedvideodecodingwasenabledandworking.YoushouldalsonoticeyourCPUusagebeingmuchlowere.g.whenplayinga1080pvideoonYouTube.YoumayalsowanttoenableWidevineinChromiumbrowserrunningonRaspberryPiOS,whichallowsplayingNetflix,AmazonPrime,Hulu,andsoon.ShareThis:Mastodon Twitter Diaspora Reddit Telegram WhatsAppHowToInstallGNOME40OnUbuntu21.04HirsuteHippoForTestingPurposes[PPA]InstallmacOSBigSurOrCatalinaInAVirtualMachineUsingDocker-OSXRemapKeyboardAndMouseButtonsOnLinuxWithTheNewKeyMapperGUI(SupportsX11AndWayland)Pleasepostcivilandon-topiccomments.Commentingguidelines.EmptyreportthisadRecentPostsExtensionManager:SearchAndInstallGNOMEShellExtensionsWithoutUsingAWebBrowserTheme.shIsAnInteractiveTerminalThemeSelectionScript(400+Themes)UbuntuYaruThemeToLoseItsAubergineAccentColorForUbuntu22.04JammyJellyfishSetTheCurrentlyPlayingSpotifySongTitleAndAlbumCoverAsYourGNOMEWallpaperWithThisScriptHowToRunACommandOrScriptAsRootOnStartup/BootUsingsystemdorACronJobBottlesWinePrefixManagerReleasedWithStableVersioningFeature,NewConsoleForFlatpakUsersAndABottlesRuntimereportthisadEditor'sPicksHowToEnableHardwareAcceleratedVideoDecodeInGoogleChrome,Brave,VivaldiAndOperaBrowsersOnDebian,UbuntuOrLinuxMintInstallmacOSBigSurOrCatalinaInAVirtualMachineUsingDocker-OSXCreateABootableUSBDriveBySimplyCopyingTheISOToTheUSBWithVentoy(LinuxAndWindows)HowToBootToConsole(Text)ModeUsingDebian/Ubuntu,Fedora,ArchLinux/ManjaroAndMoreFFmpeg:ExtractAudioFromVideoInOriginalFormatOrConvertingItToMP3OrOggVorbisHowToInstallDaVinciResolve16.2InUbuntu,LinuxMintOrDebian(GenerateDEBPackage)HowToChangeTheGRUBBootOrderOrDefaultBootEntryInUbuntu,LinuxMint,Debian,OrFedoraWithGrubCustomizerNewOracleJava11InstallerForUbuntuOrLinuxMint(UsingLocalOracleJava.tar.gz)HowToFix`Couldnotgetlock/var/lib/dpkg/lock-open(11Resourcetemporarilyunavailable)`ErrorsHowToMountOneDriveInLinuxUsingRclone(SupportsBusinessAndPersonalAccounts)reportthisadLinuxUprisingAboutPrivacyPolicyTermsofServiceCookieInformationCookieSettingsLicenseCreativeCommonsAttribution4.0InternationalLicenseTheregisteredtrademarkLinux®isusedpursuanttoasublicensefromtheLinuxFoundation,theexclusivelicenseeofLinusTorvalds,ownerofthemarkonaworld-widebasis.BlogArchiveBlogArchiveJanuary2022(1)December2021(10)November2021(10)September2021(9)August2021(9)July2021(4)June2021(6)May2021(13)April2021(11)March2021(13)February2021(21)January2021(11)December2020(10)November2020(12)October2020(13)September2020(6)July2020(8)June2020(8)May2020(7)April2020(13)March2020(12)February2020(14)January2020(13)December2019(14)November2019(18)October2019(13)September2019(17)August2019(11)July2019(22)June2019(18)May2019(19)April2019(20)March2019(16)February2019(17)January2019(21)December2018(15)November2018(24)October2018(22)September2018(15)August2018(27)July2018(26)June2018(21)May2018(31)April2018(25)March2018(1)BlogfocusedonLinuxandFOSS.



請為這篇文章評分?