On the OpenCL front

Koop Mast, Johannes Dieterich and Oliver Hartmann made a lot of progress on OpenCL lately! A new “opencl” branch was created on GitHub, with several new ports:
  • lang/ocl-icd is an OpenCL ICD loader implementation. It is a libOpenCL.so wrapper who can manage several vendor-specific OpenCL implementations.
  • Four OpenCL implementations are being worked on:
    • Beignet (lang/beignet) is for Intel GPUs.
    • Clover (lang/clover) is for Radeon GPUs; it is part of Mesa.
    • Freeocl (devel/freeocl) and POCL rely on the CPU.
  • lang/clinfo is a simple tool (like glxinfo) who prints information about the OpenCL platform and device.
This is still experimental and can be considered of “alpha” quality. OpenCL headers are provided by several implementations, we need to handle this. Port categories are not even decided yet. But it is promising nonetheless! You can find a more detailed status on the wiki.

Status of the DRM update

The i915 kernel video driver refresh, committed two weeks ago, was enough to finally make Intel GPUs to start working with the update to the DRM device-independent code being prepared.

More than its age, the problem of our DRM kernel subsystem is its inconsistency:

  • The i915 driver matches Linux 3.5.
  • The Radeon driver comes from Linux 3.8.
  • The device-independent code is a mix of the legacy FreeBSD DRM code (sys/dev/drm) and some bits taken from an unknown version of Linux.

This makes updates very difficult to do because none of the drivers are on the same page.

The goal of this project is to bring the DRM device-independent code to Linux 3.8, the same version than the Radeon driver. It’s working well for more than a year, but couldn’t be committed because the i915 driver wouldn’t work with a newer DRM.

Thanks to the i915 update, it is working now, even if the driver only matches Linux 3.5. However, there are still some issues to review and fix:

  • In Linux, there’s a global DRM lock, mostly used during device attach/detach. In FreeBSD, the device lock was used instead. This caused many functions to be changed to avoid recursive locking (because they used the device lock). With the DRM update, I’m restoring the global DRM lock but there are still places where the locking is wrong: I need to review all of them.
  • Another problem is returned error codes. In Linux, they use negative integers. In FreeBSD, functions were modified to use positive integers. To reduce the diff, I’m restoring the negative integers inside the DRM subsystem. I just convert them to positive ones at the last moment, when the DRM subsystem interacts with other FreeBSD components. Again, this needs a thorough review.

This work is happenning in my “kms-drm-update-38″ branch on GitHub (branched from 11-CURRENT, frequently updated). Only the kernel is relevant, no need to rebuild world. Please test it as much as you can and report back to the freebsd-x11@ mailing-list!

Update to the i915 kernel driver

On Wednesday January 21th, Konstantin Belousov committed a first batch of updates to the i915 kernel video driver. Several fixes followed the initial commit.

His work brings the driver more closer to Linux 3.5 and thus includes several bug fixes and improvements to the support of generations up-to Ivy Bridge. However, Haswell and later generations are not supported yet: this will come at a later time.

Among the bugs fixed, the most annoying for users were:

  • Broken OpenGL applications (crashes, garbaged display) after one or more suspend/resume cycles. This regression appeared after the addition of hardware contexts support.
  • Backlight support which was non-functional for some people. The feedback seems positive now.

Furthermore, this driver refresh allows Jean-Sébastien Pédron to move forward with the DRM update work-in-progress. Another article will be posted on that topic.

pkg(8) passes coverity scans

At FOSDEM phk@ reminded me to always on regular basis make static analysis of the code via all possible tools available.

We did but on unregular basis and only paid attention to very critical reports And not all reports.

That is now fixed, I relaunched a few scan via coverity and I'm happy to say that the latest scan on master claims 0 defects!

Meaning that all known defects have been fixed.

I was also planning to use lint(1) as well, unfortunatly on FreeBSD lint is not supporting C99...

If I'm brave enough I may synchronise lint(1) with NetBSD which seems to have added C99 support to that tool. Or maybe someone will volunteer to do it? :)

