Sunday, 28 September 2014

NVDA And Custome Braille Display

It is not possible, within NVDA, to create and add your own braille tables, but it is possible to edit / change an existing one.


The need to change arose for a couple of reasons - firstly, we did not like the number character, and preferred instead to use the dot-8 to indicate numbers.  Secondly, we wanted some of the accents to be included, but, in general, to stick the the English Grade 1 wherever possible.

How To

So, we Edited en-gb1-g1.utb, then re-started NVDA to load the new table.  Note that editing on Windows 8 involved copying the file elsewhere, editing and copying back.  A word of warning - make sure that your text editor (I used wordpad) does not change the filename to en-gb1-g1.utb.txt, because that file will never be loaded!

If you want to check that you've edited the file correctly, and not introduced any errors, you can check it using the liblouis tools (the underlying braille translation uses this library).  The program you want is called: lou_checktable.exe.

By default, the file we used  includes a few others, but we have managed to get by without using them - it also means that there is only one file to back-up! One of the files included contains a whole bunch of "display" commands, which do not seem to have any effect on the output, so the file can be dropped.

The File Contents

For numbers, we want to use dot-8, rather than the number character prefix, so the first part of the configuration file contains the braille dots for the numbers:
# Numbers
digit 0 2458
digit 1 18
digit 8 1258
digit 9 248
Next are the standard letters A-Z.  I've included the upper and lower case, using dot-7 to indicate upper case:
# Standard Letters
uplow Aa 17,1
uplow Bb 127,12
uplow Yy 134567,13456
uplow Zz 13567,1356
Now, the extras that we need - the braille display is used for both English and French, but of course, the English braille does not support French accents, so we need to add a few extra entries in.

All characters are referred to with their unicode number, often written in the form u+0000, but in the configuration file, written in the form \x0000.  Search the web for unicode characters to find the codes, but here is a start.

Some of the accents (e.g. a with tilde) do not exist in French, so you will see that these map to a standard 'a'.  The lines could actually been removed from the file, but have been left in in case you have a different language you are trying to support ...
# Accents
uplow \x00C0\x00E0 123567,12356    # a with grave
uplow \x00C1\x00E1 17,1            # a with acute
uplow \x00C2\x00E2 167,16          # a with circumflex
uplow \x00C3\x00E3 17,1            # a with tilde
uplow \x00C4\x00E4 3457,345        # a with dieresis
uplow \x00C5\x00E5 17,1            # a with ring above
uplow \x00C6\x00E6 3457,345        # letter ae
uplow \x00C7\x00E7 123467,12346    # c with cedilla
uplow \x00C8\x00E8 23467,2346      # e with grave
uplow \x00C9\x00E9 1234567,123456  # e with acute
uplow \x00CA\x00EA 1267,126        # e with circumflex
uplow \x00CB\x00EB 12467,1246      # e with dieresis
uplow \x00CC\x00EC 347,34          # i with grave above
uplow \x00CD\x00ED 247,24          # i with acute above
uplow \x00CE\x00EE 1467,146        # i with circumflex
uplow \x00CF\x00EF 124567,12456    # i with dieresis
uplow \x00D0\x00F0 157,15          # letter eth
uplow \x00D1\x00F1 13457,1345      # n with tilde
uplow \x00D2\x00F2 3467,346        # o with grave above
uplow \x00D3\x00F3 1357,135        # o with acute above
uplow \x00D4\x00F4 14567,1456      # o with circumflex
uplow \x00D5\x00F5 1357,135        # o with tilde
uplow \x00D6\x00F6 2467,246        # o with dieresis
uplow \x0152\x0153 2467,246        # letter oe
uplow \x00F9\x00D9 234567,23456    # u with grave
uplow \x00FB\x00DB 1567,156        # u wih circumflex
uplow \x00FC\x00DC 12567,1256      # u with dieresis
The last section in the file is the punctuation - all of this, I cut and paste from the original en-gb-g1.utb file, but it needs a good bit of tidying up.

# Punctuation

