Arduino + 4 x 4051 Multiplexer + 28 POTS = MIDI controller

Pretty straightforward build. 4 multiplexer output pins into the Analog in ports of the Arduino 1,2,3 and 4.

Pitfalls: If you have an Arduino Leonardo: use Serial1.print to write to the TX on the 2nd pin for MIDI. The normal Serial.print writes to the USB TX. (very useful for debugging)

Pitfalls: I have a significant voltage drop therefore I use the first pin on the first multiplexer to read the analog value and use it as a reference when mapping.

ex: midi_value = map(analogValue, 0, myREF, 0, 127);

myRef is read in the setup() function from 4051 chip 0, address 0.

 

1. Placeholder graphics and placement (Arrangement is identical to MiniMOOG 😉 )

2. Drilled holes and final placement

3. Bottom view with first ribbon cable in place

4. Remaining ribbon cables and +5V / GND connections made

5. Perfboard with BUS and sockets for the multiplexers

6. Wired together + added the MIDI connector

7. Close-up of the wiring

8. Finished product, running NI Massive

10. Close-up of finished product

And the final “product”. 🙂

jQuery content slider for Typo3 with typoscript

I wanted to use a dynamic jQuery content slider with menu for Typo3. Something like you see on many modern pages: you have some sort of a menu and the content changes based on click events bound to them with some slide/fade etc. effect

I decided to create a hidden page and then use it’s sub pages as the menu elements for the slider. This way you can have multiple content elements grouped by pages. (to edit the content of a slide you edit a page in the tree. To add/remove more items to the menu you create a page within that tree)

In the image the “About credit cards” page has UID=99 and has the “Hide in menu” property checked. We will use this later in the typoscript.

I am usingTemplavoila so I’ve created and mapped the following lib paths: field_about_menu and field_about_ccontent

1. The Typoscript for the menu

lib.field_about_menu = HMENU
lib.field_about_menu.entryLevel = 0
lib.field_about_menu.special = directory
lib.field_about_menu.special.value = 99
lib.field_about_menu.wrap = <ul class="guide-menu"><li class="guide-menu-title">About Credit Cards</li>|</ul>
lib.field_about_menu.1 = TMENU
lib.field_about_menu.1.NO.subst_elementUid = 1
lib.field_about_menu.1.NO.doNotLinkIt = 1
lib.field_about_menu.1.NO.allWrap = <li><a href="javascript:" rel="#guide-content{elementUid}">|</a></li>

You can see here that I am wrapping an UL around the menu and LI around each menu item. I am also building the links by manually using the doNotLink property. In my javascript code I am using the “rel” attribute to identify the link between a menuitem and the content element i want to slide/fade to.

I am using subst_elementUid property to generate the rel attribute for each A tag.

2. The Typoscript for the content of the slider

Now comes the tricky part: building the contents of each slide.

I will query all the children of my hidden page. (“About credit cards” – has UID of 99)
Next I will query all the content elements that belong to each of the pages in the result set.
Finally I will wrap them in some tag. (in my case UL and LI, but it can be DIV-s or anything you like)


lib.field_about_ccontent = COA
lib.field_about_ccontent.wrap = <ul id="second-carousel">|</ul>
lib.field_about_ccontent.1 = CONTENT
lib.field_about_ccontent.1.table = pages
lib.field_about_ccontent.1.select.pidInList = 99

lib.field_about_ccontent.1.renderObj = COA
lib.field_about_ccontent.1.renderObj.9 = TEXT
lib.field_about_ccontent.1.renderObj.9.field = uid
lib.field_about_ccontent.1.renderObj.9.wrap = <li id=”guide-content|”>
lib.field_about_ccontent.1.renderObj.10 = CONTENT
lib.field_about_ccontent.1.renderObj.10.table = tt_content
lib.field_about_ccontent.1.renderObj.10.select.pidInList.field = uid
lib.field_about_ccontent.1.renderObj.11 = TEXT
lib.field_about_ccontent.1.renderObj.11.value = </li>