PC-BSD 10.1.1-Release

Hey Everyone! The new version of PC-BSD is out. There are lots of improved features so check out the release notes below!

The PC-BSD team is pleased to announce the availability of 10.1.1-RELEASE!

Changes since RC2
———————————————

* Fixed an issue using auto-login in PCDM and setting incorrect locale
* Fixed a bug in user-manager allowing the deletion of the current user
* Updated GRUB to include i18n files
* Fixed an issue with invalid GPT options being displayed when
installing to a specific partition
* Updated GRUB to better auto-detect other disk-drives to chainload via
the boot menu
* Fixed various bugs in external media mounting

Changes since RC1
———————————————

* Disabled some diskid / gptid labels from installer
* Updated HandBook with additions for 10.1.1
* Fixes to Lumina desktop default settings
* Disabled the lock functionality in AppCafe
* Fixed an issue with VirtualBox modules not being loaded after install
* Updated some man pages for pbi_* commands
* Fixes to how ISO / memory disks are mounted via Mount Tray
* Fixes to Mount Tray for mounting exFAT partitions with write access
* Fixed an issue with UEFI USB media not loading GRUB correctly
* Removed pc-soundconfig utility, functionality has been merged into
pc-mixer

PC-BSD 10.1.1 notable Changes
———————————————

* Brand new system updater which supports automatic background updating
of the system
* Many improvements to boot-environments and GRUB support for a wider
variety of setups
* Support for installation to a specific GPT partition and GPT
dual-booting improvements
* Conversion to Qt5 for all desktop utilities
* Fixes to using dtrace when booted from GRUB
* Re-write of Mount Tray utility, improves mounting of external media
* Support for full-disk encryption (without an unencrypted /boot) using
GELI v7
* More packages available for installation from DVD/USB/CD images via
“PC-BSD roles“
* New OVA files for virtual machines
* Misc bugfixes and improvements to utilities
* GNOME 3.14.1
* Cinnamon 2.4.2
* Lumina desktop 0.8.1
* Chromium 39.0.2171.95
* Firefox 35.0
* NVIDIA Driver 340.65
* Pkg 1.4.4

Getting media
———————————————

10.1.1-RELEASE DVD/USB media can be downloaded from the following URL via
HTTP or Torrent.

http://www.pcbsd.org/en/download.html

Updating
———————————————

Users running on 10.1-RELEASE can now update to 10.1.1 via the normal
package updating mechanisms.

If the update cannot complete, such as when excessive pkg conflicts
exist, it is possible to grab the new PC-BSD updater from git and use
it. To do so, use the following instructions.

(As root)

# pkg update –f
# pkg upgrade –f ports-mgmt/pkg
# pkg update –f
# pkg install –f grub2-pcbsd

# git clone –depth=1 –b releng/10.1.1 https://github.com/pcbsd/pcbsd.git
# cd pcbsd/src-sh/libsh
# make install
# cd ../pcbsd-utils/pc-updatemanager
# make install
# pc-updatemanager pkgupdate

Reporting Bugs
———————————————
Found a bug in 10.1.1? Please report it (with as much detail as
possible) to our bugs database.

https://bugs.pcbsd.org

PC-BSD 10.1.1-RC2 Now Available

The PC-BSD team is pleased to announce the availability of RC2 images for the upcoming quarterly 10.1.1 release.

Please test these images out and report any issues found on our bug tracker.

Changes since RC1

* Disabled some diskid / gptid labels from installer
* Updated HandBook with additions for 10.1.1
* Fixes to Lumina desktop default settings
* Disabled the lock functionality in AppCafe
* Fixed an issue with VirtualBox modules not being loaded after install
* Updated some man pages for pbi_* commands
* Fixes to how ISO / memory disks are mounted via Mount Tray
* Fixes to Mount Tray for mounting exFAT partitions with write access
* Fixed an issue with UEFI USB media not loading GRUB correctly
* Removed pc-soundmixer utility, functionality has been merged into tray app

