effortless kodi (xbmc) / raspberry pi 2 and 3 optimization...
TRANSCRIPT
EffortlessKodi(XBMC)/RaspberryPi2and3OptimizationForHighPerformance
KillerHomeTheater
TheOnlyRaspberryPi2/3Kodi(XBMC)Step-by-StepOptimizationTipsYouWillEverNeed_________________________________________
CarolH.
HaveyougotaRaspberryPiKodiasyourhometheatersetup?Doyouwanttoimproveitsperformanceandmakeitevenmorepowerfulthanbefore?RaspberryPi’smodesthardwarespecsissignificantlybelowalow-endhometheaterPCormediacentercomputer.Butitisbydesignalow-powerhighdefinitionmediacenteratjustUSD35.Notonlythat,thereareafewtweaksyoucanapplytoimproveKodiperformancesignificantlyonRaspberryPi2or3.
ThegoodnewsisyoudonotneedtoperformhighlytechnicaltasktooptimizeRaspberryPiandKodi.Tobehonest,optimizingKodiandRaspberryPi2or3isoneoftheeasiestthingsthatyoucando.Itdoesnottakealotofexpertisetoputthesetasktogethernorisittootimeconsuming.Thatisexactlywhatyouwilllearnfromthisbook.Youwilllearnhowtomakethetweaksonhardwareandsoftwarewithoutthestressofworryingthatitistoodifficulttoputtogether.Thereisastep-by-stepguideinthisbookforeveryoneoutthere,regardlessoftheirtechnicalexperiences.Inthisbook,everystephasonephotoforyoutocomparebeforegoingtonext.So,ifyouwanttobeginmakingyourveryownoptimizationwithlittletonoeffortatall,thenlet’sstartworking!
EffortlessKodi(XBMC)/RaspberryPi2and3OptimizationforHighPerformanceKillerHomeTheater1stEdition
byCarolH.(VisitmywebsiteforevenmoreinfoonKodihttp://shaolinseo.com)
Copyright©2016CarolH.Allrightsreserved.Allrightsreserved.Nopartofthispublicationmaybereproduced,distributed,ortransmittedinanyformorbyanymeans,includingphotocopying,recording,orotherelectronicormechanicalmethods,withoutthepriorwrittenpermissionoftheauthor,exceptinthecaseofbriefquotationsembodiedincriticalreviewsandcertainothernon-commercialusespermittedbycopyrightlaw.
DISCLAIMERAllrightsreserved.Nopartofthispublicationortheinformationinitmaybequotedfromorreproducedinanyformbymeanssuchasprinting,scanning,photocopyingorotherwisewithoutpriorwrittenpermissionofthecopyrightholder.DisclaimerandTermsofUse:Efforthasbeenmadetoensurethattheinformationinthisbookisaccurateandcomplete.However,theauthorandthepublisherdonotwarranttheaccuracyoftheinformation,text,andgraphicscontainedwithinthebookduetotherapidlychangingnatureofscience,research,knownandunknownfacts,andtheinternet.Theauthorandthepublisherdonotholdanyresponsibilityforerrors,omissions,orcontraryinterpretationofthesubjectmatterherein.Thisbookispresentedsolelyformotivationalandinformationalpurposesonly.Thereaderisresponsibleforhisorherownactionsandtheauthordoesnotacceptanyresponsibilitiesforanyliabilitiesordamages,realorperceived,resultingfromtheuseofthisinformation.Thetrademarksthatareusedarewithoutanyconsent,andthepublicationofthetrademarkiswithoutpermissionorbackingbythetrademarkowner.Alltrademarksandbrandswithinthisbookareforclarifyingpurposesonlyandaretheownedbytheownersthemselves,notaffiliatedwiththisdocument.
KODIisatrademarkofXBMCFOUNDATION;
RaspberryPi®isatrademarkoftheRaspberryPiFoundation;
OSMC®isaregisteredtrademarkofSamNazarkoTradingLtd;
ContentsKillerHomeTheaterwithRaspberryPi2/3
RaspberryPi2and3Introduction
RaspberryPi2and3Comparison
OverclockingRaspberryPi
OverclockingRaspberryPi2
OverclockingRaspberryPi3
SelectRightMicroSDforRaspberryPi
IntroductiontoKodi
KillerHomeTheaterOptimization
VideoCache
EasyAdvancedSettingAddon
OptimizeKodiSettings
cachemembuffersize
buffermode
readbufferfactor
FinalSettings
KillerHomeTheaterwithRaspberryPi2/3Thankyouforpurchasingthisbook.MostlikelyyoualreadyownaRaspberryPihometheaterbeforebuyingthisbook.Butifyoustillinthestageofthinkingtogetalowpricehighqualityhometheater,checkoutmypreviousbook“EffortlessKodi(XBMC)InstallationwithRaspberryPi2and3:TheOnlyRaspberryPi2/3Kodi(XBMC)Step-by-StepInstallationGuideYouWillEverNeed”2ndEdition.
Thebesthometheatermediaboxissmallsize,quietoperatingmodeandmostimportantly–inexpensive!Thecreditcardsize,USD35RaspberryPi2and3istheperfectchoiceforyou.Notonlythat,youcanperformhardwareandsoftwareoptimizationtothismediaboxeasilyandgetbestperformanceoutfromthisbudgetdevice!
YoucanpurchasetheRaspberryPifromAmazonhere
RaspberryPi2board
RaspberryPi3board
RaspberryPi2and3Introduction
TopviewofRaspberryPi2ModelB.
TopviewofRaspberryPi3ModelB.AlmostthesameasRaspberryPi2exceptsomelabelssuchastheonehighlitedandsomesmallcomponents.
TheRaspberryPi2ModelBwasreleasedinFeb2015outandit’sreallyamazing!Itdecodes1080pH.264HDvideosmoothly,andtheKodiuserinterfaceisveryresponsiveonRaspberryPi2thankstoitsupgradedprocessor.
Ayearlater,RaspberryPi3wasintroducedanditlooksandfeelexactlythesamelikePi
2.Buttheyarenotthesame!!
OnecommendablethingisthattheRaspberryPi3willfitcasesmadefortheRaspberryPi2B.SoifyouarecurrentlyhavingRaspberryPi2andwanttoupgradetoPi3,youdon’thavetobuythecasing.
ThoseportsonRaspberryPiboardarethesameasever:FourUSB2.0ports,aEthernetconnector,full-sizeHDMIportandamicroSDslot.ThemicroSDcardactsastheharddriveforthePi.
However,onthewirelesssidetheRaspberryPi3hasWi-FiandBluetooth.Youdon’thavetheseforRaspberryPi2.BothRaspberryPishaveaGPIOpinsetandacamerainterface.Inthisbook,IwillshowyoueasystepstooptimizeRaspberryPi2and3.
RaspberryPi: 2,ModelB 3,ModelB
Quicksummary: Releasedin2015RaspberryPi.
Releasedin2016,mostadvancedRaspberryPi.
Chip: BroadcomBCM2836 BroadcomBCM2837
Processor: ARMv7quadcore ARMv8quadcore
ProcessorSpeed: 900MHz 1.2GHz
VoltageandPowerDraw:
650mA@5V 800mA@5V
GPU: DualCoreVideoCoreIVMultimediaCo-Processor
Size: 85x56mm
Memory: 1GBSDRAM@400MHz
1GBSDRAM@500MHz
Storage: MicroSDCard(notincluded)
GPIO: 40
USB2.0: 4
Ethernet: 10/100mbEthernetRJ45Jack
10/100Mbit/sEthernet802.11nwirelessBluetooth4.1
Audio: Multi-ChannelHDAudiooverHDMI,Analog
RaspberryPi2and3Comparison
Table1:TechnicalSpecificationComparisonforVariousRaspberryPi.
Stereofrom3.5mmHeadphoneJack
OverclockingRaspberryPiOverclockingRaspberryPiisverypossible.Likemanymicroprocessorchips,theARMprocessorsofRaspberryPi2and3arenotactuallygradedandsoldaccordingtotheirmaximumspeedatwhichthesafelyrun.Allsiliconchipsarenotcreatedequal.Someprocessorscanrunmuchfasterthanothers,somearemuchslowerandsomedefectiveduetoprocessvariationsduringsiliconwaferfabrication.Practicallyitwouldtakeanextraordinarilylongtimetotestandsorteveryprocessorandgradethematmaximumpossiblespeed.
Fortimetomarket,chipmakersuse“speedbinning”totestandgradeprocessorsatpredefinedspeedgrades,suchas900MHz,1.0GHzand1.2GHz.Theprocessorisfirsttestedat1.2GHz,ifitpasses,thenitwillbesoldatthisspeed.However,theprocessorcouldactuallyrunathigherspeedduringthetest,couldbe1.3GHzoreven1.4GHz.
Iftheprocessorfailsthetestat1.2GHz,thenitwillbetestedat1.0GHz.Ifitpasses,itwillbelabelledat1.0GHz.Again,thechipmightbeabletorunfrom1.0GHzupto1.99GHz!
SoitispossibletooverclockRaspberryPi2and3processorsathigherspeed!!ItisyourluckastohowfastyoucanoverclockyourRaspberry.Forexample,Icanonlyoverclockmy1.2GHzRaspberryPito1.35GHz.Therearesomeonepostedonthewebpagethattheycanoverclockto1.4GHz.Myfriend’sRaspberryPi3canonlybeoverclockedto1.25GHz.
Iftheprocessorcannotoperateattheoverclockedspeed,mostlikelyKodiwillfreezeafterfewminutesorfewhours.Soyoucanincreasethespeedevery50Mhzor100Mhzuntilyouseeproblems.
OverclockingRaspberryPi2OverclockRaspberryPi2underOSMCisveryeasyandstraight.Youdonotneedanytechnicalknowledgetodothis.ItcanbedonethroughinterfaceofOSMC.Herewego…
SwitchonyourRaspberryPi2andgotoSYSTEM,thenSystemInfo.
GotoHardwareandconfirmyourRaspberryPi2CPUspeedisat900Mhz.
NowgotoMyOSMCunderSYSTEM
NowclickontheOverclockiconatOSMCuserinterface.
UndertheNormalclocksetup,yourRaspberryPi2ARMprocessorfrequencyis900MHz,SDRAMat450MhzandCoreProcessorissetat450MHztoo.
ARMorarm_freq:ARMprocessorfrequency(ingeneraltermsspeed)inMHz.
COREorcore_freq:GPU(GraphicalProcessingUnit)frequencyinMHz.
SDRAMorsdram_freq:SDRAMfrequencyinMHz.
Over_voltage:More/LessvoltagetobesuppliedtoRaspberryPioverthedefault1.2V.RaspberryPineedmoreenergytoprocessmoreworkathigherfrequency(speed).Therefore,weneedtosupplymorevoltagewhenoverclockRaspberryPi.
Increaseordecreaseby1equalsanincrease(overvolting)ordecrease(undervolting)involtageof0.025V.
NOTE:DONOTsetover_voltageabove6.Valuesabove6areonlyallowedwhenforce_turbospecified(whichsetthewarrantybit).
Thereare2typesofovervolting(akaTurboMode):Dynamic(on-needbasis)andForced(enabledatalltimes).
NOTE:ForcedovervoltingvoidsthewarrantyorRaspberryPi.
GotoCustomandstarttooverclockRaspberryPi2.
Trytoplayaroundwiththe4parameters:arm_freq,sdram_freq,core_freqandover_voltage.
Example,youcanincreasethearm_freqfromoriginal900MHzto950MHz.IfyoursRaspberryPi2operatesasnormalafterlonghours,increaseitthe1000MHz.
IncaseRaspberryPi2/Kodifreezesduringoperation,rebootandtrytoincreaseover_voltageatanyvaluebelow“6”.
SettothelastsetupthatRaspberryPi2runsmoothly.AboveisthesetupofmyRaspberryPi2thatoperatessmoothlyforlonghours.
Youcanalsodirectusemysetupandincreaseordecreaseeachparametersaccordingly.
Note:KodistillshowstheoldCPUspeedduringbootup.ThenewOSMCOverclocksetupwillnottakeeffectuntilyourebootRaspberryPi2.
Goaheadandrebootyoursystemnow.
NowCPUisoverclockedtonewsetup.
Goodlucktoyou!
OverclockingRaspberryPi3OverclockingRaspberryPi3supposedtobeaseasyasRaspberryPi3.However,atthetimeIamwritingthisbook,OSMCVersion“2016.02-3”isnotsettingRaspberryPi3correctly.
Thereisstillanothermethod,involvingchangingthecontentofaconfigurationfileonmicroSDcard,thatcanalsoapplytoRaspberryPi2.
SwitchonyourRaspberryPi3,gotoSYSTEMandclickSystemInfo.
SothehardwareisARMprocessorisrunningat1.2GHz.
ButifyougotoSYSTEM->MyOSMC,itisactuallyRaspberryPi2setup.However,the
processorisrunningat1.2GHzasdetectedbyKodi.
Theproblemiswearenotabletoadjustthearm_freqbeyond1200thusnowayoverclockRaspberryPi3usingthisinterface.
TakethemicroSDcardoutfromRaspberryPi3.
InsertentireadapterintoSDslotofyourPC/laptop
FindtheSDCard.
Thefilewearelookingforisconfig.txt.
Toeditthisfile,youneedatexteditoronPC.YoucanuseNotepadorNotepad++.DonotuseMicrosoftWord.
Asyoucansee,thisisthefilethatsettheactualspeedofmicroprocessorandothercomponents.Thearm_freqissetat1200,whichisdetectedbyKodi.
Youcanchangearm_freqfrom1250,1300to1350andover_voltagefrom1,2,until6.
Formycase,Isetarm_freqfrom1350andover_voltageto2afterafewtesting.Fornow,myRaspberryPi3runssmoothlywithoutproblemsat1.35GHz.Again,goodlucktoyou!Happyoverclocking!
SelectRightMicroSDforRaspberryPiGettingtherightmicroSDcardalsoimportanttoboostupRaspberryPiperformance.
ThespeedofmicroSDisratedbyaclassnumberfrom2to10.Class2istheslowestandisgoodfortakingpicturesandstoringthemsincethereisnoneedtotransferlargeamountsofdataquickly.Class10isthefastestandisusedinvideoequipmentsincetheycantransferdataquicklywithnobuffering.
Ihaveuseda8GBClass4microSDonmyXiaoMiTVBoxanditwasslow.SoClass10isrecommended.
RaspberryPi2and3basicallyuseaMicroSDcardasaharddriveandtostoreanyinformation,frombootuptoexecutionofKodicodeandmoviestreaming.Forthisreason,aclass10MicroSDcardinyourRaspberryPiisverymuchrecommended.
Also,thereisaseparate,evenfastercategorycalledUHSClass1(forUltraHighSpeed),oftenbothareused.IfaUHSclassificationisusedthangetUHSclass1.
TheSDcardholdsallinformationforRaspberryPitorunashometheatremediabox.SosmallcapacitySDcardsarenotgoodenoughforthisTVbox.TheminimumsizetorunKodiisabout4GB.Soatleastgeta8GBmicroSDcard.However,themarketisnowmovingtohighercapacityand8GBmicroSDcardisquitedifficulttofind.ThelargestsizedmicroSDcardaRaspberryPicanuseislistedas32GBalthoughsomepeopletalkingaboutusinga64GBSDcardwithnoproblems.
ThisisonethemostimportantconsiderationstogetarightmicroSDcardforRaspberryPiasmediabox.WearlevelingiswhenthesamespotonaSDcardisnotwrittentooverandoveragainwhenthereisanotherspacetowriteto.ThisfeaturecanextendsthelifeofaSDcardsincemultiplespotsarewrittentoandfrominsteadofthesameopenspotoverandoveragain.MicroSDcardscomewithwearlevellingarecommonlymoreexpensive.
Hereismyrecommendations:
SelectClass10MicroSDwithminimum8GBand80MB/sreadforbettervideoperformance.InmycaseIpurchasedSanDiskExtreme16GB80MB/sreadand30MB/swritespeedClass10MicroSDasbelow.
SanDiskExtreme16GBMicroSDinoriginalpackage.
However,ifbudgetisnotamajorconcerntoyou,getabettermicroSDtoboostupthehardwareperformance.FormyRaspberryPi3,IamusingSanDiskExtremePro32GB95MB/sreadand90MB/swritespeedClass10MicroSDasbelow.
SanDiskExtremePro32GBMicroSDinoriginalpackage.
YoucanpurchaseSanDiskMicroSDfromhere
SanDiskExtremePro32GB
SanDiskExtreme16GB
IntroductiontoKodiKodi,formerlyknownasXBMC(XBoxMediaCenter),isanaward-winningfreeandopensourcecross-platformsoftwaremediaplayerandentertainmenthubfordigitalmediaforHTPCs(HometheaterPCs).KodicanrununderKodibuntu,Android,iOS,Linux,MacandWindows.Kodidevicesusingaremotecontrolastheprimaryinput.Itsgraphicaluserinterface(GUI)allowstheusertoeasilybrowseandviewvideos,photos,podcasts,andmusicfromaharddrive,opticaldisc,localnetwork,andtheinternetusingonlyafewbuttons.
TheKodiprojectismanagedbythenon-profitXBMCFoundation,anddevelopedbyvolunteerslocatedaroundtheworld.Sinceitscreationin2003morethan500softwaredevelopershavecontributedtoKodi,andaround60developersonregularbasis.Also200-plustranslatorshaveworkedtoexpanditsreach,makingitavailableinmorethan72languages.
Kodicomeswithdefaultsettingwhichassumeminimumhardwarecapabilities.Inthiscase,wecanchangethesettingtooptimizeKodi.
KillerHomeTheaterOptimizationWecanchangemanysettingsatKoditooptimizeitsperformance.However,themostimportantpartisincreaseKodivideocache.IfyouwouldliketoknowwhatareothersettingthatcanhelptooptimizeKodiperformance,pleasevisitmywebsiteathttp://shaolinseo.comformoreinformation.
Cacheisanytemporarydatathatisstoredonadevicesothatitcangetdatafaster.Thiscacheisused,asneeded,andthenclearedaftereachuse.Soifthereareanyinterruptionsintransmissionqualityornetworkspeed,itwon’tbringyourvideotoascreechinghalt.
VideoCacheVideocacheisthecacheusedforplayingbackvideosstreamingfromtheInternet(ifyourmediaboxreceivestreamingdatadirectfrominternet)orsomewhereelseonyourlocalnetwork(ifyourmediaboxreceivestreamingdatafromlocalstoragesuchasNFS).
KodiwillusesystemRAM(1GBforbothRaspberryPi2and3)inordertostoreafewsecondsofthefile.SincesystemRAMisthefastesttypeofstorageavailableonjustaboutanycomputersystem,thisisgoingtobeyourbestperformanceoption.
KodiisdesignforsystemwithlittleRAMsuchas1GB.Thedefaultvideocacheissetto60MB.Ifyouhavenetworkstabilityissues,oratroublesomeWi-Ficonnection,thiswillbeyourbestbetforimprovingKodivideoplaybackproblems.
Tochangetheabovedefaultsetting,weneedtoEasyAdvancedAddontocompletethetask.Wedonotneedtodirectchangeafilecalledadvancedsettings.xmlinyourmicroSD.Justusethisaddontogetthejobdone.
EasyAdvancedSettingAddonToinstallEasyAdvancedSettingAddon,dothefollowing:
GotoSYSTEMandclickFileManager
ClickAddsource
AtAddFilesSources,enterhttp://fusion.tvaddons.ag
Enteranameforthisrepository,examplefusion
HitOK.
FilemanagershowsFusionissuccessfullyadded.
NowgotoSYSTEM,clickSettings.
ClickonAdd-ons
ClickInstallfromzipfile
Clickonfusion
Clickxmbc-repos
Clickenglish
ScrolldownandfindrepositoryKinkin-x.x.zip.Clickonit.
WaituntilKinkinsREPOisfullyinstalled.
NowgotoInstallfromrepository
SelectKinkinsREPO
SelectProgramAdd-ons
Yes,that’stheEasyAdvancedSettingsthatwearelookingfor.Clickonit.
ClickInstall
Waituntilthisaddonisenabled.YoucanopentheaddonhereorgotoPROGRAMS.
GotoPROGRAMS
NowwehavetheEasyAdvancedSettinginstalled.ItistimetochangethesettingtooptimizeKodi.Clickthisaddon.
OptimizeKodiSettingsSonowwehavethetooltochangeKodisettings.Let’sdoit.
GotoEditSettings
GotoNetworkSettings
GotoNetwork
Thosehighlightedabovearethekeyparameterswewanttochange.
Beforewemoveon,herearemeaningsoftheparameters:
cachemembuffersizeKodiallocates60MBforcachebydefault.Ifweincreasecachevideos,thenwehavelessvideobufferingissue.
FirstweneedtoknowquantityofRAMavailableforustobeusedasvideocache.
GotoSYSTEM->SystemInfo->Hardware.
RaspberryPi2and3have1GBRAM.Duringoperation,someareusedbyOSMCandKodi.
Sowehave733MBthatcanbeused.Wecansafelyuse30%ofthesememoryasvideocache,whichisaround220MB.
Toallocate220MBascache,weneedtokeyin220x1024x1024=230686720bytesinthesystem.
Alternatively,youcouldsetthecachemembuffersizeto0,whichwouldforceKoditouseyourlocalstorage(microSDCard)forcachingvideos.Inthiscase,thecachesizeislimitedbytheamountoffreespaceavailable,whichlikelymuchlargerthatRaspberryPi’sRAM.
Thecachewillbeautomaticallyclearedandfreeupthememoryuponstoppingthevideo.Notethatthiswillincreasetheread/writeoperationonyourSDcard,whichmayreduceitslifespan.AgoodSDcardwithhigherclassratingisdefinitelyrecommended.Buttrytoavoidthisapproachifyoucanunlessyouhaveagoodreason.
buffermodeThebuffermodesetswhatvideossourceKodiwillcache.Thedefaultis0,whichwillcachealltypesofvideosourcefromtheinternet(http,FTP,WebDAV,etc.).Thevaluesare:
1–Bufferallvideos,includinglocalvideos.IfyouexperienceKodistutteringwhileplayingvideosfromyourlocalnetworkstorage,thenchoose1.
2–Bufferonlytrueinternetstreams(http,strm,etc.)–Recommended.
3–Nobuffer
readbufferfactorThedefaultvaluesetbyKodiis1.0,whichwillmakeitcachealittleabovewhatisneededtoplayitback.Thehigherthevalue,themorevideoKodicacheahead.Thissettingaffectshowmuchofyournetworkbandwidthishoggedtocachethevideo.
Forsmoothvideostreaming,thisshouldtakepriorityoveranyothersetting.Sosettinga2.0,3.0,or4.0willthatmanytimeshigherbandwidthusage.Inmostcasessettingitat4.0or5.0shouldnotcauseanyissues.However,ifyounoticeanyspikesinCPUusageornetworkbandwidthunavailabilityforotherdevicesthenreducethereadbufferfactorvalue.
Asyoucanseefromthephoto,Kodicachesmuchaheadaftersettingreadbufferfactorto5.
FinalSettingsSelectcachemembuffersize–setto715827200bytes
Clickbuffermode–Changethevalueto2
Clickreadbufferfactor–Changethevalueto5
IMPORTANT:Backout3timesandremembertoWriteXMLFiletosaveyoursetting.Elsetheoldsettingstillineffect.
THATISIT!!
YouhaveoptimizeRaspberryPi2/3andKodifrombothhardwareandsoftwareperspective.Enjoyyourhighperformancebudgetmodiabox.
TofollowupwithKodiAdd-ons,pleasevisitmywebsiteathttp://shaolinseo.com.
Thankyousomuch.
CarolH.