Look carefully at the code. You will see that the trick is to tap into the renderObject of the first query.
And then use the UID field to query the content elements of each page.

The code groups the content elements of each page by wrapping them in a LI tag and it will use the page’s UID to generate an ID attribute for this wrapper. (this ID will match the ones used in the REL attributes used in the menu links)

You may now use jQuery to bind click events to your menu and handle the content sliding with your favorite plugin.

On my web page I used something like this:

$(".guide-menu li").has("a").each(function() {
if (!($(this).children("a").hasClass("active"))) {
var nonactives = $(this).children("a").attr("rel");
$(nonactives).hide();
}
});

$(“.guide-menu li a”).click(function() {
if (!($(this).hasClass(“active”))) {
var tohide = $(“.guide-menu li a.active”).attr(“rel”);
$(tohide).hide();
$(“.guide-menu li a.active”).removeClass(“active”);
$(this).addClass(“active”);
var toshow = $(this).attr(“rel”);
$(toshow).fadeIn(1000);
}
});

$(“.guide-menu li a”).first().click();

Here is the output of the above code. (and feel free to comment/ask questions)

Setting up a Sanguino w/644P with an Arduino ISP

I’ve recently killed the Atmega328p chip on my Arduino Duemilanove board. (I accidentally touched a 2000mA power source to one of the output pins….)

Instead of buying a replacement chip I’ve decided to get the Atmega 644P and reuse my old Duemilanove board for USB and Power. 644P has more IO pins, more program memory and more SRAM.

Here are the full specs: DataSheet ATmega644P

I made a Sanguino variant with an ATmega644P on a perf-board as shown here: Sanguino Schematics. I only want to power the 644P chip and have an external oscillator.

This is a minimalist version without the voltage regulator circuitry and only the ICSP header. Everything will be powered and programmed by the old board. I’ve inserted an Atmega8 into the Arduino Duemilanove and flashed a Boot Loader using the BitBang method described below and uploaded the ArduinoISP sketch.

Tasks to be done:

1. Burn Boot Loader to the 644P chip
1.1 Burning via FT232RL BitBang Mode
1.2 Burning via Arduino as ISP

2. Upload the Blink sketch
2.a. Manually
2.b. via Arduino IDE


1. Burn Boot Loader to the 644P chip

1.1 Burning via FT232RL BitBang Mode

An extensive tutorial on the subject: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html

After installing “avrdude-serjtag” according to the tutorial, open up a terminal and try to read the signature of the 644p chip.

avrdude -c diecimila -p m644p -P ft0

If you can’t get a connection try -B 4800 (worked for me)


You can now copy the file ATMEGABOOT_644p.hex into the bin directoryof avrdude and flash it to the chip.

avrdude -c diecimila -p m644p -P ft0 -B 57600 -U flash:w:atmegaBOOT_644p.hex


Reset your board after detaching the ICSP. The debug LED should blink. (probably 3 times in about 6-8 seconds)

1.2 Burning via Arduino as ISP

You can check a tutorial on it here: ArduinoISP

!!! Upload the ArduinoISP sketch: Remember to upload the Examples/ArduinoISP sketch to your controller board. (You will use this to communicate with the Sanguino) This will turn your Arduino board into an avrisp programmer.

!!! You need to disable AutoResetOnSerialConnection Here is more info: DisablingAutoResetOnSerialConnection

For me I just put a 10uF cap to the 3.3v and the Reset pin but the 120 resistor works too. (make sure you get the polarity right)

Now try to get the signature of the device:

avrdude -p m644p -c avrisp -P com5 -b 19200 -V

You should get something like this. This guarantees a correct read.


You should get the Sanguino folder and copy it into Arduino IDE/hardware/

http://code.google.com/p/sanguino/downloads/list

You might need the 644p profile for avrdude.conf and the ATmegaBOOT_644P.hex

You can now flash the chip manually with avrdude or via Arduino IDE.

