Categories
Linux

Removing Linux Mint Debian Edition's Chromium search page

When you install Chromium in the latest version of Linux Mint Debian Edition (LMDE), typing anything in the search/address bar takes you to an awful custom search engine that wastes loads of space and hurts my eyes.

The awful search page that Mint installsSo, how do we get rid of it? We go to the chromium settings via the triple line menu, then we choose Manage Search Engines, and observe that there are two "google" search engines. One has a url similar to google.com/cse (for custom search engine) and is marked as the default. All we do is set one of the other search engines as default, then click the X to delete Mint's one.

Removing Mint's Default Search Engine

Categories
Linux

Installing Linux Mint Debian Edition via a USB stick

I installed 64-bit Mint Debian Edition today (LMDE) but I had a problem getting the image onto the USB stick. I used LinuxLive (LiLi) Usb Creator version 2.8.22 released June 1st 2013, however the default settings resulted in a usb stick that wouldn't boot properly.

The symptom was a kernel panic due to the init process being terminated. It wasn't very easy to see what the cause was, as after the panic the kernel changed the graphics mode back to a text mode which got rid of the error messages. It turned out that after mounting the initrd, it had a problem finding /boot/casper.

This problem occurred because LiLi didn't recognise the iso file, and guessed that it should use its settings for 64-bit Linux Mint Olivia. The fix was to manually select the settings for the most recent version of 64-bit Mint Debian Edition that LiLi knew about.

Settings to choose in LiLi

I was then able to boot into live mode and install to disc from there. I was slightly surprised that there was no direct install link from the boot menu but you can't have everything!

Categories
Linux

Compiling Octave from source on Linux Mint Nadia (Ubuntu 12.10)

I recently needed to build GNU Octave from source, as the version available in the Ubuntu repositories (3.6.2) had a crash that reliably triggered when I attempted to run a matlab script from a lecture I had been watching (a Stanford lecture series called The Fourier Transforms and its Applications).

