Wednesday, 13 February 2013

Airport update 7.6.3: IPv6 OK

I just loaded up the Airport/Time capsule update 7.6.3 and everything works fine so far: my IPv6 tunnel is working fine (contrary to some other articles out there..). We'll see if it brings stability enhancements to the Apple networking...lets hope so....

I had some issues with my Hurricane Electric dynDNS setup (Very useful if you have a dynamic address for your ADSL) in conjunction with my IPv6 tunnel, but I fixed the problem by removing the dynDNS entry from the ipv6 tunnel Advanced settings and reinstating it. It may also have been down to making sure Ping (ICMP) was unblocked for the he.net servers.


Tuesday, 29 January 2013

Using bluetooth audio in Linux

I just spent a while trying to find out how to get my laptop to play audio to a Bluetooth Headset. It seems a lot of the info out there is out of date. Here are some instructions that work with bluez version 4.9X on Ubuntu 12.04.

Firstly make sure you've got the following packages e.g.:
% sudo apt-get install bluez alsa-utils

To do it you need to make sure all the bluetooth kernel modules are loaded - the following command should show the bluetooth modules if they're loaded e.g.:
% lsmod | grep blue
bluetooth 158479  23 bnep,rfcomm,btusb

Then you can check the bluetooth adapter is operational by showing its address info e.g.:
$ hciconfig
hci0:    Type: BR/EDR  Bus: USB
    BD Address: 00:02:7e:16:0D:0a  ACL MTU: 384:8  SCO MTU: 64:8
    UP RUNNING PSCAN ISCAN 
    RX bytes:58444 acl:314 sco:0 events:6846 errors:0
    TX bytes:4821276 acl:17765 sco:0 commands:152 errors:0

Next you need to switch on your headset and put it into discovery mode (e.g. push and hold the power button or something). Then you get your laptop to scan for it e.g.:
% hcitool scan
Scanning ...
    00:0B:E4:9A:15:E4    Nokia BH-214