a.) Manually

avrdude -p m644p -c avrisp -P com5 -b 19200 -V -U flash:w:atmegaBOOT_644p.hex

You should get a confirmation at the end that all went well.

b.) via Arduino IDE.

To burn the bootloader you need to edit boards.txt files in the Hardware/Sanguino folder and change the content to this:

[code]
sanguino.name=Sanguino (w ArduinoISP)
sanguino.upload.maximum_size=63488
sanguino.upload.speed=19200
sanguino.upload.using=arduino:arduinoisp
sanguino.bootloader.low_fuses=0xFF
sanguino.bootloader.high_fuses=0xDC
sanguino.bootloader.extended_fuses=0xFD
sanguino.bootloader.path=atmega644p
sanguino.bootloader.file=ATmegaBOOT_644P.hex
sanguino.bootloader.unlock_bits=0x3F
sanguino.bootloader.lock_bits=0x0F
sanguino.build.mcu=atmega644p
sanguino.build.f_cpu=16000000L
sanguino.build.core=arduino
[/code]

In Arduino IDE go to Boards and select Sanguino (w ArduinoISP). Now go to Tools/Burn Bootloader/w Arduino ISP. All should go well.

2. Upload the blink sketch

Here is a small modified version of the sketch to loop through all the output pins and blink them.

[code]
void setup() {
for(int i=0;i<32;i++) {
pinMode(i, OUTPUT);
}
}

void loop() {
for(int i=0;i<32;i++) {
digitalWrite(i, HIGH); // set the LED on
delay(5);
digitalWrite(i, LOW); // set the LED off
delay(5);
}
}
[/code]

Make sure you have AutoResetOnSerialConnection disabled and that you get a correct signature read.

If you don’t you will get an error like this:

[code]
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e9307
avrdude: Expected signature for ATMEGA644P is 1E 96 0A
Double check chip, or use -F to override this check.

avrdude done. Thank you.
[/code]

Or worse yet you might attempt to use the -F option and overwrite something on your main chip. Remember that if you mess up anything you can always use the ftdi bitbang method to re-flash the bootloaders to your chips.

All you need to do now is to choose Sanguino(w ArduinoISP) from your boards menu and click upload. All should be OK.


How to fix YouTube video playback on an Apple Powerbook G4 running MacOsX 10.4

I almost gave up on this, but luckily I found a good solution that works for me. I own a Powerbook G4 1Ghz 1.25Gb RAM. I noticed that altough movie playback is great in VLC when it comes down to the flash player it has horrible performance. In fullscreen mode even in 360p playback youtube stutters and hangs and does a performance of around 8-12 fps on my system.

Here is a step by step description of what I did. This is for Firefox so make sure you install it!

What we are trying to do is to change the flash video player for Youtube only. Forcing an alternative player that is better supported by the OS. This can be either VLC or Quicktime since both players support FLV and MP4 playback.

Step 1: Get Greasemonkey

In firefox you go to Tools->Add-ons->Get add-ons

Search for the word “greasemonkey” and click “Add to firefox”. After installing this will restart your firefox.

Step 2: Go to userscript.org and get “Youtube without flash auto” script

http://userscripts.org/scripts/show/50771

Click “install”. A window will popup allowing you to install the script.

Step 3: Go to youtube.com and open a video. The flash player will initialize and will stop. A new menu will appear under every video. Click the “YWOF Prefs” button. A config screen will appear.

Step 4: for default quality choose MP4 and the quiality you would like your vids to default to. I use the quicktime plugin so I chose MP4. For “player” leave “Generic”.

Step 4 (Optional): If you would like to use VLC make sure you download and install VLC and the VLC Internet Plugin. You can find both for MacOS 10.4 here: http://www.videolan.org/vlc/download-macosx.html Again: only do this if you are sure you want to use VLC. I am using QuickTime. No need to do VLC unsless QT doesn’t work for you.