error: source: error sourcing file `/home/frankster/Reference/TheFourierTransform/materials/lsoftaee261/sinesum2.m'
*** glibc detected *** octave: corrupted double-linked list: 0x00000000020d6380 ***

I pulled the mercurial repository containing the source, and followed the build instructions in etc/HACKING which said to run the ./bootstrap script. Unfortunately, when I ran this script I got the error:

~/octave$ ./bootstrap
./bootstrap: one of these is required: glibtoolize libtoolize

It wasn't immediately clear to me what this error meant, and I couldn't find any answers with a quick search. After a little bit of trial and error, I realised that there might be some build pre-requisites that were not installed. Fortunately on debian-based distributions its incredibly easy to sort this out (for packaged software at least):

sudo apt-get build-dep octave

Development versions of octave have a new QT interface. In order to get this to compile I also installed some qt packages:

sudo apt-get install libqt4-core libqt4-gui libqt4-network libqt4-dev

Categories
Linux

grub-probe: error: not a directory. (grub 1.99 in Ubuntu Linux 12.04)

I upgraded some packages earlier (including a kernel) and received an odd error from grub (version 1.99-21ubuntu3.9)

$ sudo grub-install --recheck /dev/sda
 /usr/sbin/grub-probe: error: not a directory.
 Auto-detection of a filesystem of /dev/sdb1 failed.
 Try with --recheck.
 If the problem persists please report this together with the output of "/usr/sbin/grub-probe --device-map="/boot/grub/device.map" --target=fs -v /boot/grub" to <bug-grub@gnu.org>

I couldn't complete the configuration of the updates that I had downloaded, and worse the machine was probably now unbootable. Poking around a bit, I find that the error reported by grub-probe could be reproduced with:

$ sudo grub-probe -d /dev/sdb1 --target=fs_uuid
grub-probe: error: not a directory.

I didn't know where to go from here so the first thing I tried was to purge grub and reinstall it.

sudo apt-get purge grub*

sudo apt-get install grub-pc

Didn't make any difference, so the next thing I tried was to downgrade to an earlier version of grub (1.99-21ubuntu3).

sudo apt-get purge grub*

sudo apt-get install grub-pc=1.99-21ubuntu3 grub2-common=1.99-21ubuntu3 grub-pc-bin=1.99-21ubuntu3 grub-common=1.99-21ubuntu3

Unfortunately this made no difference either. So the next thing I tried was to install the version of grub from Ubuntu 12.10. There were some dependency conflicts which I had to manually fix as you can see here:

sudo apt-get remove apport-hooks-medibuntu apport-gtk apport

sudo dpkg -i liblzma5_5.1.1alpha+20120614-1_amd64.deb grub2-common_2.00-7ubuntu11_amd64.deb  grub-common_2.00-7ubuntu11_amd64.deb  grub-gfxpayload-lists_0.6_amd64.deb  grub-pc_2.00-7ubuntu11_amd64.deb  grub-pc-bin_2.00-7ubuntu11_amd64.deb

Finally, grub installed ok! Crisis averted.

Categories
Linux

Strip audio from a video in Ubuntu Linux

Lets say you have a video you recorded on your mobile phone, and you want to send it to someone but there is a noisy audio track which is irrelevant to the subject. Stripping out the audio track is fairly simple using the libav-tools package.

sudo apt-get install libav-tools

avconv -i INPUT.3gp -an -c:v copy OUTPUT.3gp

"-i INPUT.3gp" specifies the input file

"-an" specifies that there will be no audio track in the output file (or -vn would have no video track). Note that if "-an" appeared before "-i INPUT.3gp" we would copy no audio track from the input file (but there would still be an audio track in the output file, albeit empty possibly).

"-c:v copy" specifies the codec we use to encode the video track in the output file. Here we specify copy which means we don't transcode it. So rather than rendering the input video track to a buffer, then re-encoding it we are just copying it directly from the input file to the output file which means we don't lose any quality (whereas if we re-encoded it with a lossy codec then we would have a lower quality output file). Note that if we specified "-c:v <CODEC>" before the "-i INPUT.3gp" we would be specifying the codec used to decode the input file, rather than encode the output file.

"OUTPUT.3gp" specifies the output file. Obviously.

Categories
Uncategorized

How NOT to calculate daily compound interest rate

I wanted to work out how much interest I would gain by leaving some money in a certain account for a few days. I knew I could derive this myself using logarithms but I was too lazy, so I searched google and clicked on the top result which turned out to be completely incorrect.

The author David Ingram recommends calculating a weekly interest rate from an annual interest rate by dividing by 12 months then 4 weeks per month which is just plain stupid, as the correct answer might be to divide by 365 (or 366!) days, then multiply by 7 days per week.

David Ingram fails to consider this distinction again and compounds his error when he suggests calculating your daily interest rate simply by dividing the incorrect weekly rate by 7. His method of calculation causes an error of 8% which is pretty significant!

This is of course assuming that we are talking about simple rather than compound interest, although the author makes no mention of this distinction. Certainly in the UK its rare to see simple interest used in financial products.

So if we're actually interested in the compound daily interest rate that is equivalent to a particular annual interest rate, this is what we need:

Categories
Linux

ZoneMinder: Bareword "ZM_PATH_LOGS" not allowed while "strict subs" in use

Since a recent burglary I have been using ZoneMinder to provide CCTV security for my house on my Ubuntu 12.04 machine. I noticed earlier today that zoneminder had stopped running over the weekend and when I tried to start the service again, I got the following error:

Starting ZoneMinder: Bareword "ZM_PATH_LOGS" not allowed while "strict subs" in use at /usr/share/perl5/ZoneMinder/Logger.pm line 153.
BEGIN not safe after errors--compilation aborted at /usr/share/perl5/ZoneMinder/Logger.pm line 168.
Compilation failed in require at /usr/share/perl5/ZoneMinder.pm line 34.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder.pm line 34.
Compilation failed in require at /usr/bin/zmpkg.pl line 37.
BEGIN failed--compilation aborted at /usr/bin/zmpkg.pl line 37.
failure

Looking through the ZoneMinder code I discovered that the error indicated that a configuration variable somehow wasn't set. My first thought was that perhaps a new configuration variable had been added in an upgrade but hadn't been automatically added to the configuration file. So I added a line containing ZM_PATH_LOGS to /etc/zm/zm.conf but now when I tried to start zoneminder, I received a similar (but different error):

Starting ZoneMinder: Bareword "ZM_USE_DEEP_STORAGE" not allowed while "strict subs" in use at /usr/share/perl5/ZoneMinder/General.pm line 207.
BEGIN not safe after errors--compilation aborted at /usr/share/perl5/ZoneMinder/General.pm line 226.
Compilation failed in require at /usr/share/perl5/ZoneMinder.pm line 35.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder.pm line 35.
Compilation failed in require at /usr/bin/zmpkg.pl line 37.
BEGIN failed--compilation aborted at /usr/bin/zmpkg.pl line 37.
failure

I added a line for this then another similar (but different) error appeared! Clearly this approach isn't correct. So I logged into mysql and had a poke around:

mysql -u XXX -p
mysql> show databases;
mysql> use zm;
mysql> show tables;
+----------------+
| Tables_in_zm   |
+----------------+
| Config         |
| ControlPresets |
| Controls       |
| Devices        |
| Events         |
| Filters        |
| Frames         |
| Groups         |
| Logs           |
| MonitorPresets |
| Monitors       |
| States         |
| Stats          |
| TriggersX10    |
| Users          |
| ZonePresets    |
| Zones          |
+----------------+
17 rows in set (0.00 sec)

mysql> select * from Config;

0 rows in set (0.00 sec)

Like in iPhone adverts, the above sequence is shortened. But the surprising result appears at the end: there are no lines in the Config table! This must be the culprit preventing ZoneMinder from starting.

Its not clear how this config table has been reset, as I don't recall updating the ZoneMinder packages recently, so I don't think its a botched database upgrade. I have restarted the machine that it runs on a couple of times over the weekend so perhaps the database got corrupted at shutdown, though I can't find any mysql logs complaining about this. In conclusion, I don't know how it happened! But if it happens again all the info is here.

To resolve this, I download the ubuntu package for zoneminder and had a look in the postinst install script to see how it initialised the database. It turns out there is an sql file at /usr/share/zoneminder/db/zm_create.sql which is applied at package installation. I edited this file and removed all lines that didn't affect the Config table and applied it manually.

Finally zoneminder started up (albeit without my configurations)! After reconfiguring zoneminder, I noticed in ZoneMinder's log database the following entry:

Config mismatch, expected 218 items, read 0. Try running 'zmupdate.pl -f' to reload config.

If this happens again, perhaps 'zmupdate.pl -f' is sufficient to fix it, instead of error-prone sql hacking. (update: according to commenters this does not work!)

And the moral of the story is: always backup your databases!

Categories
Windows

Acquiring hxcomp.exe without having Visual Studio installed

I have been using the excellent IDA Free to reverse engineer the driver for Akai's MPD16 as Akai have declined to support Windows 7 and it seems a shame for perfectly good hardware to be condemned to landfills prematurely.

While I was doing this I ran across a Zynamics script which purports to import function details from MSDN documentation into IDA. To cut a long story short you need hxcomp.exe which as you can read about here comes from the Visual Studio SDK. Unfortunately for me, the SDK installer refuses to install unless you have Visual Studio (non-express) installed. Not to worry, its possible to unpack the files from the installer manually with the help of some open source software.

I used Visual Studio 2005 SDK Version 4.0 which arrived in a file called VsSDKFebruary2007.exe. I expect it will work in more or less the same way with other SDK versions as well.

Use 7zip or similar to unpack VsSDKFebrurary2007.exe. There are several files inside but you only need vssdk.msi.

7zip isn't good enough at seeing inside vssdk.msi to get at hxcomp.exe so I found lessmsi which did the job nicely.

Fire up lessmsi and open vssdk.msi. Sort by Directory then scroll down until you find SourceDir\PFiles\Visual Studio 2005 SDK\2007.02\VisualStudioIntegration\Archive\Help. Select everything in that directory then click the extract button in the bottom right.

Now you have the files you need, you must manually install them. Note that there is an error in the description provided there and he accidentally pastes the contents of uninstall.bat twice so you don't have the correct install.cmd. What you actually need in install.cmd as far as I can tell is:

@echo off
set HXCOMP_DIR=C:\Program Files\HxComp
set PATH=%PATH%;"%HXCOMP_DIR%"
regedit /s install.reg
hxreg -n Hx -i Resources -l 1033 -s Resources.HxS

If you are after the Zynamics IDA script then you should now be able to decompile the help files in your sdk with a command like that described in the comments here.

for /R %x in (*.hxs) do hxcomp -u "%x"
Categories
Internet Linux

BT Infinity and OpenWRT

So my girlfriend can't get reliable wifi upstairs on her iphone, maybe the bed's metal frame is acting as a faraday cage, maybe the BT HomeHub 3 router is not very good.

Regardless of who's to blame for the wifi issues, the HomeHub's interface doesn't let you change DNS servers - ostensibly for security reasons but as likely to be related to BT's commercial decision to redirect failed DNS queries to advertising web pages. This is hugely frustrating when you are trying to find out if a host is up by pinging it, and the ping succeeds while the host is down, because you mistyped the hostname and were redirected to BT's "spoof" response.

Anoyingly, if the broadband connection goes down, the router starts redirecting all web requests to itself at the address bthomehub.home which causes certificate errors in applications like thunderbird - generally a pain in the arse.

So its clearly time to ditch the HomeHub 3 and get a proper router. Given the ddwrt GPL violations, OpenWRT is the obvious choice of OS.

Although OpenWRT can be put on a HomeHub 3, the current procedure involves a soldering iron. Therefore I bought myself a TP-Link WR1043ND which is supported by OpenWRT and has a gigabit switch - not bad for £50. Upgrading the firmware was a doddle, simply a matter of downloading the latest firmware for my device (http://downloads.openwrt.org/backfire/10.03.1/ar71xx/openwrt-ar71xx-tl-wr1043nd-v1-squashfs-factory.bin at time of writing) and using the router's built in firmware upgrade page! Very smooth.

Its all fairly straightforward to configure via the web interface (and in fact it comes with a pretty much decent configuration out of the box). I connected the bt infinity modem via the WAN port, and set up the PPPoE connection using the password from my homehub 3 router (bthomehub@btbroadband.com). There is no password listed in the homehub 3 configuration pages but it turns out I had to set up a password of "BT" before the connection succeeded. This was the only non-obvious thing I had to do to get everything working.

Categories
Linux

Secure MythWeb with Mythbuntu 12.04

When you install the MythWeb module, the default security settings in Mythbuntu allow password-less access from anywhere. If you wish to be able to schedule (or watch) recordings when you are away from home then you may want to allow users on your local network to access the screens without a password, while requiring a password for connections from outside your network.

Tell Apache to require authentication for MythWeb

Open /etc/apache2/sites-enabled/mythweb.conf (remembering to gain root access) and find the commented out section that looks like this:

    ############################################################################
    # I *strongly* urge you to turn on authentication for MythWeb.  It is disabled
    # by default because it requires you to set up your own password file.  Please
    # see the man page for htdigest and then configure the following four directives
    # to suit your authentication needs.
    #
    #    AuthType           Digest
    #    AuthName           "MythTV"
    #    AuthUserFile       /var/www/htdigest
    #    Require            valid-user
    #    BrowserMatch       "MSIE"      AuthDigestEnableQueryStringHack=On
    #    Order              allow,deny

I am not convinced /var/www is a safe place to keep your htdigest file, so I changed that line to store it in /etc/mythtv/htdigest. I added an "Allow from 192.168.0." line to allow users with an ip address starting 192.168.0 to connect without a password, then a "Satisfy any" line to state that the page can only be served to an authenticated valid-user (from the Require line), or on the local network (from the Allow from line). This is what my final section looked like.

        AuthType           Digest
        AuthName           "MythTV"
    #    AuthUserFile       /var/www/htdigest
        AuthUserFile       /etc/mythtv/htdigest
        Require            valid-user
        BrowserMatch       "MSIE"      AuthDigestEnableQueryStringHack=On
        Order              allow,deny
        Allow from 192.168.0.
        Satisfy            any

Enable the Apache module which implements the Digest authentication method

You now must enable apache's auth_digest module using the a2enmod command.

sudo a2enmod auth_digest

If you forget to do this you will see errors like this in your apache error log when you attempt to connect from a non-local address:

[Mon Jul 09 23:27:21 2012] [crit] [client 69.163.149.163] configuration error:  couldn't check user.  Check your authn provider!: /mythweb

Choose a username and password for remote access

Assuming you used the same values for AuthUserFile and AuthName as I did) then you can add the first user to the password file:

sudo htdigest -c /etc/mythtv/htdigest MythTV username_to_add

The -c parameter creates a blank file so don't use it for any additional users you add. If you don't have htdigest installed, you may need to install the apache2-utils package (sudo apt-get install apache2-utils).

Ensure that only the apache server can read the password file:

sudo chown www-data /etc/mythtv/htdigest
sudo chmod 640 /etc/mythtv/htdigest

Tell Apache about the configuration changes

sudo service apache2 reload

It should now be safe to expose MythWeb to the outside world!

 

Categories
Linux

Shuttle XS35GS V3 and Mythbuntu 12.04

I bought the recently released Shuttle XS35GS V3 (also called XS35GTA V3) to use as a mythtv frontend. As usual, nothing works correctly first time round and there were a few things I needed to set up manually to get it working correctly.

1) I had problems with the onboard wifi - it would apparently connect then as soon as you tried to use the connection various errors messages would appear in the debug log.
Jul  5 10:37:18 bedroom kernel: [  157.712828] rtl8192c_common:rtl92c_firmware_selfreset(): 8051 reset fail.
Jul  5 10:37:23 bedroom kernel: [  162.696823] rtl8192ce:_rtl92ce_llt_write():<0-0> Failed to polling write LLT done at address 0!
Jul  5 10:37:23 bedroom kernel: [  162.696833] rtl8192ce:rtl92ce_hw_init():<0-0> Init MAC failed

So I disabled the wifi in the bios and used a USB wifi stick for the time being. I may end up installing a cable if wifi does not give adequate streaming performance for mythtv.

2) I connected the shuttle via HDMI cable to the TV, unfortunately no sound was transmitted initially. The shuttle model I chose has an ATI chipset, so I first tried installing ATI binary drivers:
sudo apt-get install fglrx-updates
After that I listed the drivers and played test sounds on each device with VLC until I found which one worked.
frankster@bedroom:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: STAC92xx Analog [STAC92xx Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0

VLC confirmed that the final device "HD-Audio Generic" is the correct one so the next step is to apply that setting inside mythtv. Unforunately the list inside mythtv is different to what I saw in the output of "aplay -l", but I worked out that mythtv describes it thus:
hdmi:CARD=Generic,DEV=0

3) Using the latest version of fglrx-updates (2:8.960-0ubuntu1.1) I found that switching the TV (connected via HDMI) off then on again caused the sound to stop working, requiring a system reboot. I downloaded the drivers from the ATI website and the issue was solved. The latest version at the time I downloaded was catalyst 12.6, which generated packages with a version of 8.980 (in contrast to the Ubuntu packages which are version 8.960).

4) The bios version that came with my device (1.00) had two problems. When requesting a restart, the machine would instead shutdown. Secondly the Ubuntu 64-bit installer didn't believe that 64-bit could be installed so I had to install 32-bit. (I'm about 90% certain that you should be able to install 64-bit on the Atom D2700).

I installed the latest bios driver (1.05) and this resolved the reboot issue. I have not attempted to reinstall since, so I don't know about the 64-bit installer issue.

Updated 19th August 2012

Categories
Linux

Kworld PC160-2T remote control on Ubuntu Linux 11.10

I recently bought a dual tuner card for my Mythtv box (and I discussed getting it working with mythtv here). The good news is that the IR receiver on the card is detected by the driver, however the bad news is that the remote does not work out of the box with Ubuntu 11.10 because Ubuntu doesn't have a keymap for it. You can see in the dmesg output that it loads the default rc-empty keymap:

[ 31.058541] Registered IR keymap rc-empty
[ 31.058604] input: IR-receiver inside an USB DVB receiver as /devices/pci0000:00/0000:00:1e.0/0000:05:01.2/usb3/3-1/rc/rc0/input4
[ 31.058713] rc0: IR-receiver inside an USB DVB receiver as /devices/pci0000:00/0000:00:1e.0/0000:05:01.2/usb3/3-1/rc/rc0
[ 31.058716] dvb-usb: schedule remote query interval to 500 msecs.

So I sorted it out by creating my own keymap - its still a bit of a work in progress as I have no idea what functions some of the pictures on the buttons represent! To create the keymap, I used the programme evtest to capture the scancodes generated by the remote. I then added the scancode to a file and mapped it to a sensible looking event which I chose from this list (see also this one). I saved my keymap in the /etc/rc_keymaps directory and inserted it (I first closed mythtv and switched out of X to a terminal with ctrl-alt-F2 to ensure that no application had the event device open).

frankster@mythtv:/etc/rc_keymaps$ sudo ir-keytable -c -p NEC -w kworld_pc160-2t
Read kworld_pc160-2t table
Old keytable cleared
Wrote 30 keycode(s) to driver
Protocols changed to NEC

I then verified my keymap was working with ir-keytable. Now we receive as well as the scancode, a key up and down event every time a button is pressed.

frankster@mythtv:/etc/rc_keymaps$ sudo ir-keytable -t
Testing events. Please, press CTRL-C to abort.
1329667198.608627: event MSC: scancode = 866b00
1329667198.608631: event key down: KEY_NUMERIC_1 (0x0201)
1329667198.608632: event sync
1329667198.859974: event key up: KEY_NUMERIC_1 (0x0201)
1329667198.859975: event sync

Its all very well being able to manually install the keymap, but we need to make this a bit more permanent. I am currently preparing a kernel patch so that this remote control can be handled automatically, but for now we can achieve the same effect in userspace. I added to /etc/rc_maps.cfg the following line:

af9015 * /etc/rc_keymaps/kworld_pc160-2t

ir-keytable could then load the appropriate keytable.

sudo ir-keytable -a /etc/rc_maps.cfg 

This is the keymap I am currently using, I expect I will do some more tweaking as time goes on.

# table kworld_pc160-2t, type: NEC

0x866b1d KEY_POWER
#0x866b0x kworld log button - not sure what this does
#0x866b16 button between kworld button and power button

0x866b0a KEY_NUMERIC_0
0x866b00 KEY_NUMERIC_1
0x866b01 KEY_NUMERIC_2
0x866b02 KEY_NUMERIC_3
0x866b03 KEY_NUMERIC_4
0x866b04 KEY_NUMERIC_5
0x866b05 KEY_NUMERIC_6
0x866b06 KEY_NUMERIC_7
0x866b07 KEY_NUMERIC_8
0x866b08 KEY_NUMERIC_9

#0x866b09 some kind of reload symbol
0x866b14 KEY_MUTE

#0x866b1e small rectangle and big rectangle
#0x866b17 fullscreen?
0x866b1f KEY_HOME
0x866b0e KEY_BACK

0x866b20 KEY_UP
0x866b21 KEY_DOWN
0x866b42 KEY_LEFT
0x866b43 KEY_RIGHT
0x866b0b KEY_ENTER

0x866b10 KEY_CHANNELUP
0x866b11 KEY_CHANNELDOWN
0x866b12 KEY_VOLUMEDOWN
0x866b13 KEY_VOLUMEUP

#0x866b19 scheduled recording?
0x866b1b KEY_RECORD
0x866b4b KEY_EPG

0x866b1a KEY_STOP
0x866b44 KEY_PLAYPAUSE
0x866b40 KEY_BACK
0x866b41 KEY_FORWARD

#0x866b22 Tx button

#0x866b15 looks like some kind of transmit or infrared symbol
#0x866b0f widescreen?
#0x866b1c screenshot?
0x866b4a KEY_SLEEP
Categories
Linux

Using the KWorld PC160-2T with Mythtv on Ubuntu Linux 11.10

The PCI card is internally implemented as a USB interface connected to the two tuners over USB which is interesting to say the least. Presumably its cheaper to put an extra USB chip on a PCI card than to make a new design specifically for PCI.

The first problem I had was that there was no firmware. I spotted this in the output from dmesg:

[ 13.980942] dvb-usb: found a 'KWorld PlusTV Dual DVB-T PCI (DVB-T PC160-2T)' in cold state, will try to load a firmware
[ 15.147767] dvb-usb: did not find the firmware file. (dvb-usb-af9015.fw) Please see linux/Documentation/dvb/ for more details on firmware-problems. (-2)
[ 15.147781] dvb_usb_af9015: probe of 3-1:1.0 failed with error -2

Although the documentation describes a method to obtain the firmware by running a script, it turns out that Ubuntu already has the firmware packaged. So I just needed to install linux-firmware-nonfree.

sudo apt-get install linux-firmware-nonfree

Then I needed reinsert the modules so that the firmware could get downloaded:

sudo rmmod dvb_usb_af9015
sudo rmmod dvb-usb
modprobe
modprobe dvb-usb
sudo modprobe dvb-usb
sudo modprobe dvb_usb_af9015

Next time I ran dmesg, there were some much more promising lines:

[   29.822162] dvb-usb: found a 'KWorld PlusTV Dual DVB-T PCI (DVB-T PC160-2T)' in cold state, will try to load a firmware
[   29.967469] dvb-usb: downloading firmware from file 'dvb-usb-af9015.fw'
[   30.037577] dvb-usb: found a 'KWorld PlusTV Dual DVB-T PCI (DVB-T PC160-2T)' in warm state.
[   30.037783] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
[   30.038103] DVB: registering new adapter (KWorld PlusTV Dual DVB-T PCI (DVB-T PC160-2T))
[   30.042065] af9013: firmware version:4.95.0.0
[   30.046814] DVB: registering adapter 0 frontend 0 (Afatech AF9013 DVB-T)...
[   30.048791] tda18271 0-00c0: creating new instance
[   30.054815] TDA18271HD/C2 detected @ 0-00c0
[   30.324093] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
[   30.324505] DVB: registering new adapter (KWorld PlusTV Dual DVB-T PCI (DVB-T PC160-2T))
[   30.596052] ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   31.040928] af9013: found a 'Afatech AF9013 DVB-T' in warm state.
[   31.044418] af9013: firmware version:4.95.0.0
[   31.058424] DVB: registering adapter 1 frontend 0 (Afatech AF9013 DVB-T)...
[   31.058533] tda18271 0-00c0: attaching existing instance
[   31.058541] Registered IR keymap rc-empty
[   31.058604] input: IR-receiver inside an USB DVB receiver as /devices/pci0000:00/0000:00:1e.0/0000:05:01.2/usb3/3-1/rc/rc0/input4
[   31.058713] rc0: IR-receiver inside an USB DVB receiver as /devices/pci0000:00/0000:00:1e.0/0000:05:01.2/usb3/3-1/rc/rc0
[   31.058716] dvb-usb: schedule remote query interval to 500 msecs.
[   31.058720] dvb-usb: KWorld PlusTV Dual DVB-T PCI (DVB-T PC160-2T) successfully initialized and connected.
[   31.076254] usbcore: registered new interface driver dvb_usb_af9015

I found http://parker1.co.uk/mythtv_dvb.php to have some useful information - it shows a method of verifying that the card is working by taking mythtv out of the equation.

Now that I knew that the card was working, I configured it in mythtv. As there are two tuners I configured both in mythtv, making sure to increase the setting allowing multiple streams to be recorded from the same multiplex. (This is due to the way dvb-t/freeview works - several stations are transmitted on the same channel). My biggest worry when I ordered the card was that it would not have this funtionality and that I would never be able to watch or record more than 2 channels simultaneously, but the following line in the output of dmesg reassured me:

[   30.324093] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.

I was able to watch some TV on mythtv and caught the end of Gypsy Wedding...probably the only reality TV show that I can tolerate! I then set up some recordings to take place over the next few days unfortunately none of these worked. It turns out that there is currently a bug in the 3.0 and 3.2 kernels' drivers that handles the chip - the driver doesn't like switching between the two tuners. A symptom of the bug is i2c read errors such as this:

[   38.379309] af9013: I2C read failed reg:d417

This bug causes both tuners to eventually stop working. I worked around this by disabling the second tuner in mythtv, and mythtv has been stable since. I will solve this later, but for now I need to get the remote working!

Categories
Linux

undefined reference to `ceil' (or pow or floor or ...) in ubuntu 11.10

