Solved On achieving smooth 1080p video playback through Intel HD Graphics on a low-end Celeron SoC by means of extensive knob flipping.

Last week brought a couple hardware failured to my normally stable and serene home network. The NAS went down with a bad PSU. Subsequently, a long running (since 2010) and comfy low power media pc also fell silent and would POST no more. I purchased an inexpensive Gigabyte GA-J1900N-DV3 SoC Celeron motherboard as a replacement and after numerous false starts it seems to be performing adequately at delivering 1080p video to my flat screen while also running Xfce4 without tearing.

Upon receipt of the board I pulled and replaced but found it would not completely boot. Thread 66538 indicated an issue between the J1900 and the virtual terminal console driver vt. The workaround provided worked. The computer will boot but console output ceases before obtaining a login prompt. That's fine for me since this box normally won't have a keyboard directly attached but will be accessed via SSH.

In order to implement the fix I attached the boot drive to another FreeBSD box and booted from it, made the change to /boot/loader.conf and a couple other minor config mods like renaming ethernet devices, etc. When reinstalled in the HTPC it worked as expected with the caveat about the system console blanking.

That is the only issue that I believe is FreeBSD specific with this board. The rest of the issues, judging by the many web posts and articles I read while hunting for a clue, seem to also affect Linux and other users of these low power Celeron boards and many laptops with Bay Trail Intel HD graphics.

The box had previously had ATI Radeon graphics so I set to remove that driver and install the i915kms driver. After SSH in and starting an X session everything seemed okay with Xfce4 but initially I believed the base system driver did not work well with video. The first video I attempted to play simply wouldn't. I could however fast forward throught the file. It turned out mpv was attempting to sync to the audio which I had not yet configured. After setting to the correct sysctl hw.snd.default_unit both video and audio worked but there was tearing or other artifacts on every video I tried to play. I spent most of my spare time on this for a couple days and still don't have a firm grasp on the problem but I believe it's Vsync related. I'm not going to detail all the dead ends. Numerous variations in the mpv config before and after installing drm-kmod per https://wiki.freebsd.org/Graphics allowed mpv to be configured for gpu with acceleration but invariably the video output was affected by screen tearing. When I finally stumbled into something that resulted in smooth video, Xfce4 instead became almost unusable due to tearing. Further blind poking has yielded a functional system, some of what follows is likely superfluous but it just works now!

This is FreeBSD 11.2-RELEASE-p9 with a GENERIC amd64 kernel.
Follow the instructions at the Graphics page linked above, however disregard where it says
Note: For systems that are able to take advantage of this updated DRM code you should not have to prepare an xorg.conf configuration file, nor should you install xf86-video-intel port. Our Xorg should autodetect the driver, and utilize the modesetting Xorg driver and glamor driver.

Instead:
pkg install xf86-video-intel
pkg install multimedia/libva-intel-driver
create a /usr/local/etc/X11/xorg.conf.d/driver-intel.conf file containing
Code:
Section "Device"
   Identifier  "Intel Graphics"
   Driver      "intel"
   Option "DRI" "3"
   Option "AccelMethod" "UXA"
EndSection

I rebuilt multimedia/mpv from ports with optiond VAAPI: on, VDPAU: off, VULKAN: off, WAYLAND: off and X11: on.
~/.config/mpv/config editted to include the these two lines
Code:
vo=gpu
hwdec=vaapi

The Xfce4 compositor is off.

pkg install x11-wm/compton
~/.config/compton.conf currently contains
backend = "xrender";
paint-on-overlay = false;
glx-no-stencil = true;
glx-no-rebind-pixmap = false;
vsync = "drm";
shadow = false;
fading = false; # Fade windows during opacity changes.
no-fading-openclose = true; # Fade windows in/out when opening/closing
wintypes:
{
tooltip = { fade = false; shadow = false; };
};


After compton seemingly fixed the Xfce4 tearing problem I rebooted, played a video and made sure everything still worked before I wrote this up but I didn't enter compton into my startup script. So, it's working just fine without running the compositor.

That's all for now. I hope it helps:) and thanks FreeBSD for being there so I can learn do it 'my' way.
 
Back
Top