Step 5: Next time you open any youtube video the QuickTime plugin will play it. Double click the screen to go to fullscreen mode and enjoy stutter-free youtube on your Powerbook G4 with MacOS 10.4.* (to exit fullscreen: double-click the video, as keyboard did not work for me)

Hope this helps. Figuring this out surely made my day since the biggest issue with my Powerbook G4 for me was the inability to use youtube.

EDIT: Upon further tweaking I noticed that the VLC plugin work much better for me then QT.

.

Using T-Mobile G1 as an Android development phone

I have recently bought a T-Mobile G1 from a local auction site. The reason for doing so was to test my android apps on a real hardware and also to try to tap into the mind of the Android user.

Before committing to a particular device, I took the time to do some research.. however the results were most unsatisfying.. Whenever you search on something related to: Tmobile g1 android development there are so many reviews of the phone and so much buzz and clutter about the android phones that it is almost impossible to find good answers..So the whole reason for this post are the following Q&As:

1. Can I test my own android apps on the T-Mobile G1 (i am talking about the LOCKED device from T-Mobile) ?

Answer: YES YOU CAN

2. Can I DEBUG my own android applications with the T-Mobile G1 ?

Answer: YES YOU CAN

3. Do I need to update to a special version of the Android OS (ROOT my phone, then install a custom ROM) in order to test & debug apps on the T-Mobile G1 ?

Answer: No, you don’t need to. You can enable debugging via the “settings” menu of the phone.

And now finally a quick tip..This was the reason I almost rooted my phone and almost flashed it with a custom firmware. The setting to enable debugging was not in the menu where the google dev-page states it is supposed to be. (the google page does not say it should be under settings so I thought that on the google dev firmware (like in emulator) there will be special shortcuts for development functions)

On my G1 this setting was in Menu / [Settings] / Applications / Development / USB Debugging.

So it was a few menus off, and I just couldn’t find it….. Once that is enabled, whenever you plug in the phone via USB cable to your PC it will recognize it as an android development device. (remember to set your app as debuggable in the manifest file, and install google’s usb driver)

A short tutorial on how to get started:

1. Set USB debugging on your device
2. Plug in the USB cable and connect it to the PC (you don’t need to mount the SD card)
3. Install google’s driver: (you can find it in the Android SDK)
4. Make sure you restart ADB (if you have ADB running while installing the USB, your device may not be listed until you restart ADB)
5. (skip this if you like) After installing the driver restart ADB:
adb kill-server
adb start-server
6. check to see if you device is listed
adb devices (your phone should be listed)
7. Start eclipse and edit the manifest file. Under application set “Debuggable” to true
8. When you run your application a menu will appear asking you if you want to send it to the device or not. (if it does not, you can force adb to use the physical device by typing: adb -d )

 

Been busy building my new library: SimpleFaces for PHP

I have been inactive on my blog for a long time. In this time I have managed to screw up 4 Xbox360-s  with reflowing..I will give up fixing xboxes for now..

In all this time, I have been working on my new library which will definitely help out development for web applications. Soon I will post more info about the matter, but for now development is ongoing..

PHP SimpleFaces is an ajax framework built for PHP. It allows users to define interfaces via XML in a very similar manor to modern UI builders. The cool thing is that you can bind classes and methods to events on your frontend controls and you get to handle them in PHP. Although this seems like something that was done before by other libraries, in SimpleFaces you get to control all the frontend UI elements directly from within PHP.

http://www.phpsimplefaces.com

There are some demos available on the site as well an early video showing off the features. Hopefully I will release a public version in January 2010.

Flashing TS-H943 ms28 firmware on ATI SB600

I have successfully flashed an XBOX 360 Samsung drive (TS-H943, MS28) on a GA-MA69G-S3H using the on-board ATI SB600 SATA2 controller.

I did this using JungleFlasher and iXtreme 1.6 with the half-open drive door trick.