There has been a change to the build tools in ubuntu 11.10 - The "--as-needed" flag is now passed to the linker. This primarily has implications for dynamic library linking but it also affects the order that libraries appear on the command line even for static linking.

A simple example of the problem:

frankster@frankie-laptop:~> cat testm.c
#include <math.h>

int main(int argc, char*argv[]){
double x;
double return_val = ceil(x);
return 0;
}
frankster@frankie-laptop:~> gcc -lm testm.c
/tmp/ccNkQLo6.o: In function `main':
testm.c:(.text+0x15): undefined reference to `ceil'
collect2: ld returned 1 exit status>

A quick fix solution could be to pass the "-Wl,--no-as-needed" option to gcc which turns off the option in ld. However the real problem in the example I provided is the order of -lm and testm.c. The following builds successfully:

gcc testm.c -lm

More info at http://www.gentoo.org/proj/en/qa/asneeded.xml and https://wiki.ubuntu.com/OneiricOcelot/ReleaseNotes?action=show&redirect=OneiricOcelot%2FTechnicalOverview#GCC_4.6_Toolchain

Categories
Music

EMU Legacy archive

Since Creative have taken the EMU Legacy pages offline, its no longer possible to get hold of for example OS updates for various devices such as the Proteus 2000, MP7, EMU Ultra etc. I am making available as much of the old material as possible here. Let me know in the comments if there's anything that's missing. Don't blame me if anything doesn't work (but please do let me know)!

