About Me

Michael Zucchi

 B.E. (Comp. Sys. Eng.)

  also known as Zed
  to his mates & enemies!

notzed at gmail >
fosstodon.org/@notzed >

Tags

android (44)
beagle (63)
biographical (104)
blogz (9)
business (1)
code (77)
compilerz (1)
cooking (31)
dez (7)
dusk (31)
esp32 (4)
extensionz (1)
ffts (3)
forth (3)
free software (4)
games (32)
gloat (2)
globalisation (1)
gnu (4)
graphics (16)
gsoc (4)
hacking (459)
haiku (2)
horticulture (10)
house (23)
hsa (6)
humour (7)
imagez (28)
java (231)
java ee (3)
javafx (49)
jjmpeg (81)
junk (3)
kobo (15)
libeze (7)
linux (5)
mediaz (27)
ml (15)
nativez (10)
opencl (120)
os (17)
panamaz (5)
parallella (97)
pdfz (8)
philosophy (26)
picfx (2)
players (1)
playerz (2)
politics (7)
ps3 (12)
puppybits (17)
rants (137)
readerz (8)
rez (1)
socles (36)
termz (3)
videoz (6)
vulkan (3)
wanki (3)
workshop (3)
zcl (4)
zedzone (26)
Tuesday, 01 September 2009, 02:58

Spring

First day of calendar spring. Not very sprung but I suppose there's a bit of sun out there.

Well as seems to be the case lately it's been another long lull between posts. I've been busy just 'bumming around the house' for the most part, although I've also got into a habit of spending money. Ordered a high-spec Kenwood Chef on the internet - I have a cheap food processor but it doesn't really mix properly and wont knead dough. But unfortunately it's still in the queue after a couple of weeks (from supplier). I tried buying locally but nobody sold the model I was after around here, plenty of places sell the Kitchen-Aid stuff but if i'm going to spend that much money I may as well go the whole hog. I go through spurts of cooking so it will be nice to have some decent gear.

Also just ordered a couple beagle boards. With Sony dropping the Other OS support in the new PS3's, I think that journey may as well come to a conclusion, at least for the time being. Not that I've been inspired to do any programming whatsoever, and they may just collect dust, but I'm hoping I can come up with something to put on them. I wonder which order will arrive first.

Last week I got my hands dirty converting a large coffee table with small drawers into a large coffee table/trunk. What was surprising is the whole thing is put together with only nails! Not even glue! Well it made it easy to disassemble the bits I needed to. I didn't need any extra timber as I re-used bits from inside it, although it could probably use a ply floor for strength and aesthetic appeal.

I took the top off, which already had a splitting join in it about half way across, used the drawer rails to make a spline across the middle and attached large triangle gate hinges to the that and the tops.

Added in some battens and bobs you're uncle. Actually it was a surprising amount of work, considering I haven't done any woodwork for ages and chiseled out the hinge rebates by hand. It's a bit rough -- the chisel wasn't too sharp and slipped some -- and unfinished, but I think I did an ok enough job with some of it. I'm sure glad I have a drill I can use to put screws in - there's over 70 in it now.

Considering the table is always covered in junk it may not be the wisest conversion ever, but it sure has a hell of a lot more room for storing crap now. So now i've been thinking about other woodworking stuff to do and other tools to buy - like a router which would've made the rebates a cinch - unfortunately I have no workshop, garage or even a gated car-port so I might have to hold back on that. If I ever get my retaining wall and paving done I'll have a deck to do at least.

I also found some interesting looking indoor plants and got some nice large pots for them - I have some other indoor plants but they're piddly little things or look like rubbish. I have some seedlings going early too - normally I'm months late with those. Trying to add some life to my herb pots too, and a little more work on the very slow process of creating a thyme lawn in the front of the house. And I think I finally got the ants nest out of the potted lemon tree. I have so much 'real' work to do out the back of my house it isn't funny but the weather and my apathy is holding me back on getting into it so i just keep poking around at the edges.

Tagged biographical.
Friday, 31 July 2009, 16:04

And so it goes ...

... and so on it goes ...

3 weeks of idleness. Actually I've been busier than I have been for a while. All sorts of stuff. Pruning trees, spraying weeds, new computer, installing various operating systems, cleaning, cooking, eating. Getting fat(ter).

Well. I made some pasta by hand, and liked it so much I bought a machine to help. Not that it really makes it any easier to make, it does however make the product a bit more consistent.

I found a shop that sells my new-favourite super-hot-sauce.

I recovered my rear speaker drivers from being repaired, and wired them up. They'd been in the shop for nearly 6 months(!).

I installed a couple of desks I acquired from work, from my very generous boss. And the bar fridge.

Bought the previously mentioned 'new computer'.