At the beginning I have tried most of the DOS flash disk methods with iPrep and XtremeBootMaker but with no success. In all cases the drive was found and recognized, but i got stuck at the 0x51 status and couldn’t get it to start reading. (the power off/on trick, nor the doors open trick) I went for the DOS boot methods because i had linux on my computer, and had no access to XP, but just when I was about to give up and buy a VIA SATA card i thought I’d give it a try with XP and see what happens.

I can safely say that I am glad I did so.. Here is how the flashing went:

1. I set the BIOS Sata settings to NativeIDE.
2. I have powered the Samsung drive with the XBOX and plugged the Sata cable into SATA0 on the motherboard (and placed the Xbox on top of the PC so the grounds are common)
3. I went into xp and installed the driver and restarted. (Made sure the xbox drive is recognized in BIOS)
4. I’ve popped out my DVD door and held it down with my hand so it wouldn’t close. (after a while the drive gave up on trying to close it)
5. I’ve uploaded firmware iXtreme 1.6 to the firmware folder of jungle flasher
6. I’ve started up JungleFlasher and went for SammyUnlock
7. It recognized the drive, and after 2 attempts of closing / opening the bay door i got a status read
8. Then i dumped the old firmware and saved it to 2 different locations (made sure I’d have it secured for future, I might want to reset to the original fw)
9. I followed the onscreen instructions and got to the part where i should have saved the firmware. At this point I noticed that the two keys did not match, one was full of zeros, so i aborted and did the whole reading all over again. (THE 2 KEYS MUST MATCH)
10. I saved the hacked firmware, and went back to the DVD screen and wrote(flashed) it to the drive.

At the end i got the “Writing ok” message and everything was nice and cool from there. I’m just writing this down so people would know that you can flash an ms28 drive using SB600. In the documentations I only found references that said that supposedly only VIA cards work.

Dell Vostro 1700 with GeForce 8600M GT Review

I have been using a Dell Vostro 1700 for 1 year now, so I thought I’d share some info about it.

Processor: Core2Duo T9300 @ 2.5Ghz on 32W, 6Mb L2 cache, 800Mhz FSB

Memory: 4Gb

Graphics Card: nVidia GeForce 8600M GT 256Mb DDR2 @20W

Graphics card Memory Clock: 800/475Mhz, Shader Clock: 950Mhz (32)

Monitor: 17.2” Samsung/Seiko Epson SEC 3258

I bought this machine for gaming and work. It has great feature sets to do these tasks, but not too brilliant when it comes to mobility. It features a heavy chassis and heavy battery.

Mobility:

This machine weighs a ton. It is very heavy because of the big screen, heavy magnesium alloy chassis and batteries. It is hard to carry around and requires a BIG case. Since it has a huge monitor and a very power hungry graphics card it eats up the battery very fast. My machine gets an autonomy of about 2 hours with a 6Cell battery using the Dell power profile, and in power saver mode with low back-lighting I can get out a maximum of 3 hours tops.

However it is a rugged machine and most screws are held in metal instead of plastic, so you get the idea.

Work usage:

I am a programmer and I run a lot of heavy processing environments like J2EE with such IDE-s running as Eclipse and Netbeans. I sometimes peak both memory and processor usage, but this configuration doesn’t really slow down nor hang or swap. It runs everything smoothly and quickly becomes responsive when coming back from stand by.

In power saver mode there is some lag coming both from processor and powered down hard disks, but it’s bearable. I rarely turn it off, I just go on stand-by all the time.(standBy drowns the battery! so make sure the charger is plugged in)

I run Vista. I also used Ubuntu and LinuxMint for a while, ran fine, but power management was not really supported.

Gaming:

Here comes the main reason I write this article. This rig is great for gaming. It runs most games just fine including newer ones. Sometimes you need to tweak the options since it wont really run everything in high detail, but if you find a balance between resolution and video features you should have no problems.

It features a descent Class 2 graphics card. http://www.notebookcheck.net/NVIDIA-GeForce-8600M-GT.3986.0.html

