17 January 2014

543. Briefly: unexpected weather in Melbourne according to Android

Southeast Australia, including Adelaide and Melbourne, is currently suffering from 40+ temperatures (Celsius) since the beginning of the week. As opposed to e.g. California, when it's hot in Melbourne during the day, it's also hot at night. Many (most?) houses in Melbourne also don't have air conditioning since we're normally dealing with cold and dreicht weather (16 degrees and rain has been the norm this summer).


Either way, since about midnight Thursday the Weather and News app on android, which uses data from the weather channel, has been reporting blowing snow in Melbourne:

We wish...

06 January 2014

542. gnucash 2.6 on debian wheezy by compiling

Update 7/1/2014: Gnucash 2.6 is now in Jessie

Original post:
"Why would you want to compile gnucash yourself", you might ask. "Because version 2.6, which is currently in SID, allows you to attach files to transactions and that's the bee's knees", I might respond.

I use gnucash to manage my grants. Attaching purchase orders, receipts and invoices would be great. Well, now you can, but not in version 2.4 which is the one found in wheezy and jessie.
I've built so many things on my main desktop that I'm not sure about the exact requirements for gnucash. I've provided a list of packages that I suspect gnucash needs in this post, but it might not be exhaustive.

sudo apt-get install build-essential libglib2.0-dev libgtk2.0-dev guile-2.0-libs libgnomecanvas2-dev libgoffice-0.8-dev guile-2.0-dev libxml2-dev libxslt-dev swig libwebkit-dev libdbd-mysql libdbi-dev libofx-dev python-dev
mkdir ~/tmp/gnucash -p
cd ~/tmp/gnucash
wget http://downloads.sourceforge.net/sourceforge/gnucash/gnucash-2.6.0.tar.bz2
tar xvf gnucash-2.6.0.tar.bz2
cd gnucash-2.6.0/
./configure
Options detected/selected ------------------------- gnucash version ...... : 2.6.0 Build for host ....... : x86_64-unknown-linux-gnu Optional components... : dbi ofx Extra Warnings ....... : -Wdeclaration-after-statement CPPFLAGS ............. : CFLAGS ............... : -Wdeclaration-after-statement -g -O2 -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wno-unused LDFLAGS .............. : prefix................ : /usr/local
make sudo checkinstall --install=no
0 - Maintainer: [ root@beryllium ] 1 - Summary: [ gnucash 2.6.0 ] 2 - Name: [ gnucash ] 3 - Version: [ 1:2.6.0 ] 4 - Release: [ 1 ] 5 - License: [ GPL ] 6 - Group: [ checkinstall ] 7 - Architecture: [ amd64 ] 8 - Source location: [ gnucash-2.6.0 ] 9 - Alternate source location: [ ] 10 - Requires: [ ] 11 - Provides: [ gnucash ] 12 - Conflicts: [ ] 13 - Replaces: [ ]
sudo dpkg -i gnucash_2.6.0-1_amd64.deb

If you have issues with libgnc-gnome.so.0 missing, make sure that /usr/local/lib is in your ld.so.conf and do ldconfig to update.

Either way, you can now associate a file with a transaction by right-clicking.

It does, however, seem as if you can't actually SEE if a file is associated, which makes the feature pretty useless.

04 January 2014

541. Setting up mythtv on debian with leadtek 1000s (SAA7130)

I've been using me-tv (and occasionally kaffeine and vlc) to watch DVB-T on linux for the better part of two years. While it's working absolutely fine, and I really like me-tv, I'd like to get it to work in mythtv as well in the hope that it will support closed captioning.

Note that mythtv is only available via the deb-multimedia repo and not in the offical debian repos. I first tried to install mythtv that way, and while I got pretty far (scanned for channels etc.) I couldn't get a picture when trying to watch TV using mythtv-frontend. The deb-multimedia packages also screwed up my graphics card set-up somehow, which didn't improve my mood. So while that's probably a viable method, I finally decided to compile things myself. Note that if you do keep deb-multimedia enable and do a dist-upgrade the mythplugins package below will be replaced, and with that the main mythtv package as well, leading to all kinds of fun. You might want to give mythplugins a higher version number than I've done below to circumvent that.


Building

sudo dpkg-reconfigure dash

Select 'No', so that /bin/sh/ points to bash instead of dash.

The next port of call was http://www.mythtv.org/wiki/User_Manual:Initial_Installation 

sudo apt-get install build-essential liblircclient-dev libasound2-dev libdts-dev libdvdnav-dev \
 libxv-dev libxxf86vm-dev transcode libmp3lame-dev subversion qt4-dev-tools libqt4-dev libsamplerate0 \
 libxvidcore4 liba52-0.7.4-dev libfame-dev libcdio-dev msttcorefonts libasound2-doc libmad0-dev \
 libid3tag0-dev libvorbis-dev libflac-dev libcdaudio-dev libcdparanoia0-dev fftw3-dev libfaad-dev \
 libsmpeg-dev libmp4v2-dev libtag1-dev mysql-server libvisual-0.4-dev libexif-dev libxvmc-dev \
 libxinerama-dev uuid-dev libicu-dev 
