G5: Simple Dual Monitor Setup


Since my last post dealt with graphics, I thought I would continue on that same subject although this time the topic should be a little more straightforward.

Before I start though, I would like to provide a quick update for Nvidia card users.  As promised, I poked the Nouveau developers about the 64K page size issue by commenting on the existing bug that was filed a couple of years ago.  I am happy to report that one of the developers has replied stating that he is planning to untangle the vm (virtual memory) mess in the coming weeks where he also plans to address the page size issue for 64-bit PPC machines. You can follow the bug here. Consider this another giant step forward for us G5 owners!  I have offered to help in any way and have recently cloned the appropriate nouveau repositories to start parsing through the code myself and to install the latest version of the drivers for testing. I will keep you all updated.

Okay onto my regularly scheduled content. One of the many fantastic things about using a G5 PowerMac is that most of its supported graphics cards included dual head support of some kind.  If you are one of the lucky to have two monitors to put to use, I would highly recommend it when using your G5 as the extra screen real estate definitely makes a difference.  Not only that, the G5 has more than enough horsepower to drive both displays without eating up hardly any system resources. I myself have a flashed Nvidia FX4500 card with 512 MB of VRAM that includes two DVI heads. Along with that, I have two excellent 20" Apple Cinema Displays to plug into each head.  These monitors support a maximum resolution of 1680x1050 and the results are magnificent.

Now that I at least have a working 2D accelerated desktop, I have managed to successfully get a dual monitor setup going as well as found a way to make the setup persistent across reboots.  As we all know, there are many ways to accomplish a task in Linux and so with that in mind here is the simple setup I have configured to make this work on my G5.

The first thing you will want to do is install the graphical wrapper for xrandr called Arandr:

sudo apt-get install arandr

Once installed, you can find this utility under your Preferences menu.  When opened, you will see square boxes for each of your detected displays as well as their identification names. For example, mine are called DVI-I-1 and DVI-I-2 as can be seen from the screenshot below.  Your output IDs and rectangle sizes will vary depending on video card and monitors in use.


To configure your desired layout, simply drag each monitor to its desired position, which is likely how you have them setup on your desk/stand (i.e. to the left and right of each other, but again, your setup may differ).  Once in place, simply click the green button with the arrow pointing to your right to apply the layout and put it to the test.  Under the hood, this layout is actually a constructed xrandr command that gets called, but more on that in a minute.

If the results are satisfactory, you will want to save the setup by going to Layout -> Save As.  The default directory to save it under is your .screenlayout folder in your home directory.  I would recommend leaving it that location.  The resulting file is actually a shell script, so the file extension should show .sh and if you view the permissions of the file it should be executable.

As mentioned above, the file only really contains the xrandr call that was constructed via your graphical layout you created.  My particular layout ended up as follows:

xrandr --output DVI-I-1 --mode 1680x1050 --pos 1752x0 --rotate normal --output DVI-I-2 --mode 1680x1050 --pos 0x0 --rotate normal

Now that you have a shell script with the saved xrandr command that will create your desired dual monitor layout and configuration, you can apply it at any time by opening the shell script within Arandr and applying it or manually running the script within a terminal.

But wait? Why would you always wanting to be doing this manually?  We have the power of automation at our fingertips.  A good place to have this script run automatically at login is (you probably guessed it) your autostart file.  For me, mine is located at ~/home/.config/lxsession/LXDE/autostart. I added the following line to the file and saved the changes:

/home/br0c0l1/.screenlayout/DualAppleCinemaDisplays.sh &

To test the changes out, simply restart your X display manager. For LXDE users, that can be done by restarting the lightdm service.  Or better yet, just logout and back in.  If all else fails, do a full reboot.

And so from now on, when you login to your G5 Linux install, you should automatically have your dual monitors configured in your desired layout.  Enjoy the extra screen real estate!



If you run into any issues or have other ways of accomplishing this same task, feel free to leave a comment below.

New blogger guidelines for cookies in the EU


My blogger admin page provided me with the following message on new cookie regulations for the European Union and its member states:

European Union laws require you to give European Union visitors information about cookies used on your blog. In many cases, these laws also require you to obtain consent.

