• My main client went into Administration last week, leaving me with very little work to do until I can find another contract, which is proving a little difficult.

    This has, however, given me the chance to get on with writing Cuemaster. This is a Windows program that Trevor Learoyd recently bought the rights to. After looking over the code I decided it needed a complete rewrite, which I have almost completed.

    Cuemaster is a program for handling playing sound files during theatre performances. The old version displayed 2 decks, each of which had a playlist of sound files, and various controls around them for handling volume, cross fading, auto fading etc. It could also play CDs. It displayed all of the controls in one fixed sized window, and this was the first thing that needed to be changed. Once I looked at the code I identified a number of problems, of which the two most serious were:
    The code for the 2 decks was duplicated, with just the control names changed.
    All the controls were on the main form, including things like labels on the volume controls, which is why it wasn’t resizable.

    I started by splitting everything into separate controls, such as a control for a Deck and another for a Volume control. This obviously meant that I could create any number of decks, not just two. Where to put the volume controls for each deck (and the CD and the Master volumes) was then a bit of a problem, so I decided to split them out into a separate window, which the user could place anywhere convenient on the screen. It then became rather obvious that I should split out other controls that weren’t part of a deck into their own windows, such as the CD Player and cross fader.

    At this point I began to find the way the old version handled playlists rather awkward, so I incorporated everything into a single XML Workspace file and an associated Tracks folder (for storing the sound files). Loading a workspace now sets up the decks and all the other controls as they were when the workspace was last saved, and it can be moved by copying just the workspace file and tracks folder to another machine.

    One facility in the old version was track autofades. Up to two of these could be set up for each track, and fired off manually at any time the track was playing. There was also a button to set off one of these on each deck at the same time. This struck me as a bit specialised, and when I started thinking about a better UI for it I realised that what was really needed was the ability to write scripts.

    So the new version has a complete scripting/automation system written into it. You can create any number of scripts, each of which contains any number of actions, such as cueing up a deck or CD on any track at any point, starting, stopping and pausing decks, firing off a cross fade, restoring the desktop, hiding and showing decks (you probably wouldn’t want more than 2 on display at any time, but might want to switch to a new set of decks/playlists for the next scene), changing volume controls with or without a fade, and many more. Every action can be delayed so that it starts some time after the script starts. Scripts can also have triggers added to them, so that they will run automatically when a particular point is reached on a track playing on a deck. So much of the action management is handled by an abstract base class that I can add new ones really quickly.

    I’ve also added facilities for handling lights over DMX, but I haven’t got the gear to test that, so I don’t know whether it works yet. I also need to know a bit more about how lighting engineers configure their lights so I can make it as easy as possible for them to use.

    I’m very chuffed with the way this program is turning out. I don’t think there’s anything much of the original code left now, and the way everything works internally is completely different. The only problem is that I keep thinking of new features to add to it. I’m thinking about adding a cue sheet to it now, so that the user can create and run scripts based on what’s happening on the stage. I’ll have to stop at some point, I suppose.

    Tags:

  • Windows 27.01.2009 1 Comment

    I’ve finally managed to track down and solve a problem that has been driving me batty for months. My main machine runs Windows XP. I run VMware Workstation on it and use virtual machines for development and testing.

    The problem I have had for about a year now is a tendency for Explorer to hang up for anything from half a minute to a couple of minutes, intermittently. When this happened other apps would generally still operate, as long as they weren’t using Explorer themselves, Alt-Tab would allow shifting between them,  VMs would usually still work, but the Taskbar and all explorer windows would be frozen in the host XP machine. On unfreezing, all the mouseclicks and keystrokes sent to explorer would be actioned, usually causing windows to restore and minimise all over the place.

    It’s been obvious to me for a long time that the problem was associated with VMware, it would only happen while it was running, would be a lot worse if the VM was hammering the machine, and would almost always happen on shutting down a VM or closing VMware itself. I’ve been unable to find anything on the VMware site, or anywhere else, about the problem.

    Yesterday I was running some big database jobbies in a VM and the host machine was unusable most of the time with these freezes, so I decided to track it down once and for all. I’ve always suspected that the problem would be an interaction between an Explorer plug-in of some sort, and VMware. I got a copy of ShellExView, a freeware program from NirSoft that lists all the installed Shell Extensions (aka Explorer plug-ins) and lets you disable them selectively.

    A quick bit of binary chopping narrowed it down to either Tortoise or Carbonite. I’d hate to lose either of these. Tortoise is a wonderful front end to the immensely powerful Subversion source control software (so much easier to use with a GUI), and Carbonite is the off-site backup software I use. Both of these programs hook into Explorer to show the state of files, in Tortoise’s case what has changed since the last update from the repository server, and in Carbonite’s which have and have not yet been backed up.

    I suspect that part of the problem may be these two programs tripping over one another trying to do the same things to Explorer, but it seems odd that it only goes wrong when VMware is running. It’s quite possible that Tortoise isn’t part of the problem at all, as I seem to have been able to cure the problem by disabling the Shell Extension that Carbonite uses to display the icons. Just switching off that display within Carbonite wasn’t enough – the extension itself had to be disabled. Fortunately, I don’t need to use that very often, and it is no big deal to make sure that VMware isn’t running when I do.

    Edit: Next day when I started up the machine again the lockups were back, so it looks like it wasn’t Tortoise or Carbonite after all that. Going through the ShellExView list again I noticed that I had also disabled a shell menu hook, mpvthook.dll, that was installed by the drivers for my Samsung monitor, a 971P. Unusually, it really is worth having drivers installed for this monitor because it has a swivel feature, with which I can physically turn it between landscape and portrait and Windows can recognise this and rotate its display to match.

    For some reason, though, it insists on installing a load of GUIs for this, including a system tray icon and a keyboard hook. These are completely unnecessary, and the latter is particularly irritating, because the easiest way to switch it is to move the monitor, not to instruct the software “by hand”. It also puts in this shell hook, which adds menu items to the desktop right click menu, which completely mess up its display (and add yet another load of unnecessary menu items to rotate the display). The most irritating thing about this is that if I try to disable it, it gets re-enabled whenever I log in, so in the end I just renamed it (after trying a new version and finding no improvement). So, this is today’s fix for the explorer hang ups, and it is working so far even with Tortoise and Carbonite both enabled. The only hangup I’m seeing now is one long one whenever I suspend a VM.

    Fingers crossed it’s now near enough fixed.

    Tags: , , ,

  • Programming 03.11.2008 2 Comments

    I’ve just run into a problem with laying a page containing a textarea.

    I set it up using a Firefox window with a 1024*768 client area on Windows XP, but when I looked at it on Linux (Centos) the rest of the page ran off the bottom, even though everything should have been in the same position. Turns out that the Windows Mozilla is making the box 5 rows deep, as requested, but the Linux version is allocating space for scrollbars that aren’t needed.

    Both are running Firefox 2.0.0.14, so there must be some difference in the underlying rendering libraries.

    Tags: ,

  • Linux 08.09.2008 No Comments

    The other serious problem I had with Hardy Heron was getting Suspend and Resume to work with my newer laptop (a Sony Vaio VGN-CR19VN). It works OK on the old laptop, but the new one didn’t want to know. Whenever I tried it it would just clear the screen, go to text mode, and leave a cursor at the top left.

    Eventually, after a lot of searching on the forums, I found a fix for it. It took a long time to find because it was in the middle of a thread about fixing the problem on an HP laptop. It actually turned out to be remarkably easy to do.

    All I had to do was modify the first entry in /etc/pm/config.d/defaults to read

    SUSPEND_MODULES="uvcvideo"

    and it now suspends and restores correctly. I think it hibernates as well, but I haven’t tested that as thoroughly.

    Tags: , ,

  • Linux 07.09.2008 No Comments

    When Ubuntu 8.04, otherwise known as Hardy Heron, was first released I tried installing it on both my laptops. My older laptop (a Sony Vaio PCG-Z600HEK) had the previous release, Gutsy Gibbon, on it. That had worked with no problems at all, so I wasn’t anticipating any with the new version. Unfortunately, I ran into a couple of  problems that made it pretty much unusable until I was finally able to track down fixes for them.

    The most important problem for me was that I couldn’t get it to work with Windows shares as a client. It could sometimes see they existed, and very occasionally even manage to open a share, but that was all. It would then immediately stop working. It was obvious from the ubuntu forums that a lot of people were having the same problem and that the problem had been reported quite a few times before the release. I was also told that other people had installed 8.04 and were accessing Windows shares with no trouble. Incidentally, I found the problem wasn’t with accessing Windows machines, because I also had trouble accessing my NAS, which is a Linux box that uses Samba to create Windows shares.

    It seems the problem is mainly to do with retrieving the passwords that have been entered for the network resources, and is in one of the gnome components, so people using KDE or who have no security on their network will have no problem.

    It didn’t help that a lot of people on the forums who had it working seemed to misunderstand what the problem was, and kept posting solutions to a different problem – getting ubuntu to see the netbios names used by the windows (and samba) machines on the network. The solution to this problem is here, although it works better if the hosts entry in nsswitch.conf reads

    hosts: files wins dns

    There are 2 solutions to the problem of accessing the windows shares. The first is to use a hacked version of the gnome virtual file system (gvfs) that fixes it, but installing it would break the automatic upgrade procedures. The other is the one I have used, but I must admit I am a little unsure about exactly what parts of it are strictly necessary.

    Modify the [global] section of /etc/samba/smb.conf making sure there are entries like

    netbios name = <this machine's name>
    workgroup = <workgroup or domain name>
    wins support = yes

    I think the next step is probably the most important, although it seems to be mentioned rarely in the attempts to solve it in the forums. You need to set up a samba password by using

    sudo smbpasswd -a <username>

    None of this quite fixes everything, but it does at least allow me to connect to and use Windows and Samba shares. Sometimes I can’t browse the workgroup and opening it shows no machines, so I have to specify the server name. I also can’t browse the shares on one of my machines, although I can see all the others.

    Tags: , ,

Pages

Calendar

May 2012
M T W T F S S
« Jan    
 123456
78910111213
14151617181920
21222324252627
28293031