Wednesday, July 28, 2010

PAGE_SIZE undefined

I ran into a couple of build failure on x86_64 architecture because the PAGE_SIZE variable in not defined. This 32-bit version of the same package builds fine, it is only the 64-bit ones that fail.


One straight forward fix to this problem would be to use sysconf(_SC_PAGESIZE) instead of PAGE_SIZE variable. This will query system to get the right page size.

Also remember to make sure unistd.h file is included when using the above mentioned sysconf call.


Praveen

Wednesday, June 2, 2010

Flash on 64-bit Fedora

To install flash on a 64-bit Fedora systems, follow one of the following methods:

1) Use the pre-release version of the Adobe Flash.

Go here and download the plugin towards the end of the page.
This would most likely be a tar.gz file. Extract the file with "tar zxvf downloaded_filename". This archive would have a single file by the name "libflashpalyer.so".
Check if the file is actually a 64-bit plugin. run "file libflashplayer.so" the output would look like:

libflashplayer.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped


In order to install the plugin either copy the file to /usr/lib64/mozilla/plugins directory if you have root access. If not, copy the file to ~/.mozilla/plugins directory.

After copying the plugin restart firefox and you should have your youtube vidoes running fine :).



2) Use nspluginwrapper to be able to run 32-bit flash on 64-bit systems.

Note: You should have root access to use this method.

Go here and download the flash rpm version. Install the package with rpm ivh flash-plugin-10.0.45.2-release.i386.rpm. This package will install the flash plugin as /usr/lib/flash-plugin/libflashplayer.so along with a couple of other files.

Now install ndspluginwrapper with :
yum -y install nspluginwrapper.i686. This command will pull down close 90 packages as dependencies, let them all be installed.

The nspluginwrapper.i686 package will allow plugins compiled for i386 to run on other architectures (eg x86_64). It will install a proxy plugin as /usr/lib/mozilla/plugins-wrapped/npwrapper.so and during its post installation steps, it runs, /usr/bin/mozilla-plugin-config -i -f command, which will search for all i386 plugins and install them into /usr/lib64/mozilla/plugins-wrapped/. You will notice nswrapper_32_64.libflashplayer.so file in this directory which is linked/wrapped from 32-bit to 64-bit by the wrapper.

You will be able to play the flash videos now, but there will be no sound. To fix the sound, run yum -y install alsa-plugins-pulseaudio.i686 and restart firefox. This should have flash up and running.



To check if the flash plugin is installed fine, go to Tools->Add-ons->Plugins. You should have Shockwave Flash listed among the plugins.

I verified the above steps on a fresh install of Fedora 13 x86_64 alone.

Praveen

Saturday, May 29, 2010

Firmware file "b43/ucode15.fw" not found

I recently installed Fedora 13 (x86_64) on a Dell Vostro 1000 laptop and ran into some problems with my wireless connection.

The wireless card I had in my laptop is (lspci | grep 802):
05:00.0 Network controller: Broadcom Corporation BCM4312 802.11b/g LP-PHY (rev 01).

The driver module that is loaded for this device is "b43". In the /var/log/messages, I found out the following messages related to this module::

May 29 09:48:28 laptop kernel: b43-phy1: Broadcom 4312 WLAN found (core revision 15)
May 29 09:48:28 laptop kernel: Registered led device: b43-phy1::tx
May 29 09:48:28 laptop kernel: Registered led device: b43-phy1::rx
May 29 09:48:28 laptop kernel: Registered led device: b43-phy1::radio
May 29 09:48:28 laptop kernel: Broadcom 43xx driver loaded [ Features: PMLS, Firmware-ID: FW13 ]
May 29 09:48:28 laptop NetworkManager[1193]:
(wlan0): driver supports SSID scans (scan_capa 0x01).
May 29 09:48:28 laptop NetworkManager[1193]:
(wlan0): new 802.11 WiFi device (driver: 'b43' ifindex: 4)
May 29 09:48:28 laptop NetworkManager[1193]:
(wlan0): exported as /org/freedesktop/NetworkManager/Devices/2
May 29 09:48:28 laptop NetworkManager[1193]:
(wlan0): now managed
May 29 09:48:28 laptop NetworkManager[1193]:
(wlan0): device state change: 1 -> 2 (reason 2)
May 29 09:48:28 laptop NetworkManager[1193]:
(wlan0): bringing up device.
May 29 09:48:28 laptop kernel: b43 ssb0:0: firmware: requesting b43/ucode15.fw
May 29 09:48:28 laptop kernel: b43 ssb0:0: firmware: requesting b43-open/ucode15.fw
May 29 09:48:28 laptop kernel: b43-phy1 ERROR: Firmware file "b43/ucode15.fw" not found
May 29 09:48:28 laptop kernel: b43-phy1 ERROR: Firmware file "b43-open/ucode15.fw" not found
May 29 09:48:28 laptop kernel: b43-phy1 ERROR: You must go to http://wireless.kernel.org/en/users/Drivers/b43#devicefirmware and download the correct firmware for this driver version. Please carefully read all instructions on this website.
May 29 09:48:28 laptop NetworkManager[1193]:
(wlan0): deactivating device (reason: 2).
May 29 09:48:28 laptop NetworkManager[1193]:
found WiFi radio killswitch rfkill1 (at /sys/devices/pci0000:00/0000:00:06.0/0000:05:00.0/ssb0:0/ieee80211/phy1/rfkill1) (driver )
May 29 09:48:28 laptop kernel: b43 ssb0:0: firmware: requesting b43/ucode15.fw
May 29 09:48:28 laptop kernel: b43 ssb0:0: firmware: requesting b43-open/ucode15.fw
May 29 09:48:28 laptop kernel: b43-phy1 ERROR: Firmware file "b43/ucode15.fw" not found
May 29 09:48:28 laptop kernel: b43-phy1 ERROR: Firmware file "b43-open/ucode15.fw" not found
May 29 09:48:28 laptop kernel: b43-phy1 ERROR: You must go to http://wireless.kernel.org/en/users/Drivers/b43#devicefirmware and download the correct firmware for this driver version. Please carefully read all instructions on this website.
May 29 09:48:28 laptop NetworkManager[1193]:
(wlan0): supplicant interface state: starting -> ready
May 29 09:48:28 laptop NetworkManager[1193]:
(wlan0): device state change: 2 -> 3 (reason 42)



This seems to be a well known problem. As the message suggested, I went to http://wireless.kernel.org/en/users/Drivers/b43 and followed the section "You are using the b43 driver from linux-2.6.25 or newer" since Fedora 13 had (uname -r) 2.6.33.3-85.fc13.x86_64 kernel in it.

Since the "b43-fwcutter" is already installed, I just had to run:
export FIRMWARE_INSTALL_DIR="/lib/firmware"
wget http://mirror2.openwrt.org/sources/broadcom-wl-4.150.10.5.tar.bz2
tar xjf broadcom-wl-4.150.10.5.tar.bz2
cd broadcom-wl-4.150.10.5/driver

sudo b43-fwcutter -w "$FIRMWARE_INSTALL_DIR" wl_apsta_mimo.o


Doing so, the files "/lib/firmware/b43/ucode15.fw", "/lib/firmware/b43/lp0initvals15.fw", "/lib/firmware/b43/lp0bsinitvals15.fw" appeared on my computer. As the name suggests the "b43-fwcutter" cuts these firmware files from the drivers distributed by Broadcom and places them in /lib/firmware/b43.


After the required firmware is installed, just reload the b43 drivers (modprobe b43) or just restart the laptop and you should have the wireless card working :).