PC-BSD 10.1.1 notable Changes
* Brand new system updater which supports automatic background updating of the system
* Many improvements to boot-environments and GRUB support for a wider variety of setups
* Support for installation to a specific GPT partition and GPT dual-booting improvements
* Conversion to Qt5 for all desktop utilities
* Fixes to using dtrace when booted from GRUB
* Re-write of Mount Tray utility, improves mounting of external media
* Support for full-disk encryption (without an unencrypted /boot) using GELI v7
* More packages available for installation from DVD/USB/CD images via “PC-BSD roles“
* New OVA files for virtual machines
* Misc bugfixes and improvements to utilities
* GNOME 3.14.1
* Cinnamon 2.4.2
* Lumina desktop 0.8.0
* Chromium 39.0.2171.95
* Firefox 35.0
* NVIDIA Driver 340.65
* Pkg 1.4.4

Updating

Users currently running the EDGE package repo can now update their packages via the updater GUI or “pc-updatemanager” utility to be brought up to date with RC1.

Updates for users on the 10.1-RELEASE / PRODUCTION repo will be available once 10.1.1-RELEASE is announced.

Getting media

10.1.1-RC2 DVD/USB media can be downloaded from here via HTTP or Torrent.

Reporting Bugs

Found a bug in 10.1.1? Please report it (with as much detail as possible) to our bugs database.

Build just one FreeBSD port

I usually build my own packages with poudriere but it’s not fun to do on tiny boxes so I just do ‘pkg install ‘ on them and use upstream packages. One downside is, that package is build with default options. I recently ran into a situation where I wanted to change some options for just a single port.

Now, what is the minimal set of things in /usr/ports/ that I need to checkout to be able to config/build just one port?
Turns out to be:


/usr/ports/Mk
/usr/ports/Keywords
/usr/ports/Templates
/usr/ports/ports-mgmt/dialog4ports

And the port I want to actually build. Now I can ‘make config’, change the options and build/install that port without checking out entire ports tree.

Lumina Desktop 0.8.1 Released

The next version of the Lumina desktop environment (0.8.1) has just been tagged in the source tree, the FreeBSD port has been updated, and pre-built packages will be available in the upcoming PC-BSD 10.1.1 release (or earlier if you are using the “Edge” package repository).

This version includes quite a number of quality-of-life improvements, new plugins, and the usual assortment of bugfixes. There is a full breakdown of the changes below, but for most of you a screenshot (or two) is worth a thousand words.

Enjoy!

Lumina0.8.1

 

New Features:

1) New Desktop Plugin: “Audio Player”

This plugin allows the user to play audio files directly from the desktop (with playlist randomization if desired).

2) New Panel Plugin: “Home Button”

This plugin will minimize all open windows so the desktop will be completely visible.

3) New Panel Plugin: “Start Menu”

This plugin is the classical alternative to the “User Button”, and provides a simple menu for quickly launching applications.

4) New Slideshow file interactions in the Insight File Manager

When viewing an image slideshow, the user now has the options to delete the current image file, or rotate that image file clockwise or counter-clockwise (automatically updating the image file as necessary).

5) New Backend distribution customization framework.

There is a new system file (<PREFIX>/etc/luminaDesktop.conf), that can be set by the distributor of the Lumina desktop or a system administrator to provide system-wide defaults. This allows full customization of the initial desktop experience for a new user (will not change existing settings), allowing the distributor of the desktop to easily create a customized experience for their users. Along with this comes the ability for a user to reset their desktop settings back to defaults should the need arise (either system defaults or the defaults set by the Lumina project itself). This can be performed through the desktop configuration utility (in the session settings).

 

Updated Features:

1) Allow a customized user icon for the user button (this same icon will also be utilized for the user in PCDM). This option is available through the desktop configuration utility (in the session settings).

2) Have panels follow the current desktop theme by default. A customized color may still be specified through through the desktop configuration utility (in the panel settings), and any previous color setting for the panel is still saved as the customized color for that panel.

3) Have desktop plugins now follow the current theme. This allows for a much more unified look and feel, with simple user modification through locally saved modifications to any theme templates.

