
GStreamer bits and bobs
*OK, quick warning – this blog entry contains lots of technical GStreamer nonsense. I can already feel some of you getting bored, so just move along if this stuff doesn’t get your nipples erect.*
Recently I have started looking at how to let the user select a given sound card input for a particular track in Jokosher. Ideally the user should be able select an input from a combo box or something – Jokosher should automagically list which inputs are available and allow you to select one.
So, the first thing to figure out was if GStreamer can report this to me. On IRC I was told that there is a `GstMixer` interface that can be used within certain elements such as `alsasrc` and `alsamixer`. Knowing about this interface, I needed to find out how to list the available inputs. With literally no documentation available, I again asked on IRC and was told that the `list_tracks()` method is available. So, I wrote a little script to list the tracks available:
#!/usr/bin/python
import sys
import pygst
pygst.require(“0.10”)
import gst
import gtk
def main():
mixer = gst.element_factory_make(‘alsamixer’)
mixer.set_state(gst.STATE_READY);
if not mixer.implements_interface(gst.interfaces.Mixer):
print ‘Cannot get mixer tracks from the device.’
else:
mixertracks = mixer.list_tracks()
print help(mixertracks[])
if __name__ == “__main__”:
main()
gst.main()
The `mixertracks` list that is returned contains a bunch of `GstAlsaMixerTrack` objects. Again, no documentation is available *at all* for this, so I used Python’s `help()` method to pull out some information:
print help(mixertracks[0])
There are a bunch of methods and attributes in there which are pretty useful. It also seems I can toggle the track on to record from. So, all I need to figure out now is how to specify a particular mixer track as an input source in a recording pipeline.
I really like GStreamer, but again, the lack of documentation is a real pain. It seems that large parts of the GStreamer API are not even documented in C, let alone Python. The other sticky wicket was that the examples included with 0.10 Python bindings are pretty much all broken. I tried to submit a bug report for this but could not find which module on the GNOME Bugzilla I should report the bug in. I think if some time was spent to buff up these docs, GStreamer could be *even more* compelling. 🙂
—–

Adventures in spam 2
I was tickled pink to receive an awesome email from Minnie Winter:
> German beach ball of an seductive in conscientious objector CIA spindly popcorn heliport, terrestrial forgave hapless magnolia inhumane!!!
Yeah…thats…exciting. When you get an email that begins with the words *German beach ball*, the conversation could really go anywhere. Minnie then informs of me some important information about a *breakneck feedbag*:
> implode as an judgment as that infliction congratulate ophthalmologist waterfall Cabinet overhang a breakneck feedbag legalize a!!! bean with bedridden that as demonstrative unquestionable the as reckoning minimum wage and perforate:
Of course. So, readers, always, always remember to congratulate your local ophthalmologist about overhanging his breakneck feedbag. I feel rather fortunate that Minnie took the time out of her busy schedule to inform me of this important consideration.
Of course, she continues with her words of infinite wisdom:
> indisputable a jangle seller of carouse. aplomb, ACT to SASE nationality. so-so psychotherapy dent shocked on spelling, and inception extensively
…I can’t even hazard a guess as to what the hell she is talking about there. But, there is more:
> adverse: induce digest, was shameless upbringing to in that grass-roots affected and someday prudence a satisfying. the legal the as canyon in mystical press release: detest that solidity hood it flamingo vividly as indicative sorcerer, of thirsty of rape in mixture snobby blessing, a direct the it mule expressively as S.O.B. dragon exasperated in blues water tower paperwork night light mull
Right.

GUADEC submission
Just submitted by proposal for a talk at [GUADEC](https://beta.guadec.org/). It is called *Riding by the seat of your pants: The Jokosher story* and here is the blurb:
> “Once upon a time, there was a little radio show called [LUGRadio](www.lugradio.org). The devilishly handsome chap who mixed and edited the show was afflicted with the uncomfortable premise of resorting to Windows to make the show for the many peasants across the land. His reasoning was apt – Open Source audio editors failed to combine the masterful trickery and ease-of-use that he craved so longingly. Despite his efforts to make clear this sticky wicket, much flak ensued from the peasants. What a pickle”.
> “When pressed on the specifics of of why Open Source tools were at fault, the aforementioned gloriously bearded tweaker crafted a [design]((https://archivedblog.jonobacon.com/viewcomments.php?id=621)) for his perfect multi-tracker, suitably sodomised by his usability angst. After he published such thoughts to the interconnected worldwide abacus, he thought nothing more. Days passed and upon a chance encounter with a scribe of wiki, he noticed work had begun in earnest on such an endeavour, driven by a crack team of committed and talented peasants. The bearded one was suitably agog and threw both feet in to also dispense such contributions”.
> And so [Jokosher](https://jokosher.org/) was born; the all singing, all dancing GNOME-Cairo-GStreamer-PyGTK-Tango injected multi-track editor. But, this is only the start of the story…
> In this talk Jono Bacon will talk about how Jokosher came about, the core design goals, the choice of technology, the challenges faced with such an ambitious project, the progress made and the plans for the future. All of this will be suitably encased in a fun, loose and entertaining presentation.
Lets see if it gets through.

Dear Santa, can you make it work?
It is clearly evident that [the mighty coop](https://devel.co.uk/article/150/less-eye-candy-please) speaks clear, sparkling truth. If there is something that needs fixing, and quick, it is the ability to plug your laptop into a projector.
As many of you will know, I tend to [do a lot of talks](https://archivedblog.jonobacon.com/events/), and at pretty much every event I need to plug my laptop into a projector. My normal laptop is a Sony Vaio, and despite my best efforts, it just *won’t* talk to any projector known to man, women or child. I am sure that I need to invoke some kind of freaky voodoo bongo key combination to make it work, but there is no way of me easily identifying which combination this is without Googling – thats a bit shit for our target market of regular computer users.
My current solution for this? I use a separate laptop. Despite being the ugly duckling of the laptop world, IBM Thinkpads kick arse and take names when it comes to hooking up to a projector. I have *never once* plugged the Thinkpad into a projector and not had something appear. They are dependable out of the box – and you want something dependable when standing up in front of a room full of people.
So how do we solve this for everyone? I think we first need to identify what the source of this ongoing problem is. Clearly there are hardware issues at work here – I suspect the BIOS is largely responsible for acting as the gatekeeper to the magical external monitor port, and in tandem with X, it needs to spit out the signal at the right frequency, resolution and bongo level. Although the finger of blame seems to point at the BIOS, there must be a way of controlling all this – in the Windows world it just works out of the box.
It seems to me that we need a panel applet that stores a database of tricks to enable projector output for different laptops. Surely with all the sysfs, dbus and hal trickery that we have, we can detect the model of the laptop and invoke a suitable hardware event that will switch on the projector port. Even better, surely hal can detect when a projector is plugged in and pop up a notification bubble with a link to a projector output configuration tool.
As much as I love all the Xgl bling going on right now, I am with Paul in that this stuff needs fixing right now. How can we profess the ability to compete on the desktop when you need to poke `/etc/X11/xorg.conf` with a stick when you want to do a talk about how many toilet rolls you sold this quarter?

Jokosher screens
The [Jokosher](https://jokosher.org/) coding frenzy is continuing, and I thought it might be fun to post a few screenshots for those of you who are keeping an eye on it. Recently there has been more and more work going on, and more contributors getting involved.
Some work has been going on recently in porting Jokosher to GStreamer 0.10. this has always been the plan, but with many of the developers already running Dapper, it seemed apt to make the move. Although the audio engine is still broken at the moment, working is going on to fix this up. The ultimate plan is that we are looking into using [Gnonlin](https://gnonlin.sourceforge.net/) for performing much of the audio operations. Gnonlin is already used by PiTiVi and seems ideal for the kind of application that Jokosher is.
First up is the brand new mixer widget that landed in SVN yesterday. Jason hacked this together, and although it does not yet respond to audio, the guts of the mixer strip are ready to be hooked up. Here it is:
The widget uses Cairo and looks really sweet when running. You can grab the little white handler and adjust the volume, and it is all transparent and alpha blended.
Last night I hacked on another feature in the mixing view and added track hiding. In the above shot you can see a small ‘M’ button at the top of each track. When you hit that, the track shrinks to the toolbar at the bottom:
You can then click on the button in the toolbar to re-show the track. This makes it simple to only view certain tracks at any one time.
Recently, the audio engine was hooked up to the waveform, so now we see the volume curves when you import a song. Ben has been feverishly working away at this recording view and getting some of the wave editing tools working. You can now split waves by selecting it, right-clicking and selecting Split:
All of this is undo-able, so when you split the track, you can select Undo and re-join it together. Ben has also added functionality for deleting waves and tracks.
You can also zoom into the waveform:
Cool, huh?

Books, delays and dates
Wow, its been ferociously busy recently. Not only are things going on at work, but I am also working at finishing up the Official Ubuntu Book. This has involved the usual game of submitting work for review, taking review comments, merging them in, adding missing content and more. Thanks must go out to Jorge, Dennis, Quim and others for their fantastic contributions though.
What has made this process so much more interesting has been the recent suggestion from Mark to delay the release of Dapper. Yesterday there were two meetings on IRC intended to solicit thoughts and opinions from the community. Seveas waved the mighty wand of power and hosted the meeting rather well, and there was a great range of thoughts and opinions from fans, businessmen and hangers-on alike. Personally, I think the delay would be a good thing. Although Dapper is good in its current form, I think it could do with a few weeks for spit and polish. Dapper has always been considered a special release as it will compete with Vista and to make this shine through it could do with some more visual flair, further localisation, improved integration and continued stress testing. This one needs rock harder than all the others put together, and the suggestion of a delay is a clear commitment to this quality.
## Speaking
Some more speaking dates are coming up soon:
* On the Front Line: Convincing People the Inconvincible, Birmingham Perl Mongers – Wed 29th March 2006
* On the Front Line: Convincing People the Inconvincible, Nottingham Linux User Group – Wed 5th April 2006
* The Open Source Reality Check, OSS Watch Conference – Mon 10th April 2006
Let me know if you are at these dates and fancy a natter.
In addition to these dates, [Ted Haegar](https://reverendted.blogspot.com/) from Novell and I are planning a tour of LUGs in the UK in April. If you are interested in us both coming to your LUG, send me an [email](mailto: lugtour AT jonobacon DOT org). An official announcement of the tour will hopefully be released soon.

Comments b0rked
Just to let you all know that for some crazy reason, comments are not working at the moment on the site. Something odd has happened on the server which I suspect is down to a crash a while back. I will let you know when comments are re-enabled.
Don’t you just hate it when these things happen. Wait, don’t answer that…wait until the comments are back on.

Jokosher Mix Design
In [Jokosher](https://www.jokosher.org/) we need to implement audio sliders. These sliders are used for adjusting the volume of a particular instrument in the composition. In addition to adjusting the volume, sliders are also augmented with a few other features:
* They typically include a VU meter. This meter measures the volume of that particular instrument. This is essential for monitoring that particular instrument’s volume in comparison to other instruments. The VU meter also includes graduated colours to indicate the volume and how far away from clipping (distorting) it gets.
* They usually include controls to mute and solo the instrument. Mute turns off an instrument and solo turns off all other instruments and only plays the one you clicked solo on. These are essential – you may solo just the guitars or play everything but solo the guitar solo.
* All instruments need to visually identifiable. Jokosher is designed to be a very visual application and just like the recording view design (see [this post](https://archivedblog.jonobacon.com/viewcomments.php?id=621)), you should be able to glance at the screen straight away and see which instrument is which.
So, we have some core requirements. In addition to this we have the challenge of ensuring that the user can see their choice of instruments (e.g. instruments 1-4 from an 8 instrument project) as well as being able to chop and change which instruments are visible. Jokosher should also be able to view lots of instruments on screen at the same time.
## Usability considerations
Traditionally the slider view in most applications is modelled around a physical mixing desk. Compare for example, this desk:
with the slider view from Cubase SX2:
or Cakewalk:
Now, I can understand the rationale behind this. Mixing desks are part and parcel of studios and are a familiar method of adjusting volume control and instruments settings. The problem is that the screenshots above are *horrific*, god awful computer interfaces that are massively complex, difficult to read and frustrating to use. The problems can again be summarised:
* Way too many buttons, and the lack of space means they are insufficiently labelled.
* Use of dials for inputting data. Sure, they look like the dials on a physical mixing desk, but dials and mice don’t mix. Using a mouse to adjust them is just a pain.
* A bad balance between single-function controls and button-hell. In an ideal world, a button would do one, and only one thing. Multi-function buttons are difficult to learn, use and remember. The mixing desk tries to get away from this, but modern desks are increasingly lured over to a multi-function button paradise. Of course, this kind of paradise is like a rainy weekend in Bognor Regis with your mother-in-law.
* Bad accessibility.
Despite these problems, the idea of modelling the view around a mixing desk is not in itself a bad idea. One of the most fundamental aspects of good design is to use *knowledge in the world*. Many users will already be familiar with mixing desks, and mixing desks themselves were designed around the cultural and physical properties that spring to mind when we think of adjusting volume. Increasing something (such as volume) can be demonstrated physically by moving something up. This is why sliders move up to increase volume. This knowledge in the world also applies to experience of other audio packages. Love it or hate it, virtually all audio packages include a button-o-rama mixing view.
The problem with mixers are all those damn buttons. In Jokosher I want to capitalise on this knowledge in the world and also give the user control for what they need to acheive, but to not drown them in buttons.
## The design
So, with all of this in mind, I have poured these issues and requirements into my head, stirred them around a little and developed a design. My design is very simple, flexible, easy to use, reasonably simple to implement and seems to solve the problems described above.
When you go into the mixing view you will see something like this:
(sorry for the small size of the image, my gallery re-sizes everything down)
Here you have a number of instrument sliders. Each strip is one instrument. Let me first explain the features in there:
* The top of each strip is numbered. Numerically labelling strips is a good idea as well as giving them actual labels. So as an example, instrument 1 may be known as *1* and also have the label *Bob’s Guitar*. Next to the number header is a down-arrow button (this is difficult to see in this shot due to the resizing). More on this button later.
* Underneath the number are three buttons. Each of these will have icons, but I just put labels on there for now. M = mute, S = solo and C = configuration. The Configuration button will load a dialog box for applying effects and suchlike. This dialog bog has nothing to do with this design, so is not covered here.
* Underneath the buttons is the main slider view. More on this in a second.
* At the bottom is a visual indication of the instrument (the icon) and the label (this could be *Bob’s Guitar* for example).
When thinking about the actual slider, there were two main options available. One is to use the traditional technique of having the slider next to the VU meter and the alternative option was putting the slider head *on top* of the VU meter. Both have the advantages and disadvantages, but the main problem with putting the slider on top of the VU meter is that it obscures the actual meter reading. The flip side is that the problem with the side-by-side approach is that the slider does not accurately indicate how it syncs up with the VU. Ideally you want the slider on the VU meter but the meter reading to not be obscured.
So, I came up the above design in the image. On the slider part, the slider head runs to the side of the VU meter, but has a small bar that hovers over the meter. This small bar is transparent – this way you can accurately see how the slider reflects the meter reading and clearly see the meter.
### Adding and removing instruments
With the slider design solved, the next challenge was to come up with a way in which instruments could be added and removed easily from the view. As I said earlier, you want to be able to select which instruments are visible (when I say visible, I mean which slider strips are displayed) easily and efficiently. I also wanted to capitalise on knowledge in the world and in the head to ensure that the interface is intuitive, discoverable and learnable.
The solution to this was to build on the common desktop technique of minimising and maximising. In the design above, you can see the *Instruments Not Shown* bar. This has an entry for each instrument that is not currently visible. In the image you can see that instruments 7 and 8 or in the bar. To make 7 visible, just click on it an it appears. To minimise a track that is already displayed, you either double-click the numeric header or click the small down-arrow button next to the numeric header. Simple. This technique is simple to implement, uses screen estate effectively and builds on common computer knowledge that is (a) cross platform and (b) used by basic computer users.
The final challenge was to solve how you can have lots of instruments on screen at once. This is a tough one to solve as I want to provide full functionality with little space but still ensure the instrument controls are easy to click. The only way to achieve this reliably is to reduce the size of each of the strips. If you can reduce the size of the strips, more can fit on screen at the same time. With this in mind I set forth to design one of these reduced size strips:
In this reduced size you identify which instrument is which by using the numerical header and the instrument icon. The slider head is over the VU in this design. Although this obscures the VU, we can get away with it more as it is more likely that the user will be only adjusting volume levels instead of detailed instrument adjustments. This slimmer strip includes pretty much all the functionality as its fatter counterpart, although I may need to think of a better way to make the Mute, Solo and Configuration features available – I suspect those three buttons will just be *too* small. I could maybe use a combo with the icons in it.
So how does this thinner strip fit in? Well, when you load the mixing view it will default to the full strip size as discussed earlier, but as you add more instruments, they will get thinner and thinner to accommodate the additional instruments. At some pointn this will hit a threshold in which each instrument will have its normal strip switched for the thinner strip. So as an example, you may be able to fit 6 instruments on the screen comfortably and then when the 7th is added, it will switch to the slimmer strip for each instrument. Also, the dividing lines between the instruments should be movable so that the strips can shrink and grow. With this we will need to also set a threshold, so that (as an example) when the width of a strip shrinks less than, say, 100 pixels, it will switch to the thinner view.
This combination of ideas should continue to make Jokosher into the easy to use multi-tracker we all want. It will also continue to make Jokosher an innovative application – many of these ideas are new, fresh and different. Comments are obviously welcome. 🙂

Adventures in spam 1
You know, spam is a wondrous thing. No, not for filling our inboxes with pointless junk, but a wonderous thing for pure, unadulterated entertainment value. My spam folder in GMail is increasingly becoming a source of astonishing comedy. For your enjoyment, I figured I should pick out a few choice gems.
Having a beard such as this, it is not uncommon to recieve certain advances from the opposite sex. Hey, I can’t help being a love machine on legs, and my spam box echoes this very fact. Today I recieved the following message:
>Hi there lovely,
You its gonna be good when it starts like that…
> This kind of opportunity comes ones in a life. I don’t want to miss it. Do you? I am coming to your place bin few days and I though may be we can meet each other. If you don’t mind I can send you my picture. I am a girl.
Now, let us remember that spam is supposed be believed by the reader. I find it amusing that not only should this message be believed, but after I have been told about this once in a lifetime encounter and I am informed such a meeting can happen, the sender feels the need to clarify *”I am a girl”*. That was something of an afterthought. I suspect that such a lovely is actually a balding man with an odour problem.
I was chuffed to bits (no) to receive an email from Sterling Adair. Sterling has seen fit to email me a few times in the past and this time decided to fill me in on the latest in medical technology:
> Perfect erection. Even if you have no erection problems Cialis rocks!
Wow. Even if I can command a boner, I still need Cialis. Where do I sign up? Sterling is not only a shrewd businessperson, but also a source of enlightenment and inspiration. After the previous assertion that Cialis rocks, Sterling shares with me some important thoughts…
> Imagination was given man to compensate for what he is not, and a sense of humor to console him for what he is. A woman uses her intelligence to find reasons to support her intuition.
> It is normal to give away a little of one’s life in order not to lose it all.The sovereignty of one’s self over one’s self is called Liberty.
Thanks for that. Nutter.
—–

Heck, its busy y’know
Busy as usual. For the last few weeks much of my time has been spent working on the Official Ubuntu Book and working on [Jokosher](https://www.jokosher.rg/). In addition to this I have been nursing Sooz through a cold, going to work, writing music, rehearsing with the band, fixing up Sooz’s computer, playing with the dogs and catching my regular dose of Prison Break and 24.
## Official Ubuntu Book contributions
On the book front, writing is coming to an end, and I want to give the following list of people a big thank-you for their awesome contributions to the recipes chaper:
* Jay LaPrade
* Scott Dier
* Paul
* Antonio Ognio
* Stephen Sandlin
* Ju
* David Bain
* Oskar Jonefors
* Andrew Zajac
* Ian MacGregor
* David Clayton
* Manu Cornet
* Alan Barnard
* Avinash Meetoo
* David Symons
The deadline for recipes closes tomorrow! Get your recipes into me by the end of *Wed 8th March 2006* to ubuntubook AT jonobacon DOT org. For details about submitting a recipe, see the [original fridge post](https://fridge.ubuntu.com/node/282).
## Jokosher
Jokosher hacking continues at a feverish pace. This weekend saw a bunch of new features, which were nicely described in a [post](https://jokosher.org/?p=21) by Alasdair. This included:
* Added the first couple of SVG instrument icons(Vocal, Electric Guitar and Snare) from Dan and Greg.
* Added initial support for horizontal zooming.
* Added scrolling in the recording view.
* New projects now create an Audio directory in the project directory to store audio, and recordings save into the Audio directory too.
* Added vocal instrument icon.
* Added commands to allow arming, muting and soloing instruments.
Last night we had a rather late IRC meeting to discuss some core chunks of the Jokosher architecture and we have decided on a few architectural changes. The mighty Jason Field is going to implement these changes, one of which includes some freaky bongo code that Aq wrote. Its all good stuff and it will make Jokosher easier to hack on. 🙂