Solved Kodi performance on FreeBSD 11

Hello everybody,

first of all, I am very new to the FreeBSD world, especially desktop stuff so please excuse me if I ask some dumb question or the solution is obvious.

I have recently decided to use FreeBSD for my HTPC. It is really just a simple system with Xfce, firefox, NFS mounted shares and Kodi media center. Since my hardware is Intel Pentium 4th generation (Haswell), I had to use FreeBSD 11 CURRENT, since in stable my CPU is not supported.

Everything worked out of the box (really loving FreeBSD so far), installation was smooth, but only thing not working is Kodi. It does start and work normally, but the performance is really bad - GUI and video playback is around 10 FPS (I just approximated this, not exact measurement) and it is practically unusable.

I have tried tweaking some X parameters and some kernel tuning, getting inspiration from various tutorials, but with no luck. Performance of X and Xfce is fine, playback with mplayer of fullHD videos is fine, Youtube and everything just works, only Kodi shows this kind of performance issues.

My hardware is Intel Pentium G3220 mounted on ASRock H81M-HDS with 2GB DDR3 Kingstone RAM. Please let mi know what config files might be of help and I will post them here.

Thanks very much for your time!
Johny
 
If you have not already, go read the Xorg Configuration section of the Handbook.

When talking about X, we always ask to see the X configuration files, if any: xorg.conf or the files in xorg.conf.d. You might have those files in /etc/X11, but to keep FreeBSD's separation of base and third-party software, they should really be in /usr/local/etc/X11/. These files can be posted in a message with [code] tags.

We also like to see /var/log/Xorg.0.log. This file is usually too large to post in a message, so people often use www.pastebin.com or some similar upload site and post the link.
 
Thanks for such a quick responses!