As a courtesy, we have added a notice on your blog to explain Google's use of certain Blogger and Google cookies, including use of Google Analytics and AdSense cookies.

You are responsible for confirming that this notice actually works for your blog and that it is displayed. If you employ other cookies, for example by adding third-party features, this notice may not work for you.

So as the administrator of this blog, I am responsible for making sure this notice is available to anyone from an EU nation.  I have made more custom modifications to this blog than I can count, and there is a chance they could get in the way of this notice.  If you live in the EU and do not see this notice; please contact me directly, or comment here, and I will correct it.

This blog doesn't use AdSense at all, so the only cookies are blogger stats and my third-party stats.  I can assure you that both are perfectly harmless.  The third-party stats I speak of is StatCounter, which are one of the most trusted and popular website/blog stat services on the net.


Update

Based on some testing I have done... the notice only shows itself once. I tried it with at least 5 EU nation codes, and once I clicked either "Learn More" or "Got It" it didn't show itself again. Even after a browser relaunch.

The MacMini G4 file server


I recently received a MacMini G4 and now to figure out what to do with it. I saw really cool video on how to use a macmini as a file server. In the video OS X was used but I wanted to do this on Linux. Two common ways to set up a file server are NFS and Samba.

This post will deal with setting up a file server using NFS on PowerPC.


Initial setup and network management

Besides the MacMini, I also got an external 1TB hard drive that I would be using as shared storage. I chose the 1TB drive mostly for testing. Right now it is fitting my needs, however in the future I do plan upgrading to a 4TB drive.

I installed Jessie on the mini with XFCE as the DE. I am going to run this headless, but I also wanted to be able to remote into the GUI. When I set my lxc containers I used vnc4server for remote access. Now I have found a better tool. Anyone who needs to have remote DE access to a server the tool I now recommend is xrdp. The is pretty easy, all you need to do is install the package,
apt-get install xrdp

The system takes care of the rest. Then all you need is an rdp client. The best one I have seen so far is remmina. Using it is pretty straight forward. The only gotcha I found was that you will need to define your screen resolution or it will not connect.
It is best if the macmini had a static ip in case dhcp give it a new address on reboot. So made a static reservation on my router.


NFS Install

Installing the NFS package is as simple as following,
apt-get install nfs-kernel-server

This will install package and needed dependencies. The system should start NFS upon install, but to verify this run these commands to see if you get the following results,
rican-linux@debian-minippc:~$ ps aux |grep smbd
root 8877 0.0 2.8 40012 14476 ? Ss Jul07 0:10 /usr/sbin/smbd -D
root 8878 0.0 1.5 40020 8028 ? S Jul07 0:01 /usr/sbin/smbd -D
root 15921 0.0 2.6 40332 13388 ? S 22:36 0:00 /usr/sbin/smbd -D
root 15922 0.0 2.6 40332 13388 ? S 22:36 0:00 /usr/sbin/smbd -D
root 15924 0.0 2.7 40484 14084 ? S 22:36 0:00 /usr/sbin/smbd -D
root 15926 0.0 2.6 40528 13768 ? S 22:36 0:00 /usr/sbin/smbd -D
rican-l+ 15949 0.0 0.4 4564 2072 pts/0 S+ 22:43 0:00 grep smbd
rican-linux@debian-minippc:~$ ps aux |grep nmbd
root 8899 0.0 1.0 25728 5432 ? Ss Jul07 0:03 /usr/sbin/nmbd -D
rican-l+ 15952 0.0 0.4 4564 2180 pts/0 S+ 22:43 0:00 grep nmbd

Once you have verified that NFS running, then you will need to edit the /etc/exports file in order to add the directories to share. You should have something like this below,
"/media/rican-linux/My Passport/" ip address(rw,sync,no_subtree_check,no_root_squash)

The first portion defines what directory you are sharing. Then you need define what machine you want to access your share. I have heard you can actually define by an entire subnet, but for some reason that did not work for me. So have a separate entry for each machine I want to access my share via NFS. The portion in parenthesis defines the permissions of the share. You can reference the exports man page for details. Then after you are done with the exports file, you need to reload it by running the following,
exportfs -ra

