Solving Wireless Troubles With A Macbook Pro & Ubuntu 8.04 (Hardy Heron)

When I was running Ubuntu 7.10 (Gutsy Gibon) the wireless card on my Macbook Pro was not recognised so I installed Madwifi to get it working.  When I upgraded to 8.04 (Hardy Heron) everything still worked fine (whether this was because Madwifi was still in use or because 8.04 has the right drivers for the wireless card I am unsure) but with the update which I installed on 11/07/2008 once I had restarted my computer my wireless card was no longer accessible.  Luckily I found this great tutorial from http://ubuntu-tutorials.com a while ago which I mentioned while talking about setting up 7.10 on a Macbook Pro and this solved the problem and got my wireless card working again.  The previous settings were saved which makes me think Madwifi has been fine all along until the 11/07/2008 Ubuntu update.  Looking in the Update Manager log file at /var/log/apt/term.log for there were a fair few updates and replacement but I don’t know what most of them are so I can’t specifically say what happened - anyone who might know and wants the look at the log file get in touch.

  1. sudo aptitude install build-essential
  2. wget -c http://snapshots.madwifi.org/madwifi-trunk-current.tar.gz
  3. tar -zxf madwifi-trunk-current.tar.gz
  4. cd ‘to the folder madwifi was unzipped to’
  5. make
  6. sudo make install
  7. sudo modprobe ath_pci
  8. sudo modprobe wlan_scan_sta

Run all that through terminal and you’re sorted.
Thanks to Christer Edwards of http://ubuntu-tutorials.com and Madwifi for this.

Apple Charge You To ‘Enable’ 802.11n On Your Built In Wifi Card

http://a248.e.akamai.net/7/248/2041/1412/store.apple.com/Catalog/US/Images/airport_enabler_125_070130.jpgWhile looking through the Apple site I came across this page: Airport Extreme 802.11n Enabler for Mac

I think it is totally shit of Apple to charge people $1.99 to ‘enable’ a function that already exists on their computer (and to release it free with a purchase of a Airport Extreme router thus locking you in to using Apple products even more). 802.11n support was left out on the release of computers with 802.11n compatible cards and now it makes me think this was done on purpose knowing that it would be the next wireless protocol and if left out it could be added as a pay for upgrade. That’s not cool. What next? Laptops that ship with out the screen working so you have pay a fee to see any thing? Or maybe you’ll have to pay every time you turn your computer on?

Apple - sort your fucking life out, make products that work and are productive and don’t be cunts by milking every last penny. You don’t need it and people need computers that work. It’s not that much to ask..

Linux, Ubuntu 7.10 (Gutsy Gibbon) & A Macbook Pro

Ubuntu 7.10 on a 15″ Powerbook G4 was not so easy to get working, but it was possible. Based on this and that Jay has had 7.10 running on his 1st Generation (Core Duo, not Core Duo 2) Macbook for a few weeks with no problems other than a few key modifications and the brightness keys not working (the volume keys do) I reasoned that as my Macbook Pro also uses the same Intel processor architecture (i386) running 7.10 should present no problems. I was mistaken, but the problems I have had so far can be solved. Here are the solutions I used to solve my problems; hopefully they will also help others.

Installing

I originally used the regular 7.10 install disc (here) which worked OK, but I wanted to look at all the options on install so I used the 7.10 Alternate disc (here).

From previously installing different version of Ubuntu on other machines I know that if you install with your ethernet cable connected (so your computer can access the internet) a number of updates are downloaded on install. Not downloading these on install seems to create more problems that it is worth so I would recommend installing with an internet connection.

When you boot the disc (hold C at startup) you a presented with a series of option screens. Most things are self explanatory. I would recommend choosing your keyboard from the list and not pressing keys to define it - I had to go and change this in System > Preferences > Keyboard to Macintosh as it set me up with a universal keyboard layout which was a bit odd. I was also able to select my screen size of 1440 x 900. Installation ran smoothly and on restart I entered my username and password and I’m straight to the desktop.

Updates

On reaching the desktop I was presented with a prompt to install updates. This obviously only happens if you have an internet connection, so keeping your ethernet cable plugged in is also advantageous here.

Ubuntu 7.10 Macbook Pro 15

I was also prompted to install restricted drivers from ATI for my display which I did. After each install, I was prompted to restart but first I navigated to System > Administration > Software Sources to tick the appropriate boxes thus ensuring all software was available to me (On default all the correct things seem to be ticked which is why I was prompted to download restricted drivers - good stuff). I then opened System > Administration > Update Manager and clicked ‘Check’ to scan for any new software not picked up at first. I got told my system is up to date, so I restarted.

On restart I now have a much crisper display, so the ATI drivers seem to have worked well.
No Wireless Networking

UPDATE 30/04/08

This works fine with 8.04 Hardy Heron.

A glaring problem was that I had no wireless connection. I could not select other than wired network, so I had a search and came up with this great tutorial from http://ubuntu-tutorials.com

  1. sudo aptitude install build-essential
  2. wget -c http://snapshots.madwifi.org/madwifi-trunk-current.tar.gz
  3. tar -zxf madwifi-trunk-current.tar.gz
  4. cd ‘to the folder madwifi was unzipped to’
  5. make
  6. sudo make install
  7. sudo modprobe ath_pci
  8. sudo modprobe wlan_scan_sta