Tried lots of operating systems. Solaris (hence to be known as 'f*n slowaris', Arch-linux 'it's just too much effort, and i couldn't get X to work', gentoo 'it's just too much work/waiting around', and finally settled on GnewSense - it's an awful lot prettier than ubuntu, and it comes with Emacs AND a f*n compiler. I also had a good look at haiku ... hmm, interesting. It inspired me to revisit my own 'os', although all I managed was to recompile it on the new machine.

Also looked at mythtv. I have an old PCI card that does analogue TV capture I thought i'd use as a test. mythtv is a weird application. Anyway, managed to get it build from source - although for some reason, initially it would only run remotely* (* for some reason, now it also runs locally and no longer aborts with an X error). I also tried getting some other capture programme but unfortunately only mythtv managed to keep audio/video sync. Also unfortunately - recording and viewing seems to crash my box hard once in a while (the dreaded blinky keyboard L.E.D.'s.) - so I caved in an ordered a USB digital tuner unit.

Hmm, what else. Baked an apple cake. First recipe I found on the internet. Apart from the cooking time, which was wildly underestimated, it produced a rather decent result.

Oh, and pruned a tree out the back. Made a big mess of it but I think that was what was needed for it. It'll grow back. If the weather keeps improving like it had been for the last few days I might even manage to get back out there and clean it up ... and then prune the mandarin tree as well.

Thursday, 09 July 2009, 01:31

Winding up

Well I've been busy winding up the project I've been working on so haven't had much time to work on much else. And we've had a cold spell which has slowed down the enthusiasm to jump out of bed and start coding too ...

Hmm, so Google has finally announced it's `own' OS. Well, it isn't really, it's more like it's own `desktop environment', since they're just going to use a linux kernel, and presumably some sort of GNU or similar user-land, although much of it wouldn't be necessary if you're only running one application. Seems to be a bit of an overbloan buzz in the press - it isn't like they're the first to come up with their own linux-based distro.

Still, I do see some potential positives to come out of it for the free software world. For one, it will be interesting to see the notion of a 'desktop environment' completely re-done in a few months - rather than the years it's taken GNOME and KDE to get to their current state (to give them credit they did start with nothing). And it'll give the UI zealots another interface to clone; and perhaps it'll be better than the shit they've been cloning for the last 10 years.

Then again, even with a fast javascript compiler and HTML5, browser applications are still pretty much going to `suck'. Relying on faster computers to hide the problem is terribly inefficient. And in-fact working toward that whole network-based remote-terminal interface will look dated when the machine in your hand will fast enough and have enough memory to run real software whilst keeping your data local and private.

Tagged biographical, rants.
Monday, 22 June 2009, 14:41

Another cell tutorial

Just uploaded another Cell tutorial ... they've just about come to an end, and although there's probably things I could write about, the urge to do it only comes in spurts. I just introduce an absolutely bare minimum library for accessing the ps3 frame-buffer.

And otherwise ... I had some strange thought at the pub one night that I should 'write a game', and unfortunately sobering up didn't dispel such a silly idea (it's not like I don't already have plenty of other ideas floating around to keep me busy). A mate of mine has wanted to write one from before I met him (damn, was it already 15 years ago), so I asked him to join me, and maybe we'll get somewhere this time. Perhaps - he's a bit of a rabid Ninty fan (which I am not) so it may not end up something I'd play; but i'm not particularly worried about what comes out. I've never written one either, so it's the journey and not the outcome that counts. It's a whole new set of basically unfamiliar problems so it's pretty much starting from scratch.

Tagged hacking, ps3.
Thursday, 18 June 2009, 06:54

Yawn.

Too damn tired, all the late nights have caught up with me. I don't think the uncounted beers at the pub last night helped either.

After the last post I mucked about with a couple of implementations of 'job queues' on the Cell. I wrote the whole lot up before testing on real hardware - and thought i'd really messed one up. But it turns out it was salvageable and i'd only made a small mistake. For the simple 1-PPU-writer-only-SPU-reader queue I can send about 1.3m 'jobs' to an SPU per second (the 128 byte `jobs' are sent one way and once received, simply marked as 'done') for a single SPU and about 1m jobs/sec when all 6 are used. Which seems reasonable scalability; the contention isn't getting in the way too much. For the more complex any-writer-any-reader queue (only being used with the same ppu-writer-n-spu-reader test driver), it drops down to about 1m/s for 1 SPU and 750K/s for all 6. Which could probably be improved - but the jobs aren't actually doing anything so creating artificially high contention anyway.

They seem to be stable and reliable, no races or deadlocks.

I'll keep poking to see if I can improve them.

Monday, 15 June 2009, 09:13

On stuff, and other stuff.

Well I've updated the cell tutorial with another entry. This rounds out the optimisations for the Mandelbrot Set generator, with I think some impressive results.