Heat: the heat dispersion is great on this unit. My temperature sensor usually shows 40-45 C in normal usage. Peaks slightly around 55-58 C when running games, but it rarely reaches 60 C.

There is plenty room for overclocking but I didnt feel I need to commit to that. Especially in Crysis you will notice that a small overclock of just a few Mhz on the shader and memory clocks will result in very visible increase in framerate.

This laptop is a definite go if you’re a gamer and want to play serious games on it. However if you have the money try to go for a Class 1 graphics card like the Quadro3700M.

This laptop does NOT feature MXM, so you are stuck with the stock graphics card.

I use most DELL drivers on the system, but for video I recomend the updated driver found here: http://laptopvideo2go.com/

These drivers are hacked from the official driver releases from nVidia and updated much more often then the DELL drivers. Getting an updated driver results in HUGE visible performance increase.

For example: Crysis would barely run with the stock DELL drivers, and after the update from laptopvideo2go it ran perfectly. Same with BioShock!

C64 keyboard in Arduino using multiplexers

I just bought a bunch of low cost 4051 analog multiplexers for use with my Arduino. I am working on a MIDI controller so I will need a lot of input both digital and analogical ones, so the multiplexers will come in handy to do analog reading using as few of the analog pins as possible.

As a first test I tried an adapter for a C64 keyboard, which has all keys placed in a 8×8 matrix of buttons.

The idea came from arduino playground where they explain the usage of multiplexers. The following image fits the c64 keyboard like a glove, so just go ahead and build the one on the right.

Link to more details: http://www.arduino.cc/playground/Learning/4051

Here is my solution. It’s the same circuit only on a perforated board. If you have the skills to make PCB-s, I really suggest to doing so.

And now for the code:

int v=0;

void setup() {
Serial.begin(9600);
Serial.print(“Hello”);
pinMode(2,OUTPUT);
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);
pinMode(13,INPUT);

}

byte bin[] = {
0,1,10,11,100,101,110,111};

int readKeyboard() {
int i,j,row,col,v, code;
byte r0,r1,r2;

code=0;
for(i=0;i<8;i++) {
for(j=0;j<8;j++) {
code++;
// address X
row = bin[j];
r0 = row & 0x01;
r1 = (row>>1) & 0x01;
r2 = (row>>2) & 0x01;
digitalWrite(2, r0);
digitalWrite(3, r1);
digitalWrite(4, r2);
// address Y
col = bin[i];
r0 = col & 0x01;
r1 = (col>>1) & 0x01;
r2 = (col>>2) & 0x01;
digitalWrite(5, r0);
digitalWrite(6, r1);
digitalWrite(7, r2);

// Read the actual Value
v = digitalRead(13);

/*
Serial.print(“(“);
Serial.print(j);
Serial.print(“:”);
Serial.print(i);
Serial.print(“)-“);
Serial.println(v);
*/

if(v==LOW) {
// instead of returning, you may use a buffer or whatever to keep track of all pressed keys
return code;
}
}
}
}

void loop() {
v = readKeyboard();
if(v>0) {
Serial.println(v);
}

delay(100);
}

Notes: make sure you click the SerialMonitor so you see some output. The above code will output the number of the key pressed.
For more information concerning the keyboard layout of the c64 here is a schematic of the key matrix.

(click the image to enlarge)

Hands-on experience with arduino

I just got my Arduino last week, and although this is my first intro into electronics so I was very excited to get it and try out new things.

Why i liked Arduino a LOT:
– it lets me code in java (using the Processing IDE) and deploy my IO code directly onto the device through an USB cable
– You can program it to handle various kinds of serial devices, and has out-of-the box support and great tutorials for some of them right on http://www.arduino.cc
– You have 6 analog pins which lets you play around with analog stuff like sensors
– For beginners: it quickly lets you play around with leds 🙂 *blinky*
– A lot of support for various hardware and a great forum to figure out how to connect your devices or interface with some requiring additional circuitry