space \t 0 tab
space \x000A 0
space \x000D 0
space \s 0 blank
punctuation ! 2346
punctuation " 5
sign # 3456
sign $ 1246
sign % 146
sign & 12346
punctuation ' 3
punctuation ( 12356
punctuation ) 23456
sign * 16
math + 346
punctuation , 6
punctuation - 36
punctuation . 46
math / 34
punctuation : 156
punctuation ; 56
math < 126
math = 123456
math > 345
punctuation ? 1456
sign @ 2346
punctuation [ 2467
sign \\ 12567
punctuation ] 124567
sign ^ 457
sign _ 456
sign ` 4
punctuation { 246
sign | 1256
punctuation } 12456
math ~ 45
space \X00A0 0
sign \x00A2 4-14           # 162 ¢ cents sign
sign \x00A3 4-123          # 163 £ pounds sign
sign \x00A5 4-13456        # 165 ¥ yen sign
\x00A7 4-234-3        # 167 § section sign  
sign \x00A9 2356-6-14-2356 # 169 © copyright sign
punctuation \x00Ad 36      # 173 soft hyphen
sign \x00B0 356            # 176 ° degrees sign
sign \x00B5 46-134         # 181 ยต micro sign
sign \x00B6 4-1234-345     # 182 ¶ pilcrow sign
math \x00D7 56-236         # 215 × multiplication sign
math \x00F7 56-256         # 247 ÷ division sign
punctuation \x2010 36      # 8208  hyphen
punctuation \x2013 6-36    # 8211  en dash
punctuation    \x2018 3    # 8216  smart single left quotation mark
punctuation    \x2019 3    # 8217    smart single right quotation mark
punctuation    \x201C 236  # 8220    smart opening double quote
punctuation    \x201D 356  # 8221    smart closing double quote
punctuation    \x201E 236  # 8222    smart double low quotation mark
punctuation    \x201F 356  # 8223    smart double high reverse quotation mark
punctuation \x2026 3-3-3   # 8230 smart ellipsis
sign \x20AC 4-15           # 8364 Euro sign

Friday, 23 May 2014

Sony Bluetooth Speaker SRS-BTM8 With Ubuntu Studio

Just bought a sony bluetooth speaker, and thought I'd share the hoops I had to jump through to get it going.

In short, I've managed to set it up with Ubuntu, such that if I turn on the speaker and press the play button, the currently playing sound is automatically transferred to the speaker, and when I turn the speaker off, the sound is transferred back to the PC sound card.

The only thing left to sort out is to get the play/pause to actually pause/play if you press it a second time - to-date, all the button does is enables and starts the connection.

1. Install the bluetooth adaptor

2. Ensure bluetooth and the bluetooth/pulse-audio packages are installed
sudo apt-get remove gnome-bluetooth
sudo apt-get install blueman pulseaudio-module-bluetooth
 3a. Edit the audio.conf configuration files in /etc/bluetooth


The Disable=Headset, and MaxConnected=0 prevent the speaker from connecting as a headset.

3b. Edit daemon.conf in /etc/pulse

Ensure the following lines are commented out
; default-samplechannels=2
; default-channel-map = front ...
And the following lines are uncommented
load-default-script-file = yes
default-script-file = /etc/pulse/
3c. Edit in /etc/pulse

Ensure the following four lines are uncommented:
set-default-sink output
set-default-source input
3d. Edit in /etc/pulse

Add the following two lines at the top of the file: 
load-module module-bluetooth-discover
load-module module-switch-on-connect
4. Change the permissions of pactl

The pulse-audio module-bluetooth-discover should be loaded on start-up, but to enable command-line control of the sound system, the control program should be accessible by members of the 'audio' group - this step is not strictly necessary.
sudo chgrp audio /usr/bin/pactl
sudo chmod g+s /usr/bin/pactl
5. Turn on, and browse / find the bluetooth speaker using the bluetooth icon on the taskbar
  • Hold the pairing button on the speaker until it beeps, then select "Setup New Device" from the bluetooth icon on the taskbar.
  • When prompted for the passkey, enter "0000", then a short press on the speaker pairing button to do the other end.
  • Select the Audio Sink / A2DP service, not the Input/Headset one. 
6. Authorise the speaker

Go into the Settings / Bluetooth Manager, and mark the speaker as trusted

7. Set the Default (non-bluetooth output device)

Right click on the speaker (Volume Control) in the taskbar, and select  Configuration, and disable any profile you don't want to use (in my case, disabling HDMI)

8. Check it all works

Reboot the machine, and login.  The software should automatically load and configure, that's it, all you need to do is turn on the bluetooth speaker, and press the play button to connect.

9. Other Useful Bits

pactl list short

This should show module-bluetooth-discover, amongst other things

Settings / Bluetooth Manager

Here you can manage the bluetooth connections, including disconnecting and forgetting bluetooth devices.


sudo apt-get install bluez-hcidump
hcidump -h

10. Update Required

This blog page needs an update. If the speakers are to be used on a system where JackD is running, furthere modifications are required, because there are some driver / interface name assumptions made with adobe-flash plugins which are not compatible.

Wednesday, 19 February 2014

Installing and Building QT5.2.1 with Visual Studio 2010


Download and install MSVC Studio 2010 (it's free)
Download and install ActivePerl free


Download the qt source code zip file.  The tar.gz file apparently has different line terminations in the files, and may not work.


Unpack in the directory you want the QT installation to end up in - there is no "make install" step.


Everything I read says that you need to run configure.exe, but it has not been built, so needs building.  This is achieved by creating the .gitignore file, and setting the QTSRC environment variable.

Start an MSVC terminal (which ensures the compiler is set up in the path).

set QTSRC=c:\data\qt512
cd c:\data\qt512

echo > .gitignore

configure -static -release -opensource -confirm-license -opengl desktop -make libs -nomake tests -nomake examples -no-compile-examples -accessibility

Warning: Using static linking will disable the use of plugins.  Make sure you compile ALL needed modules into the library.

Gotchas / Errors

cannot build  / configure.exe does not exist

If you see an error saying that configure.exe does not exist (note the double slashes), make sure you've installed ActivePerl - the configure program is configured to check for visual studio files, but not for perl!  Also, make sure that the QTSRC environment variable has been set, and the .gitignore file has been created.

Generating Makefiles ... Cannot read : Access is denied

Generating Makefiles...
Cannot read <X:/qt/dir>: Access is denied.
Error processing project file <X:\qt\dir>
Qmake failed, return code 3

This looks to be caused by incorrect directory separators .... investigating ....

Sunday, 26 January 2014

Asus X200CA Touchpad Configuration on Ubuntu 13.10


Just installed Ubuntu Studio 13.10 on the Asus X200CA, and found the touchpad to be quite frustrating, as the buttons are part of the sensitive touchpad area, and when you try to click, you end up moving the cursor.

The Fix

Not to worry, however, as the touchpad is fully configurable with the synclient command.

The touch pad appears to be 3130 wide, and 1697 tall.
By default, the buttons are at the bottom, between 1470 and 1697.

Because the touchpad and buttons overlap, sliding your finger when pressing the button, moves the mouse pointer.

You can re-define the bottom edge for the movement area to 1469 (just above the mouse button area) as follows:

$ synclient AreaBottomEdge=1469
As soon as this command is entered, the mouse becomes useable!!

Making the Fix Permanent

By default, the the configuration allocates the touchpad in % rather than co-ordinates, so edit the file /usr/share/X11/xorg.conf.d/50-synaptics.conf as root:

$ sudo vi /usr/share/X11/xorg.conf.d/50-synaptics.conf

Section "InputClass"
        Identifier "Default clickpad buttons"
        MatchDriver "synaptics"
        Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0"

        Option "AreaBottomEdge" "82%"

For Reference

$ synclient -l

Parameter settings:
    LeftEdge                = 130
    RightEdge               = 3130
    TopEdge                 = 96
    BottomEdge              = 1697
    FingerLow               = 1
    FingerHigh              = 1
    MaxTapTime              = 180
    MaxTapMove              = 163
    MaxDoubleTapTime        = 180
    SingleTapTimeout        = 180
    ClickTime               = 100
    EmulateMidButtonTime    = 0
    EmulateTwoFingerMinZ    = 282
    EmulateTwoFingerMinW    = 7
    VertScrollDelta         = 74
    HorizScrollDelta        = 74
    VertEdgeScroll          = 0
    HorizEdgeScroll         = 0
    CornerCoasting          = 0
    VertTwoFingerScroll     = 0
    HorizTwoFingerScroll    = 0
    MinSpeed                = 1
    MaxSpeed                = 1.75
    AccelFactor             = 0.0537634
    TouchpadOff             = 1
    LockedDrags             = 0
    LockedDragTimeout       = 5000
    RTCornerButton          = 2
    RBCornerButton          = 3
    LTCornerButton          = 0
    LBCornerButton          = 0
    TapButton1              = 1
    TapButton2              = 3
    TapButton3              = 2
    ClickFinger1            = 1
    ClickFinger2            = 3
    ClickFinger3            = 0
    CircularScrolling       = 1
    CircScrollDelta         = 0.1
    CircScrollTrigger       = 0
    PalmDetect              = 0
    PalmMinWidth            = 10
    PalmMinZ                = 200
    CoastingSpeed           = 20
    CoastingFriction        = 50
    PressureMotionMinZ      = 30
    PressureMotionMaxZ      = 160
    PressureMotionMinFactor = 1
    PressureMotionMaxFactor = 1
    ResolutionDetect        = 1
    GrabEventDevice         = 1
    TapAndDragGesture       = 1
    AreaLeftEdge            = 0
    AreaRightEdge           = 0
    AreaTopEdge             = 0
    AreaBottomEdge          = 1469
    HorizHysteresis         = 18
    VertHysteresis          = 18
    ClickPad                = 1
    RightButtonAreaLeft     = 1630
    RightButtonAreaRight    = 0
    RightButtonAreaTop      = 1470
    RightButtonAreaBottom   = 0
    MiddleButtonAreaLeft    = 0
    MiddleButtonAreaRight   = 0
    MiddleButtonAreaTop     = 0
    MiddleButtonAreaBottom  = 0

$ synclient AreaBottomEdge 1469

Installing Ubuntu Studio 13.10 on An Asus X200CA

Bought an X200CA from Tesco - this came complete with Windows 8 installed.

Downloaded Ubuntu Studio 13.10:
  • Installed onto a USB Fob
  • Inserted Fob into PC.

Reconfigured the PC to enable booting from the fob:
  • Booted the PC, and Held F2
  • Security | Secure Boot Control = Disable
  • Boot | Fast Boot = Disable
  • F10, Save and Reboot, Held F2
  • Boot | Launch CSM = Enable
  • Launch PXE OpROM = Enable
  • F10, Save and Reboot, Held Escape

Selected USB Fob from boot menu (The USB fob, not the UEFI: USB Fob)

Followed the Ubuntu Install.
  • Selected Replace Windows 8 with Ubuntu Studio when asked
  • Selected English (UK) and English (UK, extended WinKeys) when asked
  • Reboot, Held Escape
  • Selected the hard disk (P0) from the boot menu
Total time for install: 20 minutes