I spent most of the weekend (another nasty cold and wet one) plugging away at my renderer and reading up on bits and pieces. As I suspected `it was harder than that'. Oh well. Losing interest on that track, so I think I will play with some Cell code for a while - I started work on completing the IPC chapter again which I'd abandoned a couple of months ago. Then I might go back to the freetype renderer or maybe agg (the freetype renderer I was looking at turned out to be based on that).

It's amazing how much ones productivity changes from day to day. When things are kicking along you can write several thousands of lines of code in a week, and a lot of it can be good code. When you hit a wall everything seems to grind to a halt. I spent all weekend writing 50 lines of ... total worthless crap.

Oh well, another week gets under-way.

Tagged graphics, hacking, ps3.
Thursday, 11 June 2009, 05:01

A pixel as a unit square

So while I think about whether I stick to freetype or try something else, I've started playing with ideas for my own renderer. I actually have a screen-shot capable output, but I don't have it handy right now. Maybe next time.

After a few silly mistakes with list pointers, I've been surprised at just how simple it is to get something up that looks quite reasonable. I am most certainly missing something, because it can't be this easy; the few 'i'm not sure' edge cases are probably where the problems come in that'll keep me from ever finishing it. I've basically done a simple 'classic' scan-line renderer which keeps track of the X coords as it steps down the Y coords, then scans from one side to the other keeping track of edge crossings and using that to work out when to fill or not. The only interesting thing is that I compute exact pixel coverage as I go so I can produce quite nicely anti-aliased lines with very little extra work. There are some artefacts with intersecting lines, and non-zero fill rule has some big issues, but I'm not particularly worried about them right now. I wouldn't have a clue if it is all that fast though, quite probably it isn't. The coverage calculation is particularly simple - since I treat each pixel as a unit square, much of the time the multiplications are just by a factor of 1, so the coverage is just a simple sum and a divide by 2.

I guess the more complicated part of the equation is the line stroker. The basic idea is simple enough, but there a lot of nasty cases to handle if you have unusually fat lines, and what to do about intersecting lines. Dashed lines seem like a hassle too.

Well, at least with my own implementation it might make it easier to look at making it work on a Cell B.E., which should all keep me busy for the foreseeable future should I decide to investigate that. So the OS idea is on hold for now.

Tagged graphics, hacking.
Tuesday, 09 June 2009, 03:22

Butt stroking and other stuff

Well that was a long wet dreary weekend. I managed to avoid leaving the house (getting through some old stuff in the cupboard and freezer at last) ... and of course spent an inordinate amount of time hacking away.

OpenVG needs a lot of scaffolding to get started - so I spent a lot of time doing that. Lots of code for getting and setting attributes and whatnot. And the path type. So I had to brush up on splines and geometric algorithms again, and I was back in the land of vectors and splines and whatnot - again. I wrote a nice little non-recursive adaptive spline tessellator I could use for implementing some of the features required like path length.

I originally wrote a vgpath that worked the same way as the reference implementation ... but just about the time I got most of it finished I got sick of writing yet-another-loop that parsed the data in slightly different ways, so I decided to change it around a bit, focussing on simplifying the code. So basically now I only have to canonicalise the data once, and the other functions can work on a simplified data stream, and not have to calculate relative or partial coordinates or smooth control points or arcs (although I haven't done them yet) or even data conversion every time they run. e.g. VLINE/HLINE are converted to LINE, all _RELs are converted to _ABSs, SCUBIC/SQUAD converted to QUAD, ARC's into QUAD's. I think doing that will still honour the API and it simplifies other bits of code. But since this is only the 2nd attempt I've probably got this wrong too - always seems to take 3 goes to get something right (as I write this I'm already thinking of some things I did wrong).

A few short lines of code later and I had it hooked up to the FreeType renderer and discovered the headline bug above. Butt line endings wasn't implemented, although it took a while to discover that since I just assumed it must be my code since the enumeration existed. I've submitted a patch which has already been applied (I must've been a bit tired as it took me a while to realise why 'butt stroking bug freetype' didn't find anything relevant, but seemed to probe the darker regions of the internets instead). I played around with the stroker a bit more and found other issues, and ended up delving into the source code more deeply - now I'm not sure I will use the FreeType stroker and renderer as I'd hoped to. To start with, a couple of features are missing or different. And it is, as they say on the box 'optimised for small sizes'. The algorithm is quite interesting though - basically it renders a band (ideally the whole image) into a 'sparse' bitmap, and then just steps through that to produce runs of filled pixels by keep track of edge crossings. So unlike a normal scan-line renderer it doesn't need to keep track of active lists and so forth, or update the lines piecemeal. Unfortunately I don't have a real handle on how scalable the algorithm is to screen-size resolutions. I may have to 'suck it and see', otherwise I'll get no where ...

... Since, to cut a long story short I've started delving into the mysterious and dark corridors of writing my own AA renderer. I orignally looked at FreeType because 1. I intend to use it anyway for font glyphs, and 2. It has few dependencies, and 3. It's easy to use. I'd also considered libart, but I thought was more closely tied to glib than it is, but it also no longer seems to be maintained, and apart from that it looks a bit over-engineered for my taste. And well, writing my own could be interesting - until you hit all the weird edge cases and numerical stability issues that throw it under a bridge. I still have at the back of my mind the idea of making this run well on a Cell BE too, so that's another reason to investigate since I need to know how it works, even if I just adapt another bit of code.

Tagged graphics, hacking.
Newer Posts | Older Posts
Copyright (C) 2019 Michael Zucchi, All Rights Reserved. Powered by gcc & me!