sudo apt-get install yasm checkinstall gdb python-mysqldb python-urlgrabber libnet-upnp-perl
mkdir ~/tmp/mythtv -p
cd ~/tmp/mythtv
git clone -b fixes/0.27 git://github.com/MythTV/mythtv.git
cd mythtv/mythtv/
./configure --enable-proc-opt
make
sudo checkinstall --fstrans=no --install=no
0 - Maintainer: [ andy@helium ] 1 - Summary: [ mythtv 0.27 ] 2 - Name: [ mythtv ] 3 - Version: [ 0.27 ] 4 - Release: [ 1 ] 5 - License: [ GPL ] 6 - Group: [ checkinstall ] 7 - Architecture: [ amd64 ] 8 - Source location: [ mythtv ] 9 - Alternate source location: [ ] 10 - Requires: [ ] 11 - Provides: [ mythtv ] 12 - Conflicts: [ ] 13 - Replaces: [ ]
Exclude files that are in the home directory.

Continue:
sudo dpkg -i mythtv_0.27-1_amd64.deb
cd ../mythplugins/
sudo apt-get install libmysql++-dev python-oauth libdate-manip-perl libxml-simple-perl libimage-size-perl libdatetime-format-iso8601-perl libsoap-lite-perl libjson-perl 
./configure
make
sudo checkinstall --fsmetrans=no --install=no
0 - Maintainer: [ root@helium ] 1 - Summary: [ mythplugins 0.27 ] 2 - Name: [ mythplugins ] 3 - Version: [ 0.27 ] 4 - Release: [ 1 ] 5 - License: [ GPL ] 6 - Group: [ checkinstall ] 7 - Architecture: [ amd64 ] 8 - Source location: [ mythplugins ] 9 - Alternate source location: [ ] 10 - Requires: [ ] 11 - Provides: [ mythplugins ] 12 - Conflicts: [ ] 13 - Replaces: [ ]
sudo dpkg -i mythplugins_0.27-1_amd64.deb

Note that you may want to use a much higher version number for mythplugins than I've done above -- with 0.27 the deb-multimedia version of the package will take precendence, and cause all kinds of fun...

Setting up

sudo useradd mythtv
sudo usermod -a -G mythtv $USER
mkdir ~/.mythtv

Create a file called ~/.mythtv/mysql.txt:
DBHostName=localhost
DBHostPing=no
DBHostName=localhost
DBUserName=mythtv
DBName=mythconverg
DBPassword=mythtv
LocalHostName=helium
where helium is my hostname.
Before you can run mythtv-setup you should prepare the mysql database.

mysql -u root -p
> show databases;
> create database mythconverg;zymichost.com
> create user 'mythtv'@'%' identified by 'mythtv';
> create user 'mythtv'@'localhost' identified by 'mythtv';
> set password for 'mythtv'@'%' = password('mythtv');
> set password for 'mythtv'@'localhost' = password('mythtv');
> connect mythconverg;
> grant all privileges on *.* to 'mythtv'@'%' with grant option;
> grant all privileges on *.* to 'mythtv'@'localhost' with grant option;
> flush privileges;
> exit;

Now run setup:
mythtv-setup

The first time I did this it asked about country and language, and then exited. I then ran it again and went through the setup as shown in the figures below. Note that I had to use the IP, 192.168.2.123, of my computer rather than 127.0.0.1 (i.e. localhost).















I then ran
mythbackend

and let it run in a terminal, followed by
mythfrontend

in another terminal. And it worked! I mean, not the first time, but by following the instructions above I actually got it to work -- up to a point. The audio wasn't working.


While TV is a visual medium it's still nice to have sound. So, in mythfrontend I went to Settings, Audio and picked Pulseaudio, since that's what I use by default anyway.

 I did have the occasional issue with sudden white noise, so I changed to ALSA, and all has been perfect ever since:



Test driving:
Everything seems to be working fine. Hit M for menu:
 You can choose subtitles (or just hit T):

To bring up the Electronic Program Guide (EPG) hit S:
See http://www.mythtv.org/wiki/Keybindings for a list of shortcuts.

Anyway, I'm still exploring. The one thing that's not working yet is the remote control, but that will be solved in due course.

Missing channels:
Mythtv didn't pick up channels Nine, Gem and Go. While scan found them without issue by doing 'scan /usr/share/dvb/dvb-t/au-Melbourne > channels.conf', I couldn't find an easy way to import the scan data.

Nine Melbourne:191625000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_4:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:519:720:1072
GEM:191625000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_4:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:0:1073
GO!:191625000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_4:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:517:700:1074
EXTRA:191625000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_4:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:520:730:1075
EXTRA 2:191625000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_4:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:521:740:1076

Trying to import an existing scan in mythtv didn't allow me to provide a URL, but only showed two old scans pre-populating the import dialogue, which was both weird and annoying.

Instead the key was to add a new transport: fire up mythtv-setup, and go to the Channel editor. Note that I'm using a different skin/menu to the default one (Terra), but the process is the same.


See scan output above for the values to add here



 And you're pretty much done.