What i miss:
– You cannot make Arduino become an USB host for various technical reasons, excepting a limited range of hardware which can be converted to serial, so some of my wild dreams where killed right here
– With the standard Arduino (Duemillanove) you cannot communicate to more then one serial device at a time (Only one RX pin) so you can’t really connect a Keyboard and a midi IN/OUT interface and so forth without additional electronics (like switching devices on a PIN so you can separate interrupts)
It would be great to have something like this built onto the motherboard by default. My example would be if one wants to create a small usable midi controller (THRU) he will need IN and OUT so it can be added to the midi chain of synths and controllers.

(my private stash)

So here are my Arduinos:

1. original bought from http://www.robotop.ro
2. My etched version
3. The famous breadboard version

What I am trying to accomplish now is to interface two low cost arduinos based on the Atmega8 chip to multiply the IO operations one board can handle using just a few of the digital pins. My ultimate goal is to build a nice sequencer with MIDI In/Out/Thru using Arduino.

My first etched version in detail (Atmega8 with Ghetto programmer)

My first etched version in detail (Atmega8 with Ghetto programmer)

Knobs on my sequencer to-be RetroKing

Mechanical encoder (clicky) on RetroKing

x

My hack of the day: an Infrared remote for XBMC / Debian

I now have xbmc installed on my server, which is plugged into my monitor via a looong extension cable. Having a wireless mouse for controlling used to be OK, but it got kind of annoying to find a flat surface every time you wanted to pause the movie or browse through directories.

So I thought it would be nice to attach an IR pickup and preferably use the unused buttons of my Samsung T240HD TV’s remote. When in PC monitor mode, the TV does not use it’s directional keys, OK, Escape and none of the Colored buttons, so mapping these would be perfect.

To use IR you need two things: 1. an InfraRed receiver and 2. some software to go with it. In my case I did not have a nice usb IrDA, so I had to make my own. Luckily it’s quite simple. All you need is and infrared pickup diode(old tv or whatever) and +5V to power it. The computer will pick up the signals via your computer’s audio line-in port. You simply build this contraption and hook it up to you line-inport: http://lirc.org/ir-audio.html

You can get +5V from any of your power connectors, if you have a multimeter make sure you have the correct tension before connecting everything to your sound card.

When everything is done, you can test it by enabling the Line-In playback on your PC and pressing some buttons. If everything is set up correctly you will hear strange noises when the IR receiver picks up any signals.

Now for the fun part: using LIRC to map unknown IR signals to keyboard events.

1. Install LIRC using aptitude or whatever, and make sure the programs irrecord and irxevent are installed.

2. You need to start up irrecord so you can test your connection and records some IR events.(i have mi input on the right channel of the sound input, depending on how you’ve set up your rig yours mith use the l parameter)

irrecord –driver audio_alsa –device hw@44100,r myConfigFileToBe

This will fire up irrecord and you can name your buttons after each successful read. You will also get a new config file which contains the codes of your remote.

Once this is done, it is time to test it:

1. Run the lirc daemon

lircd –driver audio_alsa –device hw@44100,r pathToYourConfigFileThatWasJustCreated

2. run irw

irw

When you push buttons on your remote, irx will look them up in your config file and display the appropriate events.

All we need now is to map this input to keyboard events. You do this by using a program called irxevent. Once the lirc daemon is running, you can start irxevent by supplying a config file which contains the mappings: you need to create this file manually!

Create a blank text file, and enter any number of mappings in the following form:

begin
prog = irxevent
button = YOURBUTTONNAMEFROMLIRCCONFIG
config = Key Page_Up CurrentWindow
end

begin
prog = irxevent
button = InfraOkButton
config = Key Enter CurrentWindow
end

and so forth…

When you are done, lunch irxevent like this

irxevent yourEventConfigFileName

Now test it: press some IR buttons and see if the keyboard events are fired.

From here, i just lunch XBMC and everything is working fine. (Note that XBMC does have support for lirc directly, you can use that aswell)

