Northern Nerd

Just another blogging geek
RSS icon Home icon
  • LG L1730SF touch screen display in Ubuntu Linux 8.04 Hardy Heron, part 3

    Posted on August 16th, 2009 trk 7 comments

    In the 1st part we set up the drivers for the touch feature, and in the 2nd part we solved the weird jumpiness issue. Now we are ready to proceed to calibrating the display, and fine tuning the system for touch based usage in general.

    Calibrating the touch input

    The idea of the touch screen is that the user interface objects presented on the screen can be directly pointed at, using a pen or a finger. Ideally, when user sees even a single pixel at, say coordinates 100, 150 and then pushes the screen with a pen at this point exactly, the touch screen / mouse driver should register exactly the same coordinates and report them to the windowing engine.

    However, in practice things are a bit different. For example, the resistive touch panel used e.g. in LG L1730SF is placed on top of the display panel. In real life things are not perfect, so there will be some offset in the display component framing, in the touch panel component framing, and in their relative placement on top of each other. Every manufactured device ends up being slightly different.

    The result is that there will be some offset between the actual/perceived location of the touch, and the location reported to the windowing system that draws the mouse cursor and processes points and clicks. This is bad. For example, it can be very annoying if you are trying to hit a link on a web page, but always seem to miss it just a little!

    Fortunately, this error can be fixed fairly well with a proper calibration. Calibration is a procedure based on showing a known location to be touched on the screen e.g. with an X mark, and then sampling the actual location that was touched. The difference between screen coordinates and mouse coordinates tells what kind of offset the particular display has. For example, when the user thinks he has touched precisely coordinates 100, 150 we may have received 108, 145 as mouse coordinates. Thus the difference is +8, -5. In order to correct the error, the offset can be removed by manipulating the mouse coordinates with the offset values found via calibration. This will be done already at the driver level, e.g. (+8, -5) could be subtracted from all input reported by the touch panel. The X windowing system would then get slightly different mouse coordinates that should match much better with the screen coordinates and perceived touch location.

    Read the rest of this entry »

  • LG L1730SF touch screen display in Ubuntu Linux 8.04 Hardy Heron, part 2

    Posted on August 10th, 2009 trk 3 comments

    Let’s continue with setting up the touch feature. In the end of part 1, we managed to rotate and mirror the display properly and just started calibrating it, when we encountered a problem where the cursor at first does not seem to follow the finger, and then suddenly jumps ahead. Let’s solve that next.

    Note: You should only read this through, you don’t need to repeat everything I did. The actual solution is in the end of the text, so there’s what you need to do.

    Since we now have two drivers in the system for the touch feature, usbtouchscreen for the display device and evtouch for converting the input events to a suitable format for X, the first question that comes to mind is, which one of the drivers is causing the jumpiness? We should go to the source of the information first, i.e. usbtouchscreen.

    Read the rest of this entry »

  • How to create a free audio link over the Internet using an old PC, Ubuntu Linux and Icecast streaming software

    Posted on June 8th, 2009 trk 2 comments
    The purpose of this article is to help you in creating a reliable and free one-way audio link over the Internet. The primary use case is to enable low-cost transmission of radio program from radio station premises to a remote broadcasting tower. The method explained here is suitable for other one-way transmission needs as well, but due to long latency it cannot be used for two-way conversations (use e.g. Skype instead). Streaming live audio signal from one computer to another can be accomplished even with old low-cost computer hardware and free open source software, which makes the setup very affordable and enables interesting use cases.

    Abstract

    There are many different needs for sending an audible signal from one location to another. The technology that works in one use case may not work well in another. We can divide the applications into two main categories:

    The applications in the first category are aimed for enabling conversations over long distances. Telephone calls and teleconferences are perfect examples. Within this category the sound quality is not the top priority, but low latency can be considered a must. Both closed and open source software solutions exist, the most well-known being Skype.

    The applications in the second category are aimed for broadcasting an audio signal from a single source to a larger audience, which in general does not need to be able to communicate back to the source (i.e. the audience listens only). Within this category the sound quality is an important enabler for long listening periods, whereas long latency can be usually tolerated well. Both closed and open source software solutions exist, for example Shoutcast and Icecast.

    The setup described in this article is intended to be a one-way pipe for high quality live audio signal. Therefore, these instructions are likely useful in use cases that fall to the second category.

    Read the rest of this entry »

  • Interfacing old Commodore 64 printers with Arduino

    Posted on June 2nd, 2009 trk 4 comments
    img_8187This article explains how to use an old Commodore 64 printer in Arduino projects. A simple schematic for an adapter between the printer and an Arduino is presented, as well as a software driver for easy printing from Arduino code. Arduino is a popular open-source electronics prototyping platform based on Atmel Atmega 168 microcontroller. Commodore 64 is a classic microcomputer from the 80′s that still has many fans. The printer that is here used with Arduino is Brother HR-5C thermal matrix printer, but other CBM-64 compatible printers should work as well.

    Motivation

    I still remember that long-awaited day when my dad brought home a Commodore 64 microcomputer! That device became to be my first computer, and I spent countless hours playing with it in my youth – mostly gaming, but also a little bit of programming with BASIC. I still have it, although it doesn’t work anymore… We used to have many peripheral devices, too: the famous 1541 floppy disk drive, 1530 tape player, joysticks, paddles, cartridges, and even a printer!

    In fact, that printer (Brother HR-5C) was a wonderful little thing: battery or AC powered, printing on thermal paper and other paper types too with a ribbon cassette, supporting full CBM-64 character set and custom characters. The printer is still working just fine, and I happen to have a lot of thermal transfer paper in my storage (unused fax machine paper). However, since my CBM-64 is dead, I cannot actually use the printer :-(

    I’ve been thinking about building an adapter so that I could connect the printer to modern PCs. I just couldn’t find any proper reason why would I want to print with that device instead of my much better quality and faster laser printer…

    Until, I got an idea…

    Read the rest of this entry »

  • Using Arduino in Eagle schematics with Ubuntu Linux

    Posted on May 28th, 2009 trk 3 comments

    In electronics projects it is a common task to draw schematic of a circuit that you have designed. For simple circuits, it may be tempting to draw them on paper with a pencil. However, CAD programs are definetely worth learning! One of the best tools is Eagle, which runs on Windows, Mac and Linux. There is even a freeware Light version available for hobby projects. This article briefly explains how you can use Eagle on Ubuntu Linux for drawing schematics especially for your own Arduino projects.

    Installing Eagle on Ubuntu Linux

    Obviously the first step is to install Eagle on your Ubuntu Linux computer.

    The easiest way to install Eagle in Ubuntu is via Applications->Add/Remove…, where you can simply type “Eagle” in the search box to find Eagle from Ubuntu software repository. In Ubuntu 8.04, Eagle is located in the multiverse repository, which must be enabled before installation.

    Unfortunately, the version in Ubuntu repository is rather old: 4.16r2-1. You probably want to install the latest version, which can be downloaded with a web browser directly from Cadsoft: http://www.cadsoft.de/download.htm. You should choose the Linux version, right click the download link, and select “Save Link As…”. After downloading is finished, you can install the package (the file you downloaded, e.g. “eagle-lin-5.6.0.run”) by opening a console and running the installation script as follows:

    sh eagle-lin-5.6.0.run

    Read the rest of this entry »

  • My first mini laptop, Asus EeePC 1000HE

    Posted on May 23rd, 2009 trk 5 comments

    I commute on a daily basis by bus. The travelling time is roughly 45 minutes in the morning and 50 minutes in the evening. I don’t need to change bus, its a direct route from my home door to the office door (lucky me!). So there’s long enough sitting in one spot to actually do something useful.

    So far, I have been reading books or playing with my Nokia N95 – ie. listening music, reading daily news, playing games etc. However, after 2 years all this feels quite passive – instead of reading/listening/playing/otherwise consuming some form of entertainment made by others, I would like to be able to create something myself and really make use of that time. A family man never has that much time for himself, so every bit counts.

    I’ve been carrying my bulky work laptop occasionally with me, but I don’t really want to use that for my personal stuff. Besides, that old windows installation boots in 5+ minutes… so I bought my first mini laptop. The idea is that I can easily slip it inside my backbag, boot fast, and then do much more than I can with a mobile phone.

    I ended up to choose Asus Eee PC 1000HE (black). It’s a typical mini laptop with Intel Atom processor, 1 GB of memory and 160 GB hard drive. However, this one’s got a battery with some extra juice: advertisments claim 9.5 hour usage time! In practise it is likely closer to 7 or 8 hours, but hey -  that triples the usage time I get with my HP workhorse.

    I have just finished installing some basic stuff and configured Windows XP to my taste (well, up to the limit where you can tailor any Microsoft product). Of course, I will install Ubuntu on this machine and use primarily that. However, I made an exception and decided to let Windows stay for now too, as occasionally one cannot avoid using it (for example, to update new firmware to my Nokia phone).

    So far my experience of this little machine have been very nice. It turned out to be a bit heavier than I thought, but that doesn’t really matter in the bus. Keyboard is nice (to write with), and although I was a bit skeptical about the display size, 10″ and 1024×600 resolution seems to be good enough for basic computing things – like writing this blog.

    So perhaps there will be more updates to the blog in the future… I’ve already got a lot of material from my hacking projects that I’m planning to put here, it just needs to be edited and published. Stay tuned.

  • Spotify revolutionizes music listening

    Posted on May 13th, 2009 trk 4 comments

    This is not a tutorial, but I just have to write about this…

    I’m a music lover. I’ve been listening, playing and composing music since elementary school. For many years I’ve been sad about the situation of the music industry as a whole. Big companies seem to be ripping off both the artists and the consumers with their pricing, and at the same time they have refused to develop new business models, stubbornly sticking to CD sales and hoping for the Internet and MP3s to just go away. Moreover, sending an army of lawyers after their best customers and greatest music consumers is not only bad business, but plain stupid. Attempts to limit civil rights in a global scale and to collect money with tax like unjustified payments from everybody have made people angry, despite of their love to music and great artists. As a result, many of us have stopped buying music at all to boycott these methods. I’m one of them. I don’t want to support what they are doing to people and to our culture. Not with my money.

    And you know what? It seems to be working. At least I like to belive that. We have lost many years in this fight without actually getting anywhere, but now I’ve been sensing that there is indeed a little bit of light in the end of the tunnel. Big content is beginning to realize that they need to switch from denial to adaptation, or face consequences of falling business models as CD sales continue to decline year after year. They have started to give up of ridiculous demands for draconian DRM solutions, and instead licensing their content to various start-ups who are creating new kinds of online stores. iTunes first proved that selling music online is viable, and montly payments for streaming music has been clearly accepted by the big record labels as a new business model.

    So things are changing indeed. It is now possible to buy music online from many fiercly competing stores, like iTunes and Amazon – although these are still available in only a limited number of countries, which many seem to forget. However, so far the user experience of these shops, DRM, bad audio quality, and closed file formats have effectively prevented many from fully embracing legal online music and actually becoming a paying customer. This includes myself. And what is even more important, it has been easier to download good quality files from, say, The Pirate Bay – for free. For now, it should be obvious to everybody that free music is here to stay, either legally or illegally, like it or not.

    So how do you compete with free? You create something that is better than the free alternative. And what that could possibly be? You have to add some real value to it. You have to do something on behalf of the users, serve them better. Something even a huge number of enthusiastic volunteers sharing all their files cannot or won’t do. You bring organization into a chaos. You make all the content available from one shop. And if you make it right, you’ve got a killer.

    Read the rest of this entry »

  • LG L1730SF touch screen display in Ubuntu Linux 8.04 Hardy Heron, Part 1

    Posted on April 29th, 2009 trk 23 comments

    LG L1730SF touch screen in Ubuntu LinuxA few years ago I bought a 17″ touch screen display device LG L1730SF. The product itself was nice, and very affordable at the time. However, it wasn’t easy at all to get it working with Ubuntu Linux 6.06 Dapper Drake. I wrote a somewhat detailed instructions about my setup and published them on these web pages. To my surprise, the article got many positive comments and questions even several years after. Apparently touch screens in Linux was a hot issue (at least to geeks like me) and there was not enough information available for troubleshooting.

    In August 2008 I went through it all again after updating to Ubuntu Linux 8.04 Hardy Heron. However, this time I was better prepared, having a few years of experience on Ubuntu. This article brings the instructions more up-to-date and answers some questions I didn’t have a clue about at the first time. Although Hardy is already a year old and major computer manufacturers are publishing computers with built-in multi-touch capabilities almost daily, I still think these instructions should be valid for all DIY guys for a few years, since it is a long term support (LTS) version of Ubuntu.

    Note: I have written this article 8 months later from my memos. It was not straightforward to get the touch feature working, thus some unnecessary adventures had to be made. However, I decided to include them all here so that others can learn from my mistakes. Moreover, with a complex issue like this I think it is better to elaborate too much than too little – you can easily skip the chapters you don’t care about. I have also tried to explain what I am trying to do and why at each step, as many Linux/Ubuntu newbies need these things to be explained so that they can learn (I went through that myself a few years ago). As a result, the article is quite long and you don’t actually need to perform all the steps that I describe. These steps are marked in the text.

    Introduction

    In this article I assume that you have already setup Ubuntu Linux 8.04 Hardy Heron to your computer using keyboard, mouse and another display device. I will focus on explaining how to configure the system to operate with LG L1730SF display and its touch feature. Note that a keyboard and a mouse should be connected to the computer when you are going through the setup according to this guide. After you’re finished you can use the computer without them via the touch feature and virtual keyboard. Read the rest of this entry »

  • Hello World!

    Posted on April 27th, 2009 trk No comments

    I have just switched from my old Drupal based blog to WordPress. For keeping a simple blog Drupal turned out to be too complicated system.

    However, the thing that eventually made me ditch it was the need for frequent manual updates due to security issues. I cannot understand  why a web service won’t update itself whenever a new release/patch becomes available. In Drupal community they give you the answer that it is insecure. Then how Windows and Linux desktops do this? And if I type the commands required for updating the site instead of an automated script, how does that increase security? I don’t read the code. It does not seem a technical but a human issue.

    I decided to look around. After googling a bit, I learned that WordPress supports some kind of one-click update. That’s the attitude I am looking for, so I decided to give it a try. So far (2 hours after installation!) I’m very satisfied. With Drupal I had to spend so much time for non-productive work, and this site is all about hobby projects. Now, with WordPress, everything seems much more like it should be, and I can already feel that I can concentrate on the content from now on. Let’s see if that feeling lasts.

    Already looking forward to get posting all the almost-finished articles…