4) Convert the “Note Pad” desktop plugin to a file-based utility. Now all notes are automatically created in the ~/Notes directory (with the .note extension), and a generic non-note text file may also be loaded into the plugin for editing/watching. All notes in the previous format will be auto-converted to the new format the first time the new version is used. Warning: if you currently have multiple notepad plugins on your desktop, only one of them will have all the notes successfully converted to the new format. Before updating to the new version, it is a good idea to move all your notes into a single plugin instance (and remove the others) to ensure a proper conversion to the new format.

Bug Fixes:

- Fix when auto-hidden panels are re-hidden. This fixes a Qt5 bug where moving the mouse over the system tray was re-hiding the panel, preventing access to the system tray applications.

- Make the userbutton open even faster than before (auto-updates the menu in the background if applications are added/removed from the system).

- Various stability fixes involving the removal of desktop plugins.

- Filenames with multiple “.“s in them will now be properly handled through lumina-open.

- Have the log-out window appear on the current screen (instead of always the left-most screen).

- Make sure the log-out window is closed at the start of the log out procedure.

- Various other small bugfixes

 

PC-BSD 10.1.1-RC1 Now Available

The PC-BSD team is pleased to announce the availability of RC1 images for the upcoming quarterly 10.1.1 release.

Please test these images out and report any issues found on our bug tracker.

PC-BSD 10.1.1 notable Changes
* Brand new system updater which supports automatic background updating of the system
* Many improvements to boot-environments and GRUB support for a wider variety of setups
* Support for installation to a specific GPT partition and GPT dual-booting improvements
* Conversion to Qt5 for all desktop utilities
* Fixes to using dtrace when booted from GRUB
* Re-write of Mount Tray utility, improves mounting of external media
* Support for full-disk encryption (without an unencrypted /boot) using GELI v7
* More packages available for installation from DVD/USB/CD images via “PC-BSD roles“
* New OVA files for virtual machines
* Different ISO files for UEFI / BIOS installations
* Misc bugfixes and improvements to utilities
* GNOME 3.14.1
* Cinnamon 2.4.2
* Lumina desktop 0.8.0
* Chromium 39.0.2171.95
* Firefox 35.0
* NVIDIA Driver 340.65
* Pkg 1.4.4

Updating
Users currently running the EDGE package repo can now update their packages via the updater GUI or “pc-updatemanager” utility to be brought up to date with RC1.

Updates for users on the 10.1-RELEASE / PRODUCTION repo will be available once 10.1.1-RELEASE is announced.

Getting media
10.1.1-RC1 DVD/USB media can be downloaded from this URL via HTTP or Torrent.

Reporting Bugs
Found a bug in 10.1.1? Please report it (with as much detail as possible) to our bugs database.

HDMI support for Beaglebone Black: first milestone

Today for the first time I’ve got stable and correctly positioned output on HDMI monitor connected to BeagleBone Black. It involved fixing bug in AM335x LCDC controller, fixing bug in I2C controller, and a lot of experiments with register-pushing. Code requires major clean-up and is not ready for the tree yet. I’ll post patch when it’s in readable form.

IMG_0650

Fan Speed monitoring

Recently I moved a server into a proper cabinet with doors. After a few days I noticed the fans were spinning up and down. So I started investigating ways to monitor the fan speed. I figured having a graph of them long term would give me a nice way to show changes in the environment, beyond the temperature monitoring I am already doing.

I was not having much luck searching the Internet. Luckily, Darius on IRC pointed me to a project called bsdhwmon by Jeremy Chadwick, a fellow FreeBSD Developer. The server is running an older Supermicro X7SBi motherboard with a Winbond 83627HG chip which is listed on the supported page of bsdhwmon.

It was easy to setup:

  • Install bsdhwmon: pkg install bsdhwmon
  • Load the SMBus Controller driver for my motherboard: kldload ichsmb
  • Load the Generic SMB I/O Device driver: kldload smb

