anotherbyte.netanother byte

Sound in Ubuntu Server 9.10 Karmic Koala

Published
13 Mar 2010
Updated
13 Mar 2010

I've recently attached my previously headless Ubuntu server to a TV - so it's purpose has morphed to be a server plus a media centre. I've installed Fluxbox, a minimal window manager for X. It means there's a GUI for the server for playing videos and maybe even youtube videos (if the old video card in the server can handle it).

All the extra software is available through the Ubuntu repositories. Installing fluxbox was not too difficult, although there were some problems getting everything required to run a GUI. It is quite configurable, but I haven't gotten around it that just yet. The default set-up is usable. Then just add Midori for web browsing and VLC for video.

Getting the wireless connection and sound to work was quite tricky. For wireless, I had a D-Link DWL-G122 802.11g Adapter available. The driver worked without any troubles, and I found wpa_supplicant the easiest way to set up the wireless. The two most important places to look when doing this are /etc/network/interfaces and /etc/wpa_supplicant/wpa_supplicant.conf. These were some of the most helpful pages:

Getting sound was a bit of a struggle. First of all, don't try making sound work in the 2.6.31-20 Linux kernel. It just doesn't. If you don't trust me, have a look around the web - people are finding problems everywhere. Next, it helps to have speakers plugged in (to the correct output jack) and turned on. Then check the volume in Linux. And the volume in the application.

For sound troubles, the best resource was this Comprehensive Sound Problem Solutions Guide. Since PulseAudio is the default Ubuntu sound server now, the documentation pages can be a real help.

Some of the most useful commands and files I found were:

alsamixer
command line volume control
less /proc/asound/modules
List the available/known sound cards.
ps ax | grep pulseaudio
Check if PulseAudio is running (there might be a entry for the grep command itself - ignore that).
pulseaudio -k
Kill any running pulseaudio server
pulseaudio -D
Start pulseaudio as a deamon (in the background)
/etc/modprobe.d/alsa-base.conf
ALSA config file in Ubuntu.
/etc/modprobe.d/sound.conf
Sound card config file in Ubuntu.
speaker-test
Use this command to play a test sound. Very useful to see if anything is actually happening.

Versioning a factory pattern or plugin architecture

Published
5 Mar 2010
Updated
5 Mar 2010

I have a problem: I need an architecture to allow for versioning a plugin, component or factory pattern in C#. The requirements are:

  • Simple way for a running program to access a new component.
  • When a new version is added, the older version still need to be available.
  • A way to specify which version of a component to use.
  • Standard interface for the program and the components to communicate.

I've got a couple of ideas. I could modify a plugin architecture to allow for versioning. I'm not really sure about dynamically loading dlls - bit more complex than what I have time for. Although I'm willing to listen to any reasoned arguments.

A console application wrapper could work. I could pass arguments for the various requirements. Then the console app could write out a text file in a well-known format. I'm not a real fan of writing and reading text files for communication if I can help it. I'd rather just call a method in code.

At the moment the console app is the most straight-forward idea. I'd have a whole bunch of directories named using the version. Then just create a new directory, copy over the required files, run the console app, read in the output file.

I'm really looking for a simple way to get this done without too much fooling around with complex c# concepts. Or a ready-made library.

Different faces of web development

Published
7 Feb 2010
Updated
7 Feb 2010

As a wider range of devices are able to access the internet, designing a website to work everywhere becomes more and more challenging. Desktop design is pretty much covered - it's the standard. Small screen design is slowly increasing in uptake, but it's still usually a second-thought, rather than a prime consideration. Unless a website is intended primarily for small-screen use. Now we're getting devices in between, such as tablets. Add with most of these new devices comes touch.

PPk's investigations and comments on touch support in mobile browsers shows a few things - more work is needed to make touch really work with websites, and web site developer will need to start supporting more than just mouse events. There are now three event types that need to be taken into account: mouse, keyboard and touch.

This area may be much more important than some other parts of HTML5. It is interesting to note that although Firefox and Opera are moving quite quickly in some area regarding HTML5 and added features, they score badly on touch and mobile browser UI support.

Options for good after 9pm snacks

Published
14 Jan 2010
Updated
14 Jan 2010
Tagged
,

