Monday, November 26, 2012

MOTU 882 MK2 Mic Preamp Input

Today I disassembled a MOTU 882 MK2 Audio Interface that exhibited significantly increased noise on one of the microphone preamplifier inputs. While I had the unit open, I made this quick sketch of the input circuitry:

From chris' blog


From chris' blog


Interestingly the MOTU does not use a specialized microphone amplifier (such as the SSM2019 for example) but the standard instrumentation amplifier layout known since the dark ages, built from a NJM2068 dual opamp.

The next funny thing to notice: MOTU put a bridge rectifier on top of the SMD opamp (which has been removed in the photograph, it's normally sitting in the four holes on the corner of the small IC). It's protecting the amplifier from voltage swings out of the V- to V+ range. It's also missing from the hand-drawn schematic, it's on the positive inputs to the left opamp. In the end it turned out that this bridge rectifier was the cause of the increased noise. I replaced it with Z-diodes altogether, and now both channels (the unmodified one, and this one) show exactly the same (good) noise-spectra.

Monday, November 19, 2012

ligthdm: custom app on login screen

It's not rocket science, but it took me a while to collect all the pieces, so here's a short summary, mainly to serve as a reminder to myself: I need the IP address of a computer displayed on the login-screen (using lightdm), because every day it gets a different dynamic IP address and I want to login over the network, and logging in on the console just to type ifconfig (or ip addr) is cumbersome. No, it's not in DNS. No, using mdns/avahi doesn't work either in this particular instance. It's a laptop sitting just next to me on my desk.

So, without further adue:

  • install conky
  • in /etc/lightdm/lightdm.conf:
    greeter-setup-script=/etc/lightdm/greeter-setup.sh
  • in /etc/lightdm/greeter-conky.conf
    (...)
    xftfont Ubuntu Mono:size=18
    (...)
    TEXT
    (...)
    eth0: ${addr eth0}, eth1: ${addr eth1}

From chris' blog

Tuesday, November 13, 2012

RANT: complications of converting a picture to a pdf...

I just spent about one hour looking for a small tool (i.e. NOT starting libreoffice and putting a picture on a empty page, export as pdf) that will preserve resolution and geometrical size of a scanned-in bitmap and put it centered on a blank (A4-paper) page.

I assume that for every permutations of {'png','jpg','tiff','bmp','xpm',...},{'to','2'},'ps' there will be some tool in Ubuntu's repository, but they all seem to...
  • mess with the aspect ratio
  • either assume some fixed input resolution (ImageMagick's convert, for example) which gives you tiny, tiny, tiny output pdf-files (I could not reproduce the calculations it does) or correctly sized pages with the image enlarged until it fits border-to-border
  • re-sample the image so that the output file is huge, and image quality sucks.
But today, I finally found the small python script again I've written back in 2007, used through most of my university time (for scanning in travel invoices, notes, ...) and which still works \o/ . It's not a very pretty tool, but hey, at least it does what's advertized!
Have fun with it, in case you have to send in your Arbeitsunfähigkeitsbescheinigung like myself, being sick and getting MENTAL BECAUSE OF ALL THESE USELESS TOOLS one has to keep up with.

Wednesday, November 07, 2012

80C51P32

Found this ancient (well... almost, it's from about 1982) chip at work. It's a development version for applications where a mask-programmed 80C51 will ultimately be used, and you therefore don't have means to plug in separate ROM chips onto your circuit board:

As long as you are working on the software, you can burn it into (erasable, changeable) PROMs that get plugged into the piggyback-socket on top of the 80C51Px. Once you've finalized your code, you'll use OTP (one-time-programmable) or mask- (factory-)programmed chips that are, of course, much cheaper. The chip has pins in standard DIL-40 layout on the bottom, the piggyback sockets on top are also standard DIL-28 spacing.

From chris' blog


Interestingly, while this chip family is as old as rocks, software-compatible parts with much higher performance are still being produced, e.g. by Silabs.

Sunday, October 07, 2012

Legacy X background

I know that you missed it since the day Xorg switched to an all-black default background.

 $ xsetroot -fg black -bg white \
   -bitmap /usr/include/X11/bitmaps/root_weave



Saturday, October 06, 2012

German iBook G4 Keyboard

I currently have a iBook-G4 on my desk, running Linux. Everything is dandy, only a few things with the keyboard are odd. Two keys are swapped: “°^” (to the left of the number 1-key on a German keyboard) and “<>” (to the left of “Y” on a German keyboard)". And the right ALT key seems to be mapped to the “Enter” function. I got it running after messing around with the Xorg xkb settings (which is a nightmare, btw.) but it is clear that the problem is somewhere deeper.

There’s some serious mapping error for this keyboard in the kernel’s table stored in adbhid.c.

Key ADB Code Key is… Key should…
<> 0x32 KEY_GRAVE KEY_102ND
°^ 0x0a KEY_102ND KEY_GRAVE
R-Alt 0x34 KEY_KPENTER KEY_RIGHTALT

Here’s a patch that makes this keyboard behave:

$ cat ~/adbhid_c.patch
--- ./drivers/macintosh/adbhid.c.orig   2012-10-06 15:52:16.032673677 +0200
+++ ./drivers/macintosh/adbhid.c        2012-10-06 16:23:23.708911092 +0200
@@ -798,7 +798,7 @@

                memcpy(hid->keycode, adb_to_linux_keycodes, sizeof(adb_to_linux_keycodes));

-               printk(KERN_INFO "Detected ADB keyboard, type ");
+               printk(KERN_INFO "Detected ADB keyboard, type (%x) ",original_handler_id);
                switch (original_handler_id) {
                default:
                        printk("<unknown>.\n");
@@ -807,11 +807,19 @@

                case 0x01: case 0x02: case 0x03: case 0x06: case 0x08:
                case 0x0C: case 0x10: case 0x18: case 0x1B: case 0x1C:
-               case 0xC0: case 0xC3: case 0xC6:
+               case 0xC0: case 0xC6:
                        printk("ANSI.\n");
                        input_dev->id.version = ADB_KEYBOARD_ANSI;
                        break;

+               case 0xC3:
+                       printk("ANSI (iBook G4 German).\n");
+                       input_dev->id.version = ADB_KEYBOARD_ANSI;
+                       hid->keycode[0x32] = KEY_102ND; /* German: left of Y, less/greater */
+                       hid->keycode[0x0a] = KEY_GRAVE; /* German: left of 1 */
+                       hid->keycode[0x34] = KEY_RIGHTALT;
+                       break;
+
                case 0x04: case 0x05: case 0x07: case 0x09: case 0x0D:
                case 0x11: case 0x14: case 0x19: case 0x1D: case 0xC1:
                case 0xC4: case 0xC7:

Thursday, October 04, 2012

Facts about my Dishwasher

Things I learnt about my dishwasher today:

  • It has a Mitsubishi M38503M4-722FP micro controller with 512 byte RAM and 16kByte of mask-programmable ROM, which, frankly, is quite a lot for doing the dishes.
  • There is a debug-connector with serial port Tx/Rx, GND and Vcc on the side of the controller PCB, but there's no signal on the pins it because apparently the controller is broken.
  • It has probably be killed by overvoltage, more precisely by the kind overvoltage that also made the (I assume) 7805 on the other PCB explode violently.
  • 7805 tend to explode violently if a power-relay next to it shorts, and burns through half of the PCB, and I assume it did so with a ball of conducting gas or plasma generated under the relay, feeding 230V AC to what previously was a +5V Vcc line.
  • PCBs that short and burn through half of the material make the whole kitchen stink like burnt electronics.
  • I think need a new controller for my dishwasher.









Sunday, September 16, 2012

Just download 8 GB and you are set...

Hey, Xilinx. Thanks for giving out your FPGA development environment for free (as in beer) and all... but seriously WTF: Since I downloaded it the last time (about a year ago), the size of the download increased from 4GB to 8GB?! Moores law in full effect?


(note: I still have only 2MBit DSL around here)

Furthermore: They send you a (uncompressed) .tar, which includes xz-compressed .zip archives.

$ tar tf Xilinx_ISE_DS_14.2_P.28xd.3.0.tar
Xilinx_ISE_DS_14.2_P.28xd.3.0/
Xilinx_ISE_DS_14.2_P.28xd.3.0/idata/
Xilinx_ISE_DS_14.2_P.28xd.3.0/idata/ise_0090.zip.xz
Xilinx_ISE_DS_14.2_P.28xd.3.0/idata/dsp_tools_0006.zip.xz
(...)


Saturday, September 08, 2012

Cobalt RaQ3 Frontpanel

To replace my current network router, I'm planning to maybe put a Raspberry Pi in the case of a Cobalt RaQ I have standing around since half a eternity.

Don't ask me why, but I spent way too much time (~8 hours) chasing the pinout of the RaQ and putting the awful lot of pins to a Arduino I often use for prototyping. Now I can write to the LCD, monitor button presses and let the LED blink. Because that's the most important thing for a router to do, in a closed network-rack, in the cellar, where the central heating is sitting. And none ever goes to look. Enough for today, I'll most likely put it back in the box I got it from, so that the project can be continued 2014 :-(.

Code is at github.

From chris' blog

From chris' blog

Friday, August 17, 2012

Salad

Hey, Markus, I can foodblog, too.


Wednesday, June 13, 2012

LInux Kernel grieving...


Sometimes kernel-development happens at the pace of glacial advance... Here's an example:

This kernel patch, which makes a FastTrack Pro audio interface work in 24bit/96khz mode was already floating around in different forms about the time I bought this device in 2007, the existence of this patch  made me think that it will be well-supported soon, and it was one of the main reasons why I had chosen this hardware in the first place.

But as it never found its way into the regular ALSA, despite being put into bug-/feature-reports, a few wikis about audio under Linux and mailed to the alsa-maintainers, I had given up on ever seeing it merged into the mainline kernel.

But the unbelievable thing has happened: I just noticed that it has indeed found its way into the Linux kernel about 11 months ago.

Note to self: Put this in /etc/modprobe.d/my-alsa-config.conf:

options snd_usb_audio index=1 vid=0x0763 pid=0x2012 device_setup=0x09

Friday, June 08, 2012

The loundspeaker, it hums!

I’m currently on a shopping-spree on eBay. There are certain categories of slightly outdated equipment that frequently contain amazing things almost for free… The latest evidence for this is presented below.

When sitting in my bureau/lab/workshop in the basement, I usually listen to music on small passive loudspeakers fed by a tiny 2x 22W amplifier, and I was always annoyed that sound had almost no bass… Those times are over now, or so it seems.

I recently acquired a 12” Subwoofer basically for free on the ‘bay and now finally had the time to close the big hole left from the missing active amplifier and crossover module with a piece of MDF. The good thing is that mechanically the subwoofer is absolutely pristine, short of a very small bent on the metal front grill.

IMG_2514IMG_2516

(the cover will be painted black and supplied with a proper Speakon connector soon, maybe in 2015 Winking smile)

Fed from a Delta44 Soundcard (ebay, 1€) through a dual LM3886 amplifier module (bought, again, for almost no money from ‘bay in 2009…) and crossover functionality supplied by Francois Bourdon’s excellent crossover plugin (when listening to music on Windows) everything sounds absolutely stunning. I’ll try the corresponding recipe for pulseaudio soon.

IMG_2515

(LM3886 “Gainclone” Amplifier)

Saturday, June 02, 2012

Holidays (again)

Holidays, and unfortunately picasaweb does not allow me to upload these panoramic pictures :-(, so off to ipernity it goes...



Friday, June 01, 2012

Holidays…

IMG_1863_stitch

(artefact on the upper left is due to me adding a “filler” photo shot from a slightly different position…)

Saturday, February 18, 2012

New Webcam

Just don’t ask why. I got myself a new video camera! (Previously)

vlcsnap-2012-02-18-15h49m18s164vlcsnap-2012-02-18-15h53m50s77

Saturday, December 17, 2011

Erasing a FEZ Panda using the serial port

I bought a FEZ Panda to play around with the NXP LPC2387, and at 32€, it's a rather cheap development platform. Furthermore it has all pins brought out on convenient pads, unlike other "Arduino compatible" alternatives that only connect the usual four connector blocks.

The LPC2387 on the FEZ Panda is preprogrammed with a bootloader from GHI electronics as it's intended to be used with the Microsoft.NET embedded (or something) framework. It also has the JTAG port disabled, so the first thing I have to do is to get rid of bootloader and clear the chip. Helpfully, GHI provide a special firmware that erases the whole chip and removes all memory protections. You can currently get the file "USBizi_ERASE.zip" in from a directory on GHIs servers.

Steps to erase the FEZ Panda


The steps here are actually described in GHI's document Beginner's Guide to porting .NETMF, but I I'll summarize the steps as executed on a Linux machine:

Obtain USBizi_ERASE.zip and unpack. You'll have to install the cu terminal emulator and the lrzsz x/y/z-modem protocol. Then write a short script (see below) to send "X" and then the included USBizi_ERASE.GHI via xmodem-1k-crc16. Connect the first UART of the FEZ-Panda to a suitable 3.3v CMOS serial port (e.g. a ft232 usb to serial module). Connect the MODE pin on the unpopulated pads on the short edge of the PCB opposing the USB/Power connector side to GND. Press the reset-button marked RST while holding the LDR button next to it.

In the serial terminal, you should see the BL prompt of the bootloader, start the script to send "X" followed by the xmodem-upload, then wait for the included software to erase the board.

[distress /home/chris/Downloads]
$ cat erase.sh 
#!/bin/sh

echo -n "X"
sx -k -o -vv USBizi_ERASE/USBizi_ERASE.GHI

[distress /home/chris/Downloads]
$ cu -l ttyUSB0 -s 115200
BL
BL
BL
BL
~+./erase.sh
Sending ./erase.ghi, 2696 blocks: Give your local XMODEM receive command now.
Bytes Sent: 345088   BPS:9933                            

Transfer complete

File Transfer Finished Successfully
USBizi
Version: 4.1.5.0
Debug: COM1
LCD: 0x0
IP: 0.0.0.0
MAC: 00.00.00.00.00.00
Managed heap size: 64412
Custom heap size: 0
~?çƄ

Now the USBizi is erased and the "usual" LPC bootloader takes over on the serial port, at 9600 bits per second:

[distress /home/chris/Downloads]
$ cu -l ttyUSB0 -s 9600
Connected.
Synchronized

JTAG now works:

[atrocity /home/chris/openocd]
$ openocd 
Open On-Chip Debugger 0.3.1 (2010-01-18-18:43)
$URL$
For bug reports, read
 http://openocd.berlios.de/doc/doxygen/bugs.html
parport port = 0
OLD SYNTAX: DEPRECATED - use jtag_khz, not jtag_speed
jtag_speed: 2
Error: Translation from jtag_speed to khz not implemented
Info : interface specific clock speed value 2
Info : JTAG tap: lpc2387.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787, part: 0xf1f0, ver: 0x4)
Info : Embedded ICE version 7
Error: EmbeddedICE v7 handling might be broken



Saturday, December 10, 2011

HP82240A RedEye on Arduino Duemilanove

A long time ago I had played with my old HP 82240A printer, but unfortunately I somehow misplaced the software I wrote back then. So I re-wrote it, you can get it on github. This time it's written for a Atmel AVR ATMEGA328P as used on the Arduino Duemilanove because this little board makes prototyping so very convenient.
From chris' blog

Sunday, October 23, 2011

Synology Cubestation CS407 - Boot Log

Just for reference: Booting up a CS407, this is what you can see on the serial port (jumper block near the SATA connectors, 2=GND, 4=Tx, 6=Rx):
$ cu -l ttyUSB0 -s115200
Connected.

         __  __                      _ _
        |  \/  | __ _ _ ____   _____| | |
        | |\/| |/ _` | '__\ \ / / _ \ | |
        | |  | | (_| | |   \ V /  __/ | |
        |_|  |_|\__,_|_|    \_/ \___|_|_|
 _   _     ____              _
| | | |   | __ )  ___   ___ | |_ 
| | | |___|  _ \ / _ \ / _ \| __| 
| |_| |___| |_) | (_) | (_) | |_ 
 \___/    |____/ \___/ \___/ \__|  ** LOADER **
 ** MARVELL BOARD: Synology Disk Station LE 

U-Boot 1.1.1 (Jan 18 2007 - 12:01:00) Marvell version: 1.11.2

DRAM CS[0] base 0x00000000   size 128MB 
DRAM Total size 128MB 
[4096kB@ffc00000] Flash:  4 MB
Addresses 20M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (20M - 16M): Done
*** Warning - bad CRC, using default environment


Soc: 88F5281 D0
CPU: ARM926 (Rev 0) running @ 500Mhz 
Orion 2 streaming disabled 
VFP initialized to Run Fast Mode.
SysClock = 166Mhz , TClock = 166Mhz 


Model: CS-407
CPLD version: 0x0
FAN Status: Running

USB 0: host mode
CPU: Write allocate enabled
Net:   egiga0 [PRIME]
Press Ctrl+C to abort autoboot in 1 second
## Booting image at ffc00000 ...
   Image Name:   Linux-2.6.15
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1450556 Bytes =  1.4 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK
## Loading Ramdisk Image at ffe00000 ...
   Image Name:   synology_88f5281_cs407 1354
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    810453 Bytes = 791.5 kB
   Load Address: 00800000
   Entry Point:  00800000
   Verifying Checksum ... OK

Starting kernel ...

Uncompressing Linux............................................................................................. done, booting the kernel.
Linux version 2.6.15 (root@image15) (gcc version 3.4.3 (CSL 2005Q1B) (Marvell 2006Q3)) #1354 Sat Oct 23 01:49:30 CST 2010                 
CPU: ARM926EJ-Sid(wb) [41069260] revision 0 (ARMv5TEJ)                                                                   
Machine: MV-88fxx81                                   
Using UBoot passing parameters structure
Sys Clk = 166666667, Tclk = 166666667   
Synology Hareware Version: DS407v10  
Memory policy: ECC disabled, Data cache writeback
CPU0: D VIVT write-back cache                    
CPU0: I cache: 32768 bytes, associativity 1, 32 byte lines, 1024 sets
CPU0: D cache: 32768 bytes, associativity 4, 32 byte lines, 256 sets 
Built 1 zonelists                                                   
Kernel command line: console=ttyS0,115200 ip=off initrd=0x00800040,4M root=/dev/md0 rw syno_hw_version=DS407v10
PID hash table entries: 1024 (order: 10, 16384 bytes)                                                          
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)  
Memory: 128MB = 128MB total                                  
Memory: 122452KB available (2400K code, 594K data, 108K init)
Mount-cache hash table entries: 512                          
CPU: Testing write buffer coherency: ok
checking if image is initramfs...it isn't (no cpio magic); looks like an initrd
Freeing initrd memory: 4096K                                                   
NET: Registered protocol family 16
                                  
CPU Interface
-------------
SDRAM_CS0 ....base 00000000, size 128MB 
SDRAM_CS1 ....disable                   
SDRAM_CS2 ....disable
SDRAM_CS3 ....disable
PEX0_MEM ....base e0000000, size 128MB 
PEX0_IO ....base f2000000, size   1MB  
PCI0_MEM ....base e8000000, size 128MB 
PCI0_IO ....base f2100000, size   1MB  
INTER_REGS ....base f1000000, size   1MB 
DEVICE_CS0 ....base fa000000, size   2MB 
DEVICE_CS1 ....base f8000000, size  32MB 
DEVICE_CS2 ....base fa800000, size   1MB 
DEV_BOOCS ....base ffc00000, size   4MB  
Marvell USB EHCI Host controller #0: c0bf5c00
PCI: bus0: Fast back to back transfers disabled
PCI: bus1: Fast back to back transfers enabled 
SCSI subsystem initialized                    
use IDMA acceleration in copy to/from user buffers. used channels 2 and 3 
Done.                                                                     
VFS: Disk quotas dquot_6.5.1
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
Initializing Cryptographic API                            
io scheduler noop registered  
io scheduler anticipatory registered
io scheduler deadline registered    
io scheduler cfq registered     
Serial: 8250/16550 driver $Revision: 1.3 $ 2 ports, IRQ sharing disabled
serial8250: ttyS0 at MMIO 0x0 (irq = 3) is a 16550A                     
serial8250: ttyS1 at MMIO 0x0 (irq = 4) is a 16550A
RAMDISK driver initialized: 16 RAM disks of 65536K size 1024 blocksize
loop: loaded (max 8 devices)                                          
Marvell Gigabit Ethernet Driver 'egiga':
  o Ethernet descriptors in DRAM        
  o DRAM SW cache-coherency     
  o Checksum offload enabled
  o Loading network interface 'egiga0' as eth0
  o Radom MAC address 00:ef:af:c3:17:94       
                                       
PCI: enabling device 0000:00:01.0 (0140 -> 0143)
Delay 10 seconds to wait for disk 0 ready.   

Thunderbolt GPSDO PPS Signal

Years after I got my thunderbolt GPS controlled clock I finally managed to connect the precise pulse-per-second signal to my linux-based router and NTP-server.
From chris' blog
From chris' blog
From chris' blog

Sunday, October 02, 2011

Fire-Basket

Getting rid of the remaining (small, not really useable for anything) pieces of wood left over from the garden-shed project.

20111002_img_150520111002_img_150220111002_img_1501

(Update: Last pictures distorted by virtue of Microsoft Windows Live Writer ™ © ®…)