First Windows Replacement Part 2

Written by Michael Cole - September 7th 2015


So last time I covered the custom kernel to get sound working over HDMI. I'm going to cover in a little more detail where I am currently. Firstly the version of BSD I went with was FreeBSD because I have it on my laptop and it generally works well there as a desktop environment. I couldn't use PC-BSD which is specifically for the desktop mainly because of ZFS. I love ZFS but this machine has 2GB of RAM which is not enough. PC-BSD heavily depends on features of ZFS like boot environments, etc. And over all I like doing things myself, and some of the operating systems like to tweak things a little bit too much for me.

As I said above the resources of the machine are limited and the whole purpose of the machine is to play media. Method 1 for media playing is of my Plex server and method 2 is off original discs (DVD and Bluray). So I went with a lighter weight desktop environment, as I don't need copy and paste to work between apps, and standardized applications. I selected XFCE, but there are many choices. For the most part this is irrelevant to the tasks it would perform, but having lower over head will give me more RAM, etc for the things I care above. I selected Slim as my login manager. The only thing I needed to do was install the packages and add one file to my home space. So I edited ~/.xinitrc and put the following inside:

exec ck-launch-session dbus-launch startxfce4
			

After that Slim and XFCE worked perfectly together. Other than the custom kernel for HDMI audio, everything worked great at that point with the defaults.

The browser to play Plex media doesn't specifically matter as it supports HTML5. So nearly any browser will do. I really won't go into this, as you can pretty much select your favorite, make the necessary memory tweaks, etc. For example some like Chromium need you to add the following to /etc/sysctl.conf:

kern.ipc.shm_allow_removed=1
			

I also installed vlc to play media. So the first thing I noticed and this was stupidity on my part, but if I full screened video playback it would crash/core dump. Not only does it require additional memory to do full screen but it requires additional to process DVDs too. Here are the minimum settings that I had to use. Edit /etc/sysctl.conf and add:

kern.ipc.shmmax=8294400
kern.ipc.shmall=32768
			

So great core dumps and crashes are a thing of the past, but how do we play discs. While we are in a sysctl.conf mode, and this machine is a simple desktop, I added:

vfs.usermount=1
			

This lets you mount discs and other things like USB drives, etc as a normal user. But that is only part of the required changes. I made a few links just to be safe. I opened /etc/devfs.conf and added:

link    cd0     cdrom
link    cd0     dvd
link    cd0     bluray
			

I also added some other permissions. Again this is mainly for testing and since my user is in the operator group I could tighten this later. But I just wanted it to work. So I added:

perm    /dev/acd0       0666
perm    /dev/acd1       0666
perm    /dev/cd0        0666
perm    /dev/cd1        0666

perm    /dev/da0        0666
perm    /dev/da1        0666
perm    /dev/da2        0666
perm    /dev/da3        0666
perm    /dev/da4        0666
perm    /dev/da5        0666

perm    /dev/pass0      0666
perm    /dev/xpt0       0666
perm    /dev/uscanner0  0666
perm    /dev/video0     0666
perm    /dev/tuner0     0666
perm    /dev/dvb/adapter0/demux0    0666
perm    /dev/dvb/adapter0/dvr       0666
perm    /dev/dvb/adapter0/frontend0 0666
			

I wasn't going to need half of that, just found it as a generic desktop howto. I should have copied my laptop configuration now that I think about it, but for the purpose to having things open and testing this works fine. Anyways moving past that, things were working pretty good, media could now play in the browser or from a file and do so in full screen.

But still no discs. This was because of DRM on the legally owned discs. I needed libdvdcss to play DVDs. I looked for packages and it was not there, I could understand that because depending on the use of that library it could be a legal issue. But it was in ports. I have heard the warnings mixing ports and packages, but again we are just testing and I had way to many packages installed to revert now. I figured once I figured out the basic settings I could always do a clean install with ports only later, or use poudriere to build packages on a faster machine. I didn't have ports installed so I had to run:

portsnap fetch
portsnap extract
			

Once I did that I had a /usr/ports tree. So then I ran:

cd /usr/ports/multimedia/libdvdcss
make install clean
			

Some times when you install a port it pops up with some dialog boxes asking you questions. You can select the defaults if you are not sure. After this was finished I was able to start up vlc and play my legally purchased DVDs.

Bluray is much tougher. Under Windows I had PowerDVD that came with my bluray drive. And this is were I am failing. First issue was mounting. I could mount a DVD and browse the file system, but bluray had too new of a version of UDF to mount. I did some some discussion about it possibly being in FreeBSD 11 for testing. But maybe it's possible to play a disc without mounting, I was able to do it with DVDs, and XFCE could see the title of the bluray disc.

I didn't realize that vlc was not compiled with bluray support in the package. So I compiled the ports for libaacs, libbdplus and followed all the instructions I could find online. I even compiled mplayer. No matter what I did I hit road blocks.

So unfortunately this is where I'm stuck. I think since I have it all pretty much documented, I'm going to try a few different things. I want to try OpenBSD, just because I think it's a better desktop than people give it credit for. And worse case scenario, I will try Linux. Even though one of my goals is to get rid of Linux, some of the discussions I see seem to point to it being the only real option for bluray playback and it seems to be the lesser of two evils if you avoid certain distributions.