Blog
Core Text LOL
3/2/2016


Sometimes you just have to laugh.

I let XCode 7 install. And now I get the choice of the 10.11 SDK or the 10.11 SDK. Apple have finally removed the ATSUI API I was using to draw text in my Mac ports, causing compilation errors. So time to pull out the partially complete CoreText implementation and get that working.

Not quite there yet ;)

Tags: scribe mac | (1) Comment | Add Comment

Merry Christmas
24/12/2015
I think for the first time ever? There is a simultaneous release of Scribe on 3 different platforms: Windows, Mac AND Linux. The new v2.1.3 build is tri-platform. The Linux (x64) build is a GTK2 app and runs ok on Ubuntu and Arch. Well that's all I've tested at this point.

It also runs on a Raspberry Pi 2 although it's a little slow. I know because I got bored and tried building it while working on some MC2 stuff.

Links to the i.Scribe builds:

Tags: scribe linux | (0) Comments | Add Comment

Portable OpenSSL for Linux
21/12/2015
A year ago I worked out how to make a portable build of OpenSSL for Mac. And now with the imminent release of the Linux build of Scribe I need to do the same with the Linux build of OpenSSL.

After downloading and unpacking OpenSSL I configured it with:
./config shared -DPURIFY
The reason for adding the -DPURIFY #define is to suppress valgrind errors related to uninitialized memory usage.

Once that is built I had a look at the shared object paths with ldd:
matthew@ubuntu:~/Downloads/openssl$ ldd ./libssl.so.1.0.0 
	linux-vdso.so.1 =>  (0x00007ffc0e197000)
	libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007f5c5ab6c000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5c5a7a7000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f5c5a5a3000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f5c5b1c1000)
So it's not portable yet. I initially tried using the chrpath command but it can only modify existing RPATH records. My binary doesn't have any RPATH yet. So that didn't work. The next thing I tried was the patchelf command from here:
http://nixos.org/releases/patchelf/patchelf-0.8/
After building and installing I issued this command in the OpenSSL folder:
patchelf --set-rpath '$ORIGIN' ./libssl.so.1.0.0
Now to check if libssl pulls in the local libcrypto:
matthew@ubuntu:~/Downloads/openssl$ ldd ./libssl.so.1.0.0 
	linux-vdso.so.1 =>  (0x00007ffcdce86000)
	libcrypto.so.1.0.0 => /home/matthew/Code/Scribe/trunk/./libcrypto.so.1.0.0 (0x00007f39b99d8000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f39b9613000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f39b940f000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f39ba0a5000)
Yes! Now this build can be installed in the same folder as the Scribe binary and Scribe will use it without interfering with the system OpenSSL which is often out of date, or not built with -DPURIFY or missing.

Tags: shared-object linux openssl scribe | (0) Comments | Add Comment

Scribe 2.1
27/10/2015
Well it's been most of a year since I said anything about Scribe v2.1, and the list of changes hasn't moved forward much in that time. There are a few reasons for the slow progress, but it mostly boils down to:
Anyway there is some good news. The integration of Aspell is complete. Scribe v2.1 will come pre-loaded with a spell check and it will download and install dictionaries on the fly with no user intervention. Well you'll need an internet connection for that part, but once installed it'll work offline.

Secondly I'm in the middle of doing a fairly thorough rewrite of the Help files. Which includes fixing some things in the HTML rendering. Reviewing all the parts of the application that have "Help" buttons (or should have "Help" buttons) and making sure they work correctly. Updating all the pages with current information. It's actually a big slab of work. Lots of cross referencing things and checking the UI and source code so I accurately describe the functionality. I'm not much of a tech writer so it's tedious for me.

Anyway there is now a beta release online for v2.1. I look forward to getting feedback on what works and what doesn't.

Tags: scribe | (9) Comments | Add Comment

MC1 flash procedure update
19/10/2015
The original MC1 flash procedure involved having to use an actual parallel port. For this reason I have kept an old PC running XP around. Just to flash the firmware from time to time. As it didn't work so good on Windows 7 or pretty much any Mac. Then a few months ago someone was asking about the possibility of using a USB in circuit programmer like this. So seeing as they are dirt cheap on ebay, I bought one to try out.

Compiling the code into AVR instructions is accomplished with the WinAVR tool chain. I'm using the latest release. However there is one gotcha when installing. Do NOT install it into a folder with brackets in the name, like say:
C:\Program Files (x86)\WinAVR
This causes make.exe to crash. No I'm not kidding.

The next issue is the Avrdude binary that comes with the WinAVR compile is just a little too old to know about the usbasp programmer. So that needs to be updated to something recent. Just unpack that file into the bin folder of the WinAVR install, overwriting the existing avrdude files. Check that the version available on the command line is correct by running it without any arguments.

Next the usbasp needs a driver to work in Windows (7 in my case). You can get that here. I didn't have much luck with the installer, but if you go into the Device Manager, right click on the usbasp device and install drivers from that menu. Then select the folder where you unpacked the drivers. On my machine the device driver takes 10 seconds to connect so give it time before trying to flash the firmware.