Joe White - I tried adding my user to video group, but unfortunately with no effect :-(

wblock@ - I am attaching xorg.conf and link to Xorg.0.log below (I currently have only one in /etc/X11, but plan to use /usr/local/etc/X11 after finishing up with configuration). I am also attaching my rc.conf, sysctl.conf, and /boot/loader.conf, since I tweaked some parameters there according to tutorial at https://cooltrainer.org/a-freebsd-desktop-howto/.

Thanks very much!

/var/log/Xorg.0.log
http://pastebin.com/hhbDwYFz

/etc/X11/xorg.conf
Code:
Section "ServerLayout"
   Identifier  "X.org Configured"
   Screen  0  "Screen0" 0 0
   InputDevice  "Mouse0" "CorePointer"
   InputDevice  "Keyboard0" "CoreKeyboard"
   Option    "AIGLX" "true"
EndSection

Section "Files"
   ModulePath  "/usr/local/lib/xorg/modules"
   FontPath  "/usr/local/share/fonts/misc/"
   FontPath  "/usr/local/share/fonts/TTF/"
   FontPath  "/usr/local/share/fonts/OTF/"
   FontPath  "/usr/local/share/fonts/Type1/"
   FontPath  "/usr/local/share/fonts/100dpi/"
   FontPath  "/usr/local/share/fonts/75dpi/"
EndSection

Section "Module"
   Load  "dbe"
   Load  "dri"
   Load  "dri2"
   Load  "extmod"
   Load  "record"
   Load  "freetype"
   Load  "bitmap"
   Load  "type1"
   Load  "glx"
EndSection

Section "InputDevice"
   Identifier  "Keyboard0"
   Driver  "kbd"
EndSection

Section "InputDevice"
   Identifier  "Mouse0"
   Driver  "mouse"
   Option    "Protocol" "auto"
   Option    "Device" "/dev/sysmouse"
   Option    "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
   Identifier  "Monitor0"
   VendorName  "Monitor Vendor"
   ModelName  "Monitor Model"
EndSection

Section "Device"
  ### Available Driver options are:-
  ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
  ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
  ### <percent>: "<f>%"
  ### [arg]: arg optional
  #Option  "NoAccel"     # [<bool>]
  #Option  "AccelMethod"     # <str>
   Option   "AccelMethod" "EXA"
  #Option  "Backlight"     # <str>
  #Option  "DRI"     # <str>
   Option   "DRI" "true"
  #Option  "ColorKey"     # <i>
  #Option  "VideoKey"     # <i>
  #Option  "Tiling"     # [<bool>]
  #Option  "LinearFramebuffer"    # [<bool>]
  #Option  "SwapbuffersWait"     # [<bool>]
  #Option  "TripleBuffer"     # [<bool>]
  #Option  "XvPreferOverlay"     # [<bool>]
  #Option  "HotPlug"     # [<bool>]
  #Option  "ReprobeOutputs"     # [<bool>]
  #Option  "XvMC"     # [<bool>]
  #Option  "ZaphodHeads"     # <str>
  #Option  "TearFree"     # [<bool>]
  #Option  "PerCrtcPixmaps"     # [<bool>]
  #Option  "FallbackDebug"     # [<bool>]
  #Option  "DebugFlushBatches"    # [<bool>]
  #Option  "DebugFlushCaches"     # [<bool>]
  #Option  "DebugWait"     # [<bool>]
  #Option  "BufferCache"     # [<bool>]
   Identifier  "Card0"
   Driver  "intel"
   BusID  "PCI:0:2:0"
EndSection

Section "Screen"
   Identifier "Screen0"
   Device  "Card0"
   Monitor  "Monitor0"
   SubSection "Display"
     Viewport  0 0
     Depth  1
   EndSubSection
   SubSection "Display"
     Viewport  0 0
     Depth  4
   EndSubSection
   SubSection "Display"
     Viewport  0 0
     Depth  8
   EndSubSection
   SubSection "Display"
     Viewport  0 0
     Depth  15
   EndSubSection
   SubSection "Display"
     Viewport  0 0
     Depth  16
   EndSubSection
   SubSection "Display"
     Viewport  0 0
     Depth  24
   EndSubSection
EndSection

Section "Extensions"
   Option "Composite" "Enable"
EndSection

/etc/sysctl.conf
Code:
kern.ipc.shmmax=67108864
kern.ipc.shmall=32768

kern.sched.preempt_thresh=224

kern.maxfiles=200000

hw.syscons.bell=0

kern.ipc.shm_allow_removed=1

vfs.usermount=1

/etc/rc.conf
Code:
hostname="htpc"
ifconfig_re0="DHCP"
sshd_enable="YES"
ntpd_enable="YES"
ntpd_flags="-g"
powerd_enable="YES"
dumpdev="NO"
nfs_client_enable="YES"

/boot/loader.conf
Code:
kern.vty=vt
loader_logo="beastie"

kern.ipc.shmseg=1024
kern.upc.shmmni=1024
kern.maxproc=10000

fuse_load="YES"
coretemp_load="YES"
tmpfs_load="YES"
aio_load="YES"

libiconv_load="YES"
libmchain_load="YES"
cd9660_iconv_load="YES"
msdosfs_iconv_load="YES"

snd_driver_load="YES"
 
The auto-generated xorg.conf is not doing anything useful, and I suggest moving it out of that directory or deleting it. It is best to let X autoconfigure itself at runtime. If any non-default settings are actually needed, they can be added in individual files in the /usr/local/etc/X11/xorg.conf.d/ directory. The Handbook Xorg Configuration section shows some examples of that.
 
Thank you for your advice, I have read the handbook, but I will look into it more thoroughly.

As for the actual problem, it is now kinda solved for me, but I don't know exactly how :). It just started working, Kodi is now smooth and performing very well. I did number of experimenting with the system, but most notably installed an smplayer (I had mplayer already installed) with a bunch of its dependencies and also configured the Slim login manager and started X via it (I dont believe this to be the cause, since it should AFAIK just run whatever is in xinitrc.

So the issue is resolved for me, but I can't say exactly what was the problem.

Thanks anyway for your responses!
 
Back
Top