Run all that through terminal and you’re sorted.
Thanks to Christer Edwards of http://ubuntu-tutorials.com and Madwifi for this.
No Sound

This was a bit more of a problem and took a frustrating day of trying various reported solutions and having assorted documented problems along the way, but I now have sound working correctly:

  • Sound out of speakers
  • Sound out of line out
  • Sound using headphones
  • Pluging in line out turns off speakers
  • Volume controlled from keyboard and/or internal mixer slider

N.B. I haven’t tested the microphone or line in yet and to be honest I don’t really need them so I probably won’t worry about them. I should test them though and post it up here…

Sound in, either microphone or line in does not work.

To get all this working I first followed the tutorial in the official Ubuntu wiki here and that failed. I was able to download the drivers and kernal for ALSA, but on running ./hgcompile I got a load of files and folders not found and permission denied errors. I tried various different approaches but there seems to be some problem with either the download source, the tutorial or both so I abandoned this approach.

I then found this post in the Ubuntu user forums which was a great help (as the Ubuntu user forums increasing are to me). In this post, there are a number of ways to sort out your sound. I tried them all and had no success until I compiled the ALSA drivers from source. To do this, you need to know what sound card you have so you can install the correct drivers. Things are made a bit more difficult because the 15″ Macbook Pros apparently uses different soundcards and drivers to pretty much every other mac.

To get the information needed, in terminal type:

lspci -v

This will bring up a big list of devices. Near the top should be your soundcard. I have the following:

00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)
Subsystem: Sigmatel Unknown device 7680
Flags: bus master, fast devsel, latency 0, IRQ 21
Memory at 50400000 (64-bit, non-prefetchable) [size=16K]
Capabilities: <access denied>

Go to http://www.alsa-project.org and navigate to ‘Soundcards’. Here you can choose the vendor based on what lspci -v returned. In my case I chose Intel which led me to this page where you can choose your specific driver. As my card is part of the ICH7 family and a High-Definition Audio controller (HDA) as shown by lspci -v, I chose ‘ICH southbridge HD-audio and modem’ and clicked ‘Details’ to view the driver documentation. At the top of this page is the driver name that you need. In my case it is snd-hda-intel.

Now you know the specific driver you need for your soundcard the following method should work (It did for me):

  1. sudo apt-get install build-essential linux-headers-$(uname -r) module-assistant alsa-source
  2. sudo dpkg-reconfigure alsa-source
  3. At the blue dialog box answer yes (for ISA-PNP - recommended by package maintainers), then yes again (for debugging - recommended by package maintainers).
  4. Select which driver you want to install. In my case, I deselected ‘all’ then selected ‘hda-intel’.
  5. sudo module-assistant a-i alsa-source

You a presented with a progress bar while the nessarcary files are transfered.

6. Once this is complete, enter the following to reload the driver:

sudo modprobe snd-hda-intel

7. To ensure the driver is loaded when you turn on your computer add snd-hda-intel (or what ever your driver name is) to the bottom of this file:

/etc/modules

After all this, restart and sound should be all working fine. If not, double click the speaker icon at the top right of the screen, select Edit > Preferences and ensure that PCM is selected and the volume is up.

ALSA Volume Control Preferences Ubuntu 7.10 Macbook Pro 15

To get your volume slider working with this ensure that PCM is selected in Volume Control Preferences which can be reached by right clicking on the speaker icon at the top right of the screen and selecting Preferences.

ALSA Volume Control Preferences Ubuntu 7.10 Macbook Pro 15

To get the volume keys working, ensure Main Menu -> System > Preferences > Sound Preferences has PCM selected.

Ubuntu 7.10 Macbook Pro 15

This all worked fine for me with no distortion and I can happily listen to all my music now. Buzzin.

Keyboard Layout / Right Click

I want the ctrl key when combined with a single mouse click to be right click. I am frustrated that I either have to use an external mouse or set Preferences > Mouse > Touchpad to ‘tap to click’ so I can use three finger right clicks. In doing this, single finger taps are left clicks and this is annoying when trying to select things - windows change, text gets selected. Blah. It is also annoying that backspace is backspace but ctrl or alt or apple keys and backspace are not delete. Grrrr. Need a way to combine multiple button/mouse presses into a single command. I need to learn more about keymodmaps.

As a temporary solution which is working fine for me so I might not change I followed this Ubuntu help document for installing Ubuntu on a Macbook Pro and remapped my key as follows:

First go to > System > Preferences > Keyboard, and click on ‘Accessibility’ button. check ‘Enable keyboard accessibility features’ and then go to ‘Mouse keys’ tab and check ‘Enable Mouse Keys’ and hit ‘Close’ button.

Then create a text file as ~/.xmodmap containing the following text (Note: This sets Right Apple key as Right mouse click and Left Enter Key as Alt Gr key)

keycode 116 = Pointer_Button3
keycode 108 = ISO_Level3_Shift

Add a call to xmodmap to your startup applications (System > Preferences > Sessions) [example]:

xmodmap /home/yourusername/.xmodmap

Restart X (Ctrl+Alt+Backspace) for the changes to take effect.

This worked great for me. Interestingly enough I have just installed jUploader (a Flickr uploader for Linux) and in this program I can press ctrl and click and this has the same function as pressing the right apple key, which is set to be right click. Hmmmm….