Finally the actual command you use to flash the firmware is:
avrdude -c usbasp -p m128 -U flash:w:main.hex
Where 'main.hex' is the compiled binary. It's faster and easier than the old PonyProg2000 method, and scriptable. Just put it in the makefile. Less mucking around.

Now I'll have to find another excuse to have an old PC lying around. Maybe LAN games with the lad? :D

Tags: mc1 | (0) Comments | Add Comment

Mc2 Progress #4
12/10/2015
The time comes to stop mucking around with software and start building the hardware. I'm no where near as good with the hardware things. Software is easy and fine... so how much did I break it? Turns out a fair bit. Lets take a look.

First I started with an Inkscape file that described all the positions of the components and specifically the places where I have to drill or cut. I printed it out in A3 and glued it down to the top surface of the chassis.



I started drilling out the holes and all the switch / neopixel holes went fine. Then came the LED rings and the paper started tearing everywhere.



So I left the LED ring holes for a while and worked on the screen rectangle. I bought this tool called a "nibbler" to cut the hole. You drill a hole in the area to be removed, and insert the nibbler into the hole and start cutting. It can cut in a curve so I used that to align to the border.



Then I came back and finished all the LED ring holes. However my accuracy was terrible and I don't feel all those holes are good enough.



I've decided that this chassis is a bit of a write off. I have since gone and bought a new chassis (they are about $60 AUD inc shipping so not too bad). And now I'm looking for someone that can do CNC drilling.

Moving on I tried test mounting some of the components, starting with the screen and Pi.



Seems to fit quite nicely. So I tried to bend the holes in to accommodate the countersunk machine screws that I had bought. That bent the metal around the hole too much and deformed the chassis around the screen area. In hind sight I should've used a large drill bit instead of mechanical force. So because of the deformations in the metal when I tightened up the screws around the screen I heard a faint cracking sound. Yup I broke the screen just a little.



That's just fantastic! :( Another thing I have to re-order. Similar price too... bah. There is some good news thought... the screen still works:



Although I haven't had a chance to test the touch screen part.

The PCBs and Neopixels need to be mounted behind the front of the chassis, so I went and bought some rectangles of 3mm perspex:



The switches go through the perspex and keep it in place. I've started soldering some 3 wire ribbon cable between the Neopixels, not shown in this photo. It's slow and tedious work :( And the various glue electronics to interface the Pi with the buttons, encoders, expression pedal ports and neopixels is all mounted to that as well.



Tags: mc2 | (0) Comments | Add Comment

Why are my videos encoding at a snails pace?
8/10/2015
I'm currently rendering out composites for a music video and it's crawling along. Vegas is taking 40+ minutes for a 8 minute 1080p video? That doesn't sound right. My CPU is a i5-3570K and the machine has 16GiB of RAM (5 in use right now). So I started looking at the CPU to see if it's running OK. First stop CPU-Z:



2ghz? What? Where is my 3.8ghz the CPU is capable of? Hmpf. Well better check the temps then.



Oh... oh dear. Well... I er... guess I need to replace that stock cooler then huh. Off the shops, will update with results.

Edit: So I cleaned out the fan, it was clogged with dust. Reapplied thermal grease and reinstalled the heatsink/fan. I think it might've come loose and not have been making proper contact with the CPU?

In any case:



At least now I'm getting decent speed. The render time is down to 21 minutes or so. I wonder if I can overclock with a decent cooler?

Tags: hardware | (0) Comments | Add Comment

MC2 Progress #3
23/9/2015
The last week or so has been spent a twisty maze of fonts, colour spaces, CPU endianess and cross platform C++. Anyway I won't regail you with all the fun I've had but I will show you some screenshots.

Firstly because I have RGB LEDs for each Instant Access switch, I need a way for the user to select a colour:



It remains to be seen how easy it is to use on the real hardware. But colour selection works either by hitting one of the palette entries or pushing the Red, Green and Blue sliders around.

Also for entering details like the CC number and other textual information I probably need a touch screen keyboard:



This is roughly copied off my Android phone's touch keyboard. Without Swype unfortunately ;)

The screen to select a scene change for an IA button:



And the page where the user picks an Axefx block:



Tags: mc2 | (0) Comments | Add Comment

MC2 Progress #2
14/9/2015
This week I've been working on the screen layouts. A fair bit of mucking around with CSS and resource file formats was required to get it all working but here is what it looks like now:


Working from the hand drawn ideas I had last week I'm mocking all the dialogs up in the graphical editor:


Also in the mean time I'm working out if I can hide the boot time of the Raspberry Pi behind a custom splash screen. A static image is easily doable but something with a progress spinner might be a bit tricky.


Tags: mc2 | (0) Comments | Add Comment

Removing Suggested Tiles from Firefox New Tab Page
10/9/2015
So in recent builds of Firefox new tabs have collected "suggested" site tiles. Now being marketed to and having my meta-data sold to the highest bidder is why I moved back to Firefox from Chrome about a year ago, so the appearance of "marketing" in Firefox's UI is quite concerning.

Of course you probably want to know how to turn those suggested site tiles off right? Well see that little gear icon in the top right hand corner:



Unselect the "Include suggested sites" and you're good.

Tags: firefox | (0) Comments | Add Comment

MC2 Build
28/8/2015
So the other day I was at rehearsal and the MC1 that built started to have some issues with the External control knobs (along the top). They were jumping all over the place and making it annoying to use. I did get around to pulling all the circuitry around those pots off and doing it properly later. But it occurred to me that I'm using gear that I have no backup for. There is no 2nd controller to swap out if this one dies at a gig.
And because I'd rather custom build one out of parts I [mostly] have lying around that means building the MC2.
For starters the MC1 uses a tiny micro-controller with no USB or network or any modern connectivity at all. I have an old XP computer JUST to reflash the damn thing (needs a REAL parallel port). For any new system I wanted an easy way to do software development and ethernet/USB connectivity. And because I had a Raspberry Pi already I settled on that as a platform to run everything. I already had a little touchscreen to go with it and some RGB led rings with encoders that I built for a different project that I never got around to. So with all those parts just lying around I got to making some bits to glue it all together. Here's a family photo:


1) The Raspberry Pi. This is the "old" B rev 2 version... which has the slower processor.
2) The touchscreen. This interfaces with the SDL api using the Linux framebuffer. Touch events show up as mouse clicks. It's all quite straight forward to be honest. The only gotcha is you HAVE to set the video mode back to text if you crash... otherwise you're stuck in video mode without a working console.
3) LED rings + encoders: These I built for someone else but was too slack to finish that project. They basically are an extension of the Mayhew LED ring except that I'm running Red/Green/Blue LEDs instead of just one colour. It also is designed to fit in a 1U rack box, so they are nice and compact. I'll have 3 pairs of these across the top of the box, giving me 6 independent continuous controllers. Just like the old MC1 box, but importantly I'll be able to update their "position" using software when the preset changes.
4) Neopixel chain: Each foot switch on the controller will have an associated LED. I settled on the Neopixels because they wouldn't require a lot of support circuitry and there is now a software library to make them work on the Raspberry Pi. Which I've used successfully on a bread board.
5) MIDI in and out ports. This is a direct implementation of the circuit used in the MC1. All I really have to do is connect it up to the Raspberry Pi's UART pins and then program the right frequency. *fingers crossed*
6) This is a bunch of extra GPIO (general purpose input/output) for connecting the foot switches and encoders up to. It runs on the I2C bus from the Pi so it's easy to chain lots of things and address them in software. (I love software solutions).
7) Some analog inputs for the expression pedals. I'll be able to have up to 4 connected at once.
8) This is the break out board for the expression pedals. It connects to (7) via a 4 wire bus and basically sets up the right voltages for the 3 pins on the socket. It allows me to detect when the pedal is connected and disconnected by limiting the valid ranges of input voltage when the pedal is connected to less than 0-3.3v...
That's an overview of the hardware side. But what about the software? Well I already have a lot of cross platform C++ code that will come in handy. Firstly I have written a library called LGI that allows the same code to run on Windows, Mac and Linux without much changes. So why not extend that to SDL on the Raspberry Pi? So that's what I did this month. Which gives me access to a whole bunch of little controls like, edit boxes, check boxes, labels, buttons, table layout controls, graphical design tools etc. Stuff I've already written.
But I still needed to work out the general look and feel of the user interface. Check it out:


Basically I'm drafting up the flow of buttons and the layout of the controls to get a feel for what I need to write in the software. I have this control that does layout for me, kinda like a HTML table in that it works out the spacing of everything based on the size of the content. And I can style all the controls with CSS which will make for a nice consistent look over the product.
I expect though it'll be some months before I get this all working. Only a few parts of this are tested and none of it has been integrated into a working system. I'll try and post updates when I can.


Tags: mc2 | (1) Comment | Add Comment

It's been a fantastic week at Memecode headquarters...
12/6/2015
I bought a cheap new Win8.1 tablet. Which was amazing for about 24 hours until I decided that I didn't want the 5gb restore partition and tried to remove it and resize the C: to fill the available space. Yeah that didn't go so well and I think I've bricked it.

To add insult to injury my main Windows 7 install on the desktop PC died tonight. It boots to a blank black screen. Safe mode hangs with lots of disk activity. It got stuck on the Paragon HFS+ driver, so I booted into Mac and removed that (copied elsewhere). And I'm trying to fix the disks one at a time with Disk Manager. Currently it's in some sort of infinite loop verifying my Win7 NTFS partition. Sigh.

Seems like all my PCs hate me at the moment.

One thing to be happy about is the fixes to HTML table layout I implemented today. There were some bugs related to table layout for spanned cells that have non-dynamic width specifications that are larger than the available space. And also an off by one error in the block element flow code. Slowly that HTML control is getting quite solid.

Tags: windows | (1) Comment | Add Comment