Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Monday, May 16, 2011

MythTV not going fullscreen in Ubuntu 11.04 (Natty Narwhal)

Recently I started upgrading my various MythTV front-end machines to Ubuntu 11.04. I was disappointed to discover that the unity bar at the top of the screen is still there.

In previous version of Ubuntu this would happen if you had the Appearance setting on anything other than basic (I forget exactly what it was called, but it was the first option in the last tab in the Appearance settings application).

However in 11.04 the Appearance settings application no longer has this options (this appears to be due to 11.04 using the Compiz window manage if it's available).

This is apparently a well known issue, but luckily the fix is fairly simple. From here I discovered that it's just a case of installing the advanced appearance settings application (called CCSM) and selecting Utility->Workaround->Legacy Fullscreen Support.

Quite what this workaround breaks and therefore why it isn't on by default isn't mentioned anywhere, but I'm happy for now as I can still watch TV.

Thursday, September 16, 2010

Accidentally installing Grub to /dev/sda on a Mac OS X machine

I managed to accidentally install GRUB to /dev/sda when setting up my MacBookPro to boot Ubuntu, WinXP and Mac OS X. I knew I shouldn't have, but I wasn't paying attention to the installer when it asked me. In my defence I was also slightly rushed as I wanted to get the installation running before I went to the pub...

Anyway after much hunting and not being able to boot Linux or Windows XP, I finally discovered the solution in this blog post. The author had, like me, managed to ignore all the warnings. Luckily recovery is just a simple case of sticking in the Mac OS X install CD, booting off it and running "fdisk -u /dev/rdisk0" in terminal. This will then restore the Mac OS X MBR to it's proper state.

I did get a warning about not being able to find an MBR file, but it still let me update the MBR and it all seems to be working anyway. As well as fixing Linux and Windows XP booting (which previously would just sit there with a blinking cursor in the top left) it also fixed the slightly annoying issue of rEFIT having a 'Boot Linux from HD' option which I couldn't get rid of.

Sunday, May 23, 2010

Last.fm on Ubuntu Lucid Lynx (10.04)

Having recently got a nice shiny new netbook (an HP/Compaq 311c) I was trying to get last.fm to compile on it. My netbook was running a reasonably fresh install of Ubuntu Lucid Lynx (10.04).

So I downloaded the source for last.fm-1.4.2.58240 and unzipped it into my source directory. Knowing that it needed qt4 I then ran:
sudo apt-get install libqt4-dev

With that all installed I tried running ./configure in the source directory and it said everything was fine, so I went ahead and typed make.

After waiting while it compiled I was then greeted by the following error:
make[1]: Entering directory `/home/marvin/src/last.fm-1.4.2.58240/src/libFingerprint/fplib/pro_qmake'
g++ -c -pipe -O2 -w -fPIC -DNBREAKPAD -DLINUX -DNDEBUG -I/usr/share/qt4/mkspecs/linux-g++ -I. -I../../../../src -I../../../../build -I../../../libMoose -I../../../libUnicorn -I../include -I../src -I../../libs/fftw/src/api -I../../../../res/libsamplerate -o ../../../../build/fplib/release/FingerprintExtractor.o ../src/FingerprintExtractor.cpp
../src/FingerprintExtractor.cpp: In member function ‘bool fingerprint::FingerprintExtractor::process(const short int*, size_t, bool)’:
../src/FingerprintExtractor.cpp:445: error: ‘memcpy’ was not declared in this scope
make[1]: *** [../../../../build/fplib/release/FingerprintExtractor.o] Error 1
make[1]: Leaving directory `/home/marvin/src/last.fm-1.4.2.58240/src/libFingerprint/fplib/pro_qmake'
make: *** [sub-src-libFingerprint-fplib-pro_qmake-fplib-pro-make_default-ordered] Error 2
marvin@Anjie:~/src/last.fm-1.4.2.58240$


Knowing that memcpy is part of the standard C library I thought this seemed a little strange. So I opened up last.fm-1.4.2.58240/src/libFingerprint/fplib/src/FingerprintExtractor.cpp and added the following line in bold:
#include <cmath>
#include <string.h>

Then recompiled.

The next error was the following:
g++ -c -pipe -O2 -w -fPIC -DNBREAKPAD -DLINUX -DNDEBUG -I/usr/share/qt4/mkspecs/linux-g++ -I. -I../../../../src -I../../../../build -I../../../libMoose -I../../../libUnicorn -I../include -I../src -I../../libs/fftw/src/api -I../../../../res/libsamplerate -o ../../../../build/fplib/release/OptFFT.o ../src/OptFFT.cpp
../src/OptFFT.cpp: In constructor ‘fingerprint::OptFFT::OptFFT(size_t)’:
../src/OptFFT.cpp:262: error: ‘exit’ was not declared in this scope
make[1]: *** [../../../../build/fplib/release/OptFFT.o] Error 1
make[1]: Leaving directory `/home/marvin/src/last.fm-1.4.2.58240/src/libFingerprint/fplib/pro_qmake'
make: *** [sub-src-libFingerprint-fplib-pro_qmake-fplib-pro-make_default-ordered] Error 2
marvin@Anjie:~/src/last.fm-1.4.2.58240$


Which I fixed by editing last.fm-1.4.2.58240/src/libFingerprint/fplib/src/OptFFT.cpp to include the line in bold:
#include <iostream>
#include <memory.h> // for memcopy
#include <stdlib.h>

And then once again ran make.

The next error was:
g++ -c -pipe -O2 -w -D_REENTRANT -fPIC -DNBREAKPAD -DLINUX -DQT_NO_DEBUG -DQT_SQL_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtSql -I/usr/include/qt4 -I../../src -I../../build -I../libMoose -I../libUnicorn -Ifplib/include -I../src/ -I../../res/mad -I../../build/LastFmFingerprint/release -o ../../build/LastFmFingerprint/release/MP3_Source_Qt.o MP3_Source_Qt.cpp
MP3_Source_Qt.cpp: In function ‘short int f2s(mad_fixed_t)’:
MP3_Source_Qt.cpp:70: error: ‘SHRT_MAX’ was not declared in this scope
MP3_Source_Qt.cpp:72: error: ‘SHRT_MAX’ was not declared in this scope
MP3_Source_Qt.cpp: In member function ‘virtual void MP3_Source::skipSilence(double)’:
MP3_Source_Qt.cpp:379: error: ‘abs’ was not declared in this scope
MP3_Source_Qt.cpp:385: error: ‘abs’ was not declared in this scope
make[1]: *** [../../build/LastFmFingerprint/release/MP3_Source_Qt.o] Error 1
make[1]: Leaving directory `/home/marvin/src/last.fm-1.4.2.58240/src/libFingerprint'
make: *** [sub-src-libFingerprint-make_default-ordered] Error 2


So I opened last.fm-1.4.2.58240/src/libFingerprint/MP3_Source_Qt.cpp and added the lines in bold:
#include <cassert>
#include <stdexcept>
#include <stdlib.h>
#include <limits.h>


And ran make once more.

This time it was a linking error:
g++ -Wl,-O1 -shared -Wl,-soname,libLastFmFingerprint.so.1 -o libLastFmFingerprint.so.1.0.0 ../../build/LastFmFingerprint/release/Sha256File.o ../../build/LastFmFingerprint/release/Sha256.o ../../build/LastFmFingerprint/release/MP3_Source_Qt.o ../../build/LastFmFingerprint/release/Fingerprinter2.o ../../build/LastFmFingerprint/release/FingerprintCollector.o ../../build/LastFmFingerprint/release/FingerprintQueryer.o ../../build/LastFmFingerprint/release/moc_Fingerprinter2.o ../../build/LastFmFingerprint/release/moc_FingerprintCollector.o ../../build/LastFmFingerprint/release/moc_FingerprintQueryer.o -L/home/marvin/src/last.fm-1.4.2.58240/bin -L/home/marvin/src/last.fm-1.4.2.58240/build/LastFmFingerprint/../fplib -L/usr/lib -lMoose -L/home/marvin/src/last.fm-1.4.2.58240/bin -lLastFmTools /home/marvin/src/last.fm-1.4.2.58240/build/fplib/libfplib.a -lsamplerate -lfftw3f -lQtSql -lQtXml -lQtGui -lQtNetwork -lQtCore -lpthread
/usr/bin/ld: cannot find -lsamplerate
collect2: ld returned 1 exit status
make[1]: *** [../../bin/libLastFmFingerprint.so.1.0.0] Error 1
make[1]: Leaving directory `/home/marvin/src/last.fm-1.4.2.58240/src/libFingerprint'
make: *** [sub-src-libFingerprint-make_default-ordered] Error 2
marvin@Anjie:~/src/last.fm-1.4.2.58240$


So I ran sudo apt-get install libsamplerate0 libsamplerate0-dev libfftw3-dev libfftw3-3 libmad0-dev libmad0 libgpod-dev libgpod4 libasound2-dev and then ran make again.

If you're wondering how I came up with all the libraries above, it was just from running make several times and then using apt-cache search to search for the missing libraries. I didn't include these steps as they're a bit tedious.

Having done all that it's possible to run last.fm with bin/last.fm.sh.

Creative Commons License
The words and photos on this webpage which are created by Toby Gray are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.0 England & Wales License.