Then you need to pair with this device as follows - It will ask you for the PIN code for your device (e.g. 0000 or 1111 or something) and then it will add it to the list on your machine (you'll need to replace the bluetooth interface 'hci#' with your one in this part e.g. hci0) e.g.:
% sudo bluez-simple-agent hci# 00:0B:E4:9A:15:E4
RequestPinCode (/org/bluez/9261/hci0/dev_00_0B_E4_9A_15_E4)
Enter PIN Code: 0000
Release
New device (/org/bluez/9261/hci0/dev_00_0B_E4_9A_15_E4)

Now you need to set up the device for use by ALSA sound system - create a file called ~/.asoundrc containing the following (you'll need to replace the bluetooth address with your one in this part) e.g.:
pcm.bluetooth {
   type bluetooth
   device 00:0B:E4:9A:15:E4
}

Finally you can now play audio to your headset:
aplay -D bluetooth myaudio.wav

Or you can select the bluetooth audio device in other audio apps.

Friday, 16 November 2012

Messages beta due for the chop

So it seems Apple have announced that its Messages (beta) app is gonna bite the dust (expire;()on Friday 14th December. You're up the creak if your box won't go to Mountain Lion land (like quite a few older machines).

Darn. I might even have paid for a real app along the same lines as it has been quite handy to be able to use a real keyboard to send iMessages.

Friday, 2 November 2012

Apple's Messages beta expired....NOT

Final Update: It has now expired - see here.

Update: No it had NOT died yet, but it had just seemed to be dead - but after rebooting my machine it came back to life and worked fine again. I'll update the post if I discover what made it appear to be dead...

Well it seems that Apple's Messages beta app (on Lion) expired today (the app started but most menu items were greyed out) which is a shame as it was quite useful to be able to send messages to pals that had iMessage. I don't know why they don't do a separate app available for download as Mountain Lion is only installable on newer hardware. I guess they want people to upgrade...

Although under the hood it was really iChat and as a matter of fact so was Facetime (aka: Viceroy 1.5.0) with a couple of extra features...

Let me know if you find any tweaks to bring it back to life (I tried the basic ones like changing the date back with no luck).

Friday, 26 October 2012

Playback/display YUV video file

I was trying to play a YUV file (e.g. the foreman.yuv clip from somewhere like here, or here) - the simplest way seems to be to get mplayer and run it like this (note the -rawvideo option indicates the file format - see mplayer man page for more info):
mplayer foreman.yuv -demuxer rawvideo -rawvideo cif

Or you can use Gstreamer (available for Linux, Windows, and OSX, though there's a problem using autovideosink on the cmd line on the Mac) like this:
gst-launch filesrc location=foreman.yuv ! videoparse width=352 height=288 framerate=25/1 ! ffmpegcolorspace ! autovideosink

You'll obviously need to change the resolution and potentially framerate for different video samples but these work with 'foreman' clip.

BTW if you want to compute the PSNR between two YUV files you can use ffmpeg's tiny_psnr utility like so:
tiny_psnr foreman.yuv foreman-mangled.yuv

Saturday, 20 October 2012

How to change the 'original' date on a JPEG photo

So you've got a photo with a weird date on it - how do you change it? Well on OSX or Linux you can do it the terminal using a handy utility called exif (which you'll need to get from macports or apt):

exif --tag 0x9003 --ifd='EXIF' --set-value='2012:10:17 16:30:37' myphoto.jpg

It will create a new file with the new date called myphoto.jpg.modified.jpg which you can then rename to the original or something else.

There are of course other tools but this one works for me. I'll list others if/when I come across them.

Note: In theory you could use iPhoto on OSX but it is unfortunately buggy - so if you have a date like 1/2/1911 and you try moving it forward with iPhoto then it sets a date earlier in time?!

Wednesday, 25 July 2012

Windows networking more reliable on Time Capsule

So you're trying to connect/backup to your Time Capsule (1st Gen OS7.6.1) and it seems like it just died...? But you can still connect using the AirPort Utility? And it still pings.... Oh but wait you can connect to the disc using...... Yes Windows file sharing protocol (SMB/Samba). What's going on?!

It seems that Apple's File Sharing (AFP) server just dies - quite often. Indeed it would seem that the Time Capsule's AFP implementation is flakier than their Windows (SMB) server. That's handy for an Apple product?!

The annoying thing is that whilst you can connect to the thing using the AirPort Utility you can't restart it - it just hangs. So you have go and turn it on and off.

Tuesday, 17 July 2012

Time Machine: Indexing backup......yawn....FIXED

Yeah it's getting boring seeing that message (and/or 'Waiting for index to be ready' in system logs /var/log/system.log) when your Mac is supposed to be actually backing up. I had this problem on Snow Leopard and then for a while on Lion but I now seem to have sorted it. I tried a few approaches and removing the spotlight index actually fixed it this time (though other times it has just been a question of waiting):
  • Wait: It can take a loooong time to complete backups and indexing of backups so wait a few hours or even a day or so to see if it just sorts itself out.
  • Repair Backup:
    1. Turn off Time Machine in the preferences.
    2. Mount the Time Machine Backups as follows: In Finder you navigate to your backup disk and then find your machine's actual backup file (your_computer_name.sparsebundle) and double click on it - it will put a new disk in Finder's sidebar: 'Time Machine Backups'. 
    3. Then open up Disk Utility and select the 'Time Machine Backups' disk and click repair.
    4. Eject the 'Time Machine Backups' disk and re-enable Time Machine in the system prefs.
  • Remove Spotlight Index: Follow steps (1) and (2) above then open a Terminal window and type the following:
    sudo rm -rf /Volumes/Time\ Machine\ Backups/.Spotlight-V100

    Then follow step (4) above. After this your backups may take longer for a day or so whilst Time Machine rebuilds its indexes but it should settle down soon.
  • Disable Spotlight for TM Backups: Spotlight can be disabled by firstly ensuring that 'Time Machine Backups' is
    mounted (see (2) above). The going to Spotlight Prefs and adding the disk to the 'Privacy' section. Alternatively it can be done on the command line as follows:
    sudo mdutil -i off /Volumes/Time\ Machine\ Backups
If you don't get anywhere with these approaches then check out this guy's page which has plenty of other things to try.

[Updated: 26oct12: Cleanup and Pondini link]