All I had to do from that point was run bsdhwmon:
# bsdhwmon
CPU1 Temperature 46 C
System Temperature 29 C
FAN1 10975 RPM
FAN2 11344 RPM
FAN3 7219 RPM
FAN4 7068 RPM
FAN5 0 RPM
FAN6 11065 RPM
VcoreA 1.122 V
MCH Core 1.508 V
-12V -12.672 V
V_DIMM 1.808 V
+3.3V 3.296 V
+12V 11.904 V
5Vsb 5.046 V
5VDD 4.998 V
P_VTT 1.228 V
Vbat 3.312 V

It is important to remember to add the kernel modules to be loaded at boot. Adding the following to /boot/loader.conf will take care of that:
smb_load="YES"
ichsmb_load="YES"

Note that ichsmb will load smbus, but not the smb kernel driver.

Now that I have the tools, I can monitor it at will.

Qt5 for FreeBSD/Pi

Build SD card image using crochet-freebsd with option VideoCore enabled. Mount either SD card itself of image to build host

mount /dev/mmcsd0s2a /pi

Checkout Qt5 sources and patch them

cd /src
git clone git://gitorious.org/qt/qt5.git qt5
cd qt5
git checkout 5.4.0
MODULES=qtbase,qtdeclarative,qtgraphicaleffects,qtimageformats,qtquick1,qtquickcontrols,qtscript,qtsvg,qtxmlpatterns
./init-repository --module-subset=$MODULES

fetch -q -o - http://people.freebsd.org/~gonzo/arm/rpi/qt5-freebsd-pi.diff | patch -p1

Configure, build and install Qt5 to SD card

./configure -platform unsupported/freebsd-clang -no-openssl -opengl es2 -device freebsd-rasp-pi-clang -device-option CROSS_COMPILE=/usr/armv6-freebsd/usr/bin/ -sysroot /pi/ -no-gcc-sysroot -opensource -confirm-license -optimized-qmake -release -prefix /usr/local/Qt5 -no-pch -nomake tests -nomake examples -plugin-sql-sqlite

gmake -j `sysctl -n hw.ncpu`
sudo gmake install

You need BSD-specific plugins to enable mouse and keyboard input in EGLFS mode

cd /src/
git clone https://github.com/gonzoua/qt5-bsd-input.git
cd qt5-bsd-input
/src/qt5/qtbase/bin/qmake
gmake
sudo gmake install

Build application you’d like run and install it. I use one of the examples here

cd /src/qt5/qtbase/examples/opengl/cube
/src/qt5/qtbase/bin/qmake
gmake
sudo gmake install

Unmount SD card, boot Pi, make sure vchiq is loaded

root@raspberry-pi:~ # kldload

Start application

root@raspberry-pi:~ # /usr/local/Qt5/examples/opengl/cube/cube -plugin bsdkeyboard -plugin bsdsysmouse

If you see something like this:

EGL Error : Could not create the egl surface: error = 0x3003

Or this:

QOpenGLFramebufferObject: Framebuffer incomplete attachment.

It means you need to increase GPU memory by setting gpu_mem in config.txt. Amount depends on framebuffer resolution. 128Mb works for me on 1920×1080 display.

bsdsysmouse plugin uses /dev/sysmouse by default, so you either should have moused running or specify actual mouse device, e.g.:

root@raspberry-pi:~ # cube -plugin bsdkeyboard -plugin bsdsysmouse:/dev/ums0

bsdkeyboard uses STDIN as input device, so if you’re trying to start app from serial console it should be something like this:

root@raspberry-pi:~ # cube -plugin bsdkeyboard -plugin bsdsysmouse < /dev/ttyv0

Update on ioquake/ARM for FreeBSD: controls support added

I’ve update ioquake binaries and pushed respective changes to github. New version has support for mouse and keyboard so you can actually play Quake3 on FreeBSD/Pi alas without sound. It should run out of the box on normal console. Make sure you have moused running or specify mouse device by setting Q_MOUSE_DEV environment variable, e.g.:

env Q_MOUSE_DEV=/dev/ums0 ioquake3.arm +set s_initsound 0