How to build XBMC in Debian (etch)

After many long hours of forum sweeping and googleing I finally managed to build XBMC in Debian. It took me exactly 18 hours to do this starting from scratch. (final build after satisfying all perquisites took about 3 hours)

Yes, it is possible to build and run XBMC in Debian without too much hassle.

Why: I have a linux machine running a server environment for my files, and I thought it would be nice to use it as a media center since it is always on. Since it is al set up i did not want to install an ubuntu on it just for the media center, so I had to build XBMC for Debian (etch)  from the sources. Unfortunately Debian is not yet supported by XBMC community, but you can obtain the source code and build it anyway. Here is what i did. (I am in no way a linux wiz, so this is probably not the best way to build it, but it should work)

My configuration: AMD K7 1300 Mhz, 768Mb RAM, GeForce MX440 SE using Debiean (etch) with Kernel Image 2.6.18-6-k7

Step 1 – Get the source code

(assuming you are root and are in your home folder)

(if you don’t have subversion installed: apt-get install subversion )

Step 2 – Install the required packages

Add the backports to your /etc/apt/sources.list

Edit the /etc/apt/sources.list and add contrib and non-free
Install graphics driver so when you run glxinfo you should see Direct rendering enabled.

Now install these packages.

I did my build by excluding faac and pulse audio.

This command will most likely FAIL at the first time you try it, so just get rid of the packages which are not found, and use a tool like aptitude to search for different naming. (lib in front of the name, and/or -dev at the end) My environment is very messy, so I am not sure which ones I had from different sources. Try running ./configure –disable-faac from your XBMC sources directory, and it will complain about what you are missing from the environment.

Step 3 – Configure script

Change to your sources directory and run the ./configure script. (for me it is linuxport/XBMC/)
If ./configure finished successfully you should try to run make
If your lucky enough it might run, but I had several issues with it.

For me the first fix was to re-run configure with disabled PulseAudio and faac.

Step 4 – Editing and running the makefile

From this point my serious issues started, I will list a few which i had, if you are lucky and make finishes successfully, you may skip this section 🙂

The sqlite3_prepare_v2() issue
I got a missing function error here, so i changed the line of code in question(in the file the error was coming from).

Changed the function name sqlite3_prepare_v2 to sqlite3_prepare

I guess my sqlite libraries are old, you might try updating yours.

The CPulseAudioDirectSound issue

I got an error in the file “AudioRendererFactory.cpp” in line 64 related to CPulseAudioDirectSound not being found. This was strange because i explicitly disabled Pulseaudio. I just commented out both lines of code in this section. (lines 64 and 65)

The smbclient issue

This was a strange issue, i don’t know why xbmc-s internal smbclient library does not work. In any case, I’ve installed smbclient via: apt-get install smbclient smbclient-dev

And edited the Makefile like this:

Find something like: OBJSXBMC += \
continued by path to libsmbclient-i486-linux.a, should be around line 314 and 315, and enclose it in /* .. */ block. (comment it out)

Next look for the LIBS=… line (around line 85) which contains all libraries and append: -lsmbclient to it’s end.

The xrandr.c issues
All of these can be solved by upgrading your libxrandr packages. I did this by manually fetching the files and requirements from the debian packages list. Etch has xrandr 1.1.0 i think, and xbmc requires at least 1.2.3

http://packages.debian.org/lenny/libxrandr-dev

You can get the deb file here and try to install it by: dpkg -i PACKAGENAME.DEB (it will tell you what it’s missing, and follow the links on the debian page, you will find them there. Get those packages, and install them the same way, then retry installing xrandr package)

Step 5 – Make Install

Once make has completed successfully (will take a few hours on slower machines) you can install xbmc.

Step 6 – Run and enjoy

Once you installed run it by typing “xbmc” in your terminal.

————————————–

I will try to keep this list updated as comments roll in with problems and solutions.

Have fun using XBMC, and thank the guys and babes at xbmc.org for making such a cool software.