(Edit: More recently some of these files have become available again  at http://www.creative.com/emu/support/downloads/legacy/ so its worth having a look there as well.)

(Edit2: and at some point that link stopped working again. Leaving it up for reference).

Proteus

pcp2xr.zip
pcp3xr.zip
pcp1.zip
pcp2.zip
pcp1xr.zip
pcp3.zip

Proteus 1000

This should be the OS update you need if you have any of the following:

  • Proteus 1000
  • XL-1 (not the turbo version)
  • Mo'Phatt
  • B-3
  • Planet Earth

p1k226.zip

Proteus 2000

The Proteus 2000 family contains the following:

  • Proteus 2000
  • Virtuoso 2000
  • Turbo Phatt
  • Orbit-3
  • Vintage Pro
  • XL-1 (turbo version)

E-Loader_1.1_Install.zip
Proteus2KOp-E.pdf
Proteus Family SysEx 2.2.pdf
p2k226.zip
E-LoaderOperationManual.pdf
E-Loader_1.1_Install.sit

Proteus 2500

E-Loader_1.1_Install.zip
E-LoaderOperationManual.pdf
patterns2500.zip
Command200.zip

Ultra

EOS28CL.EXE
eos40manual.zip
462prep.zip
EOS410CL.EXE

MP7

MP7Op-F.pdf
MpToMp7SMFBanks.zip
E-Loader_1.1_Install.zip
Proteus Family SysEx 2.2.pdf
command200.zip
MP7Patterns.zip
CSprepreadme.txt
MpToMp7SMFBanks.zip
E-Loader_1.1_Install.zip
command200.zip
MP7Patterns.zip
MpToMp7MIDBanks.zip
E-LoaderOperationManual.pdf
E-Loader_1.1_Install.sit
Cmd_Sta_2.0_Addendum.pdf
MpToMp7MIDBanks.zip
E-LoaderOperationManual.pdf
E-Loader_1.1_Install.sit
commandprep10.dli

EOS

EOS28CL.EXE
EOS_FAT_Addend.pdf
eos28cl.sit
eos40manual.zip
EOS410CL.EXE
EOS4-0.pdf
EOS470.zip
EOSV461.EXE
eos_v461.sit
eos410cl.sit
EOS460Addend.pdf
EOS_V461.EXE
EOS_V460.EXE
EOS410UL.EXE

Misc

ORCH2_drummap.txt
XLEAD_drummap.txt
AOrch_drummap.txt
World_drummap.txt
PHATT_drummap.txt
TeCnO_drummap.txt
P123_drummap.txt
ZR_drummap.txt

Manuals

Audity 2000: Audity_2000.pdf
B3: B3_Manual.pdf
Mo'Phatt: MOPhattRevB.pdf
Orbit 3: E-Mu_Orbit-3_Manual.pdf
Planet Phatt: E-Mu_PlanetPhatt_Manual.pdf
Proteus 1000: E-Mu_Proteus1000_Manual.pdf
Proteus 2000: Proteus2KOp-E.pdf
Xtreme Lead-1: E-Mu_XL-1_Manual.pdf
Xtreme Lead-1 Turbo: XL1TurboOp-A.pdf
Vintage Pro: E-Mu_VintagePro_Manual.pdf
Virtuoso 2000: Virtuoso 2000.pdf

Proteus 2000 Family SysEx specification: Proteus Family SysEx 2.2.pdf

Other Resources

There is another site archiving the "legacy" emu files, the Emu Legacy Wiki, and the Proteus 2000 family yahoo group. Some manuals available here.