Monday, December 28, 2015

Installing VirtualBox Guest Additions in Fedora 23

It's been a while since I've done anything with digital signal processing (DSP) and I never ended up taking a formal digital communications course in college. So over the next year I have some plans to try out GNU Radio with some very inexpensive radio hardware (on the order of dollars to tens of dollars) to try building some simple digital communications lessons.

I am primarily a Windows user and GNU Radio is primarily a Linux tool. (There are instructions for building GNU Radio to run in Windows but today I'm not going to go there.) We'll discuss my hardware plans later but for now I'll say that primarily we'll be using the audio interface of the computer to move signals around. USB may get involved, too, but it will be secondary. With that in mind, I figure it's no problem if we use a virtual machine. I've decided to run Fedora 23 in VirtualBox.

I'm kind of a novice when it comes to managing Linux machines but that doesn't mean I can't do it. I wanted VirutalBox's Guest Additions installed to my x64 Fedora image but it failed when I tried to install it. After a little Binging (that will never sound as good as Googling) and sorting through my command history, here are the commands I ran to get things into a state where I could install Guest Additions.

  sudo dnf update
  sudo dnf install gcc
  sudo dnf install kernel-devel.x86_64
  sudo dnf install dkms
  sudo dnf install kernel-headers
  sudo dnf install gcc-c++
  sudo dnf update kernel
  # now install Guest Additions. Allow the "CD" to auto-run. Reboot again, I think.

With Guest Additions installed, the virtual machine now displays at the full resolution of my monitor, among other benefits.

Another problem: By default Fedora puts its logo in the bottom corner of your desktop. This eats up a surprising number of CPU cycles running in VirtualBox. Install gnome-tweak-tool to remove it.

  sudo dnf install gnome-tweak-tool

Then disable the background logo in the tweak tool (answer originally found here).

Now we can install GNU Radio and run the GNU Radio Companion.

  sudo dnf install gnuradio

Right now I am having issues with audio buffer underruns. I'm thinking I may have to move on to a live image or actually try to build GNU Radio for Windows. *Sigh.* At least my virtual machine fills my monitor...

I fixed my buffer underrun problem. I made sure the virtual machine's audio controller was ICH AC97 in the VirtualBox settings. Then in Fedora I opened up a terminal and typed 'aplay -L' to list all of the available audio devices. One is listed as:

    Intel 82801AA-ICH, Intel 82801AA-ICH
    Front speakers

That first line is what I typed into my GRC audio sink as "Device Name" parameter. With the sample rate at 44.1kHz I get no underrun errors (a repeating aUaUaUaUaU in GRC's console output). There's some clicks at the start of playback but that's something we can work with. Hooray!