This should get you ready to set up the client side. This is done by installing the following package,
apt-get istall nfs-common

Once that is installed create a directory to serve as your mount point (I created one in my home directory for convenience). Then as root mount the drive,
mount ip address:path_to_drive mount_point

If successful you should see the following,
rican-linux@debian-ppc:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 71G 25G 43G 37% /
udev 10M 0 10M 0% /dev
tmpfs 404M 12M 393M 3% /run
tmpfs 1010M 72K 1010M 1% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 1010M 0 1010M 0% /sys/fs/cgroup
tmpfs 202M 8.0K 202M 1% /run/user/1000
ip address:/media/rican-linux/My Passport 932G 1.6G 930G 1% /home/rican-linux/macmini-ppc

If you wanted to make this permenant then update the fstab file. If you are wanting more information the Debian Wiki and the Linux Documentation Project sites are good resources to look at.

G5: Nouveau & 2D Acceleration


DISCLAIMER: None of what you'll read below is of my own work, but mostly a summary on what I read about on the Debian PPC mailing list.

I have what I believe is somewhat exciting news for G5 owners in regards to using Nvidia cards and the open source nouveau driver, but more testing needs to be done!  What I'm about to explain and show should hopefully be able to allow you to at least achieve 2D acceleration.

However, before we become too excited, let us take a step back first and examine the situation with nouveau on G5 PowerMacs.  As of today (7/5/2015), I'm the only other known individual who has been able to make this fix work with the other individual being the one who filled us (the Debian PowerPC mailing list) in on how to get it working.  To be clear, I'm using Late 2005 PowerMac (Identifier 11,2) using a Quadro FX4500 Nvidia card.

As already known from my previous post on a fresh install of Jessie on a G5, I had to pass in an extra yaboot parameter (nouveau.noaccel=1) that would disable any acceleration with the Nvidia card using the nouveau driver. This would at least give us G5 owners with an Nvidia card a usable system, although all graphics rendering was happening on the CPU.  Not the most terrible thing in the world when using a dual-core G5, but definitely disappointing knowing how much power the graphics cards have to offer. 

Since the release of Jessie, there have been a handful of threads on the mailing list about issues other users were having when trying to use the nouveau driver.  Many people, myself included, recommended the yaboot parameter fix due to lack of expertise and knowledge of the nouveau driver, graphics programming, and troubleshooting.  Just this past week or so, another Debian user posted a thorough analysis on why the nouveau driver was having issues with the Debian 3.16.0-4 powerpc64 kernel and what could be done as a workaround to overcome the issues and at least achieve 2D acceleration. Notice that I said "workaround" and not "fix."

Basically, it came down to one or two different kernel configurations or both.

1) Right now, only a 4Kb pagesize configuration in the kernel will work with the 64-bit G5 kernel running the nouveau driver. The default pagesize of the included kernel-image (again 3.16.0-4-powerpc64 in Debian Jessie) is 64kb, which as mentioned by the poster improves performance of the driver, but again is not supported on G5 PowerMacs. To check the pagesize in use by your running kernel run the following command in a terminal:

getconf PAGESIZE

This will likely either return 4Kb or 65536Kb. 

2) The kernel configuration might also be set to have the nouveau driver use MSI interrupts.  As quoted by the poster regarding these interrupts:

The newer nouveau drivers in more recent kernels default to using MSI interrupts, however with the PPC G5, when using MSI interrupts, the powerpc FCODE rom on Nvidia cards does not correctly set up the MSI address (or vector).

To verify if you are using MSI interrupts or not, run the following command in a terminal:

cat /proc/interrupts

Look for the nouveau entry and confirm whether it is MSI or MPIC.

What the poster ended up doing was rebuilding a newer 3.18.16 kernel, disabling MSI interrupts as well as adjusting the pagesize in the kernel configuration to 4kb.  Not only that, but he has also posted a copy of this kernel image and headers for G5 owners to download and test on their G5 machines.

So this is a call to all other G5 owners running the latest Debian Jessie release and using an Nvidia graphics card.  Download and install the files linked above and post your results to the Debian PPC mailing list ASAP!  If need be, drop a comment with your results, and I will plug them into the aforementioned thread on the mailing list.  I would recommend downloading and installing this newer kernel image and headers on a brand new Jessie install if possible.

Remember to add in a new kernel configuration in your /etc/yaboot.conf file that links to the newly installed kernel and run sudo ybin -v to wrap it all up. From there, go ahead and reboot to the new kernel and test things out.

I can vouch that the above kernel does allow 2D acceleration now on my G5 PowerMac. Also, as I mentioned in the mailing list thread, I had to load the i2c-powermac module to stop the fans from sounding like a 747 ready for takeoff.  Now that I have 2D acceleration, I can now use xrandr and arandr to set my dual monitors up properly in an extended desktop setup that spans across both of them.  Now if we could only figure out how to achieve 3D hardware acceleration us G5 owners would be set for a little while longer.

Bug reports for these two problematic issues and configurations have been filed here and here.  From the sounds of it, you would not be able to make these two configuration changes work on G5 with the current Debian kernel 3.16.0-4 so do not pull out your hair trying.

I did some browsing around on the nouveau website and found that this G5 PPC pagesize issue is listed as a DRM to-do on this page.  My plan is to touch base with them about it again and see what, if anything, I can do to help. In the meantime, I've been reading up more and more on the nouveau driver and Linux graphics in general, so here is to hoping I'll be able to assist in some small way.  The developers of nouveau have some excellent documentation over at their site so I encourage you to check that out if you would like to also assist in any way.

Also, and lastly, it appears that 4.0+ kernels present all sorts of new issues with nouveau and G5s, but if nothing else, this small bit of information outlined above is hopefully a good sized step in the right direction!  We need to continue to do our duty of reporting any bugs we find regardless of whether anybody who currently is a developer wants to devote any time to them.  It helps just to have that information out there and available.

Best Under the Radar Linux Apps


Now that Jessie's dropped and PowerPC users are more or less working out the kinks, I thought it was time to share some of our favorite under the radar Linux apps that don't get the publicity they deserve. By "under the radar," I mean applications that generally don't get bundled with full desktop environments like Gnome or LXDE. So no VLC, no Evince, no Abiword, no default applications or anything like that. Instead, these are apps you had to hunt down yourself and were rewarded with unexpectedly great features and ease of use.

So here are a few of my favorites:

Qalculate! – This is a calculator app that's as comprehensive as I've seen. Currency exchange, functions of every kind, and graphing are among the many features.

Xournal – Seems to be primarily a handwriting app, but it also features simple PDF editing. This is great for filling out government forms where you only have to enter some text and a signature and you don't want to deal with LibreOffice.

Artha – An offline dictionary, you can also have it running in the background and call it up by highlighting a word and hitting a key-combo. Really comprehensive information, and did I say it was an offline dictionary

Shutter – Zen loves this and so do I. It's a screenshot plus markup utility and uploader. So it's a lot like Skitch.

LMMS – Linux Multimedia Studio, this is actually distributed with some audio production-centered distros, but in my opinion it should be distributed with every distro (like a Garageband for Linux). It's that good, and it's perhaps the best example of open source software, one that's intuitive and fun like classic Mac software used to be.

What are your favorite under the radar Linux apps?

Xorg bug lands in testing


One month and eight days, that is how long it took before an update to Stretch brought in a nasty bug. Here is a little background, back in the early part of the year a lot of people were excited about Ubuntu-MATE announcing plans to support PowerPC. The guys involved in the project did a great job with the distro. A lot of us were testing the 15.04 release while it was in beta. Then an upgrade in beta brought in a lot of trouble.

The main issue was the change to version 1.17 of Xorg. There is a bug in this release that serisouly distorts the colors and graphics of the DE in PowerPC. You can read about it here in the Ubuntu forums. So now it has reached Debian Stretch(testing). I have placed a bug report to Debain (#787965) and also notified the Debian PowerPC mailing list of the issue. The brightside is that it landed early so I am hoping this will give the developers plenty of time to work on it and find a solution.

I will keep you all updated.

UPDATE: It looks like the Xorg bug has been fixed! The latest version (1.17.2-1) has resolved the graphics issue. Good times are back again :)