Some possibilities for late night snacks:

Chocolate
CC-BY, Toasted Bread, René Ehrhardt

Cookies
Fruit
Yoghurt
Toast
CC-BY-SA,B52 Chocolate Pastry, Kirti Poddar

Juice

Aggregate reports may be a problem

Published
13 Jan 2010
Updated
13 Jan 2010

Two very different topics, related by a small but important point:

Basing decisions on aggregate data can be a bad idea.
Looking at the overall cost of IT failures and critically looking at reporting on fundamentalism, and the (from my perspective, which I now know is incorrect) over-representation of Islam as much more touchy and violent than other religions and groups.

IT project failures can cost a lot, and no company is safe from massive failures. However, the huge failures can easily hide all the successful small or medium (or even other large project) successes when analysed in aggregate numbers. Even projects classified as failures may help or cause significant gains in other areas. As the Techdirt article notes, it is a better idea to take the lessons from the successes, failures and anything in between. This knowledge can be used to help create a successful IT project, or minimise a failure.

In the area of fundamentalism and violence, there are some dominating events. There are also a huge number of other events that may receive very little reporting, or may be reported with the emphasis in a different place. It is just not possible or necessary to include all the details about the perpetrator of an action, so people reporting attempt to choose the most relevant information. Unfortunately, this can often mean stereotypes or discriminatory perceptions are perpetuated.

The aggregation of these 'snippets of stereotypes' can lead to a perception that there is substantially more than there actually is. Here is where the IT projects and reporting on violence and fundamentalism meet. In looking at the 'big picture', and forming ideas from very processed pieces of information, we risk missing the real conclusions.

A reversal of a well-known saying: Can't see the trees for the forest.

Repairing a wireless network connection

Published
12 Jan 2010
Updated
12 Jan 2010

I've recently had the very exciting experience (yeah...) of attempting to diagnose and fix a wireless connection in Windows XP on a laptop. I think I've tried every trick in the book, but nothing's worked. For the sake of completeness, I'm going to list out my plan of attack. If I've missed anything, please let me know in a comment!

In order from most likely/least drastic to least likely/most drastic:

  1. Repair the Local Area Connection.
  2. Use the command prompt to ping the router and another computer on the network
  3. Use ipconfig /all to show the current IP address and adapters. This helps identify the problem.
  4. Using the command prompt:
    1. ipconfig /release
    2. ipconfig /renew
  5. Disable and enable the wireless card (usually with a switch on the laptop).
  6. Disable and enable the Local Area Connection in Network Connections.
  7. Turn the wireless router off, wait for 10 seconds, and turn it on again.
  8. Check the DHCP settings in the router - DCHP table, start and end IP addresses.
  9. Check the Device Manager to make sure the hardware is recognised, the drivers are functioning and up to date.
  10. Use PC Wizard (from a flash drive if possible) to check the condition and type of wireless card.
  11. Check the manufacturer's website for updated drivers; sometimes it is also worth checking for updated generic drivers. This includes trying out alternate wireless managers that replace the built-in Windows wireless manager.
  12. Reset TCP/IP - netsh int ip reset c:\resetlog.txt

If all this fails, then there is a hardware problem with the laptop, a problem with the router, or interference between the laptop and router. These issues require a whole separate set of troubleshooting steps.

I hope this can help someone!

Another way to look at it

Published
11 Jan 2010
Updated
11 Jan 2010
Writing content for the web is an exercise that I'm not sure I'm so good at. I just ran into this article about web writing, and the possibility that page views are not what it's all about. I'd like to add my two cents to this, and say that making the content easy to read may be one important part, but there are some much more important issues: actually writing (which I seem to be failing at, lately), and knowing you topic. No point writing clearly or in you're own style, if you aren't writing anything.

On that note, I think my objectives for this blog aren't to make people spend more time reading it, but to get my thoughts down. There are quite a few things I would love to record and get feedback on. I am going to make a concerted effort to write more... but no promises.

In other news, Firefox 3.6 RC is out. It's really only incremental updates, but there are some interesting things in there, like async Javascript, WOFF fonts, Personas for changing appearance and numerous changes to how Firefox deals with plugins.

Let's just hope there's fewer crashes.