About

10/27/12

Bad DFrobot 2A Dual Controller

When it was time to mount find a place to mount the spacers to attach my new 2nd controller, I discover it's a defect one that is cleary thrown together in a hurry. I have mailed my retailer for a response :D

All the explainations are on the album on http://imgur.com/a/M1Uh4

The good news is that some guy on the sparkfun forum says i'm probably right on the wiring setup as long as the controllers can take the required 2.5A. These are rated for 2A but my retailer recommended me these. I have already ordered the Dagu board. When that arrives, I have other plans for these controllers. (Probably for eye/sensor array arms or grabbing mechanisms ?)





10/26/12

Setting up an Android development environment

Books to read

Apress, Beginning Android 4 (2012) - Comes with source code available here
Although it says it's for Android 4.0, the book uses 2.2 but also tells the reader how to adapt to frameworks you don't actually develop for. Very clear and informational, and had me writing code in just a few minutes.

Addison-Wesley, The Android Developers Cookbook (2011)
Has the same clear style as the above one, with simple XML snippets and the code to support just that. I don't like tech books that wants you to build a huge application, when all you needed was an explanation for how to use a certain GUI element on page 76.

Software to get

Decide if you want Eclipse SDK 3.8 or 4.2. The 4.x series will eventually be better, but 4.3 won't be out until June 2013. 4.2 has a new internal UI engine. Meanwhile, the 3.x series is more than sufficient and also very fast. I also  keep my OS on an SSD drive, and my development stuff on a RAID0 disk. That does help when you are dealing with large Java environments. 



Setting up the environment

Download Android SDK here. This is the toolkit needed to link Eclipse to you Android phone, or to start up an emulator. You can set most Androids up to push debug messages trough the USB. These messages will appear in the debug console in Eclipse. This is generally not needed during normal app development. If you look trough the log you will see hundreds of notices about battery state, memory and the likes.


From the SDK Manger, you can download the API's and tools you want to target for. Some of the API's for the more esoteric phones require that you have a login at their respective manufacturers development network. You can safely cancel the ones you cannot download.


In the AVD (Android Virtual Device) Manager, you set up virtual machines that emulate the platform you want to develop for.

You create the project in File->New->Other->Android Application Project.


Now, all you have to do is to make a Run-configuration for your Android project. 


If you got this far, you should pretty much be able to run a skeleton application on your own USB connected phone 

Hardware and specs

I use a Samsung Galaxy Xcover GTS5690 for development. That is pretty much an S2 stripped of a CPU core and has less memory and smaller screen (a 'medium' class screen in phone terms, 320x480 or 480x320 rotated). Some programs even identify it as an S2. This phone has 512MB RAM, single core Marvell ARMv7 @ 800Mhz and a Marvell GLES2.0 chip as well as some yet unknown hardware for video playback of some formats. I have a 8GB SDcard stuck in it as well. 

While not high end, a quick survey among friends suggest the 2.x series Androids will be around for a long time. Samsung is even still making BIOS updates to this phone as this were written, and a mid-end dev system could be a good exercise in resourse management. Many people out there has low-end older phones as well as mid-end ones.

Flexibility across devices

Android was written with the fact in mind that devices will be different, so it has built in flexibility to handle this. Some things can be done even better with minor effort from the developer, such as simply targeting for a higher level API will enable functionality for adapting to 4.x enhances features.

Targeting a 2.2 device would cover 93% of the market. It seems the 1.x series is pretty much obsolete. Also, the changes from the 2.x to the 3.x and 4.x series seems to be smaller compared to the leap that was from 1.x to 2.x. Not having developed on 1.x, I cannot say for sure, but telling from the literature, most of the features people were missing in 1.x got generously implemented in 2.x. 

Messing up is easy

It's really easy to mess up an Android project, so keep your CVS up and running.

Plans for dual controller Rover5

So this is how I plan to wire the 2x dual motor controllers. It might not work, still discussing this on forum.sparkfun.com. No one has replied yet :/


I am using two of these with an Uno, which should be fine since I'm not going to do step counting.

DFRobot 4.8-46V, 2A Dual Motor Controller

10/24/12

Update on Rover 5 project

Got some new wires, a "Helping Hand" and a 2A motor controller today. Which means I have the parts I need to get the Rover running on all 4 motors according to Robonor.no who recommended these two. I am going to need to get a some standoffs and screws to mount the Arduino and the two motor controllers. Here's some pic for today:
Rover5 with top plate mounted. I have no idea if i did this the right
way, but atleast it sits there. I have no idea how one are supposed to
get a servo motor in that hole, the battery pack is impossible to get
far enough down.

2A motor controller already hooked with the needed wires
Pan&tilt kit
Helping Hand, Comes prebuilt, very... handy..

Sortiment of screws and standoffs




10/21/12

Robot hobbyist laboratory

Heres's some pics of my new lab. Had to make a fitting space to build the robot !


Laptop dedicated to Arduino, with appropiate tools.
Multimeter, soldering, and about anything else need  to tinker!

Assembling Rover 5

Rover5 inside view, 6xAA battery pack and steppers



10/16/12

Sparkfun LCD 09351 and some LEDs


Hooked up the Sparkfun LCD. It is unflashed but for now it will have to do!

Some LED flashing too ;D

10/10/12

Arduino robot project

10/10/12


With the helpful guys at Robonor.no, I've ordered the following parts for my project:
Arrived in the mail today, UNO R3 from Robonor

Dagu 4 motor controller is on it's way from England!

I will eventually get the Rover5 4-engined robot, but as the Dagu controller card is hard to get, I have to put this on hold for a while. At the moment, I will have enough to do by going trough the basics! When the Rover is in place, I will get an Mega ADK board for my Android phone to utilize all the sensors.



I have ordered the Dagu controller from the UK along with an IR compund eye from RoboSavvy. I'll slip right under the 20 pound tax limit! This could take a cool 2 months 4 weeks though. (Seems he could speed it up a bit!?

Meanwhile,I'll get to program the Arduino controller and hooking up the LCD display.
Fun times!
Serial Enabled 16x2 LCD - Black on Green 5V

11/10/12


Got an old laptop from a friend for fixing his new one and installing games and a 'safe' browsing environment. Not too bad either, Dual core AMD Turion with 2 gigs and 256 mb shared gfx memory. Will probably install XP in this to use all the easily available Arduino tools, and run Linux in a VM to run electronics software.

Postal service reports that the package has been received and will probably end up here tomorrow afternoon :)

13/10/12



Picked up package today, everything was included as far as I can tell, except the 3-pin serial LCD, but i actually got a much better LCD with a mounted backpack, so this should be a serious upgrade! Thanks Robonor! Quick delivery too!


Graphic LCD Serial Backpack


Serial Graphic LCD 128x64

First testing footage

From the Circ-02 tutorial with 8 leds

Well, cannot complain, everything worked as expected!

14/10/12



Some connectors was badly soldered from the factory. Fixed that and now it should work. Pixels was all over the screen.



Some error in the manual it seems. It won't work from the 5.5v line, have to use Vin. Here you can see the Sparkfun icon!

Some software I probably need:
http://www.atmel.com/tools/AVR32STUDIO2_6.aspx



10/9/12

Rooting and modding Samsung Galaxy S2

If you just have to mess with your phone all the time and try out every option and setting, you'll probably have heard about replacing stock software with custom kernels and flashing in mods. This could expand battery life, give you new features and make your phone faster.

It can also render your latest phone investment as useful as a brick. Yeah, brick. That's what they call it when either you or some software you tried to run makes your phone shut down for good and it will never boot up again. So be warned, even though I am about to tell you how to possibly avoid it.

I DO NO TAKE RESPONSIBILITY FOR YOUR ACTIONS! YOUR PHONE IS YOUR OWN AND ANY OF THIS WILL VOID YOUR WARRANTY!

And don't try to be clever, the phone will tell your technician that you installed a custom binary. This feature is called the 'ROM counter'.


  • First of all, some phones are known to have a bad FLASH chip, and this includes most versions of the Samsung Galaxy S2, from what I can read. 
  • Personally I have the GT-I9100 which came with GingerBread 2.3.5. 
  • If you, like me, have Samsung Kies installed (if not, do that NOW) and updated the firmware, you will discover that GingerBread 2.3.5 will be updated to Ice Cream Sandwich 4.0.4.


At this point, download the following:


  • Siyah kernel - Will give you a temporary rooted phone. Get the correct version, and put it on your SD card.  (you do need an SD card)
  • ClockWorkRecoveryMod (aka CWM)


There is a particular problem that seems to come with the stock ICS 4.0.4 when you install the 'clockworkrecovery' mod. Therefore, first of all you need to root your phone to be able to actually check your phone. (with Siyah)



You also want the Google Apps extras


  1. At this point, you have to boot up into recovery mode, and wipe the phone and the cache. 
  2. Then, load this binary into the phone. 
  3. When it reboots, it will show you a yellow triangle below the Galaxy logo at bootup, and if you go to Settings->About Phone you will see that the kernel has been replaced. 
  4. If you forget to wipe the cache as well, the phone will not boot. (It is not bricked, just repeat the process.)


Then download an app called eMMC checker from the Play Store. Move CM and Google Apps over to the SDcard.


  1. Download eMMC Brickbug Check from Play Store
  2. Run check. It will probably say 'Insane chip: Yes' and then you must check the memory, for which you need to have the phone already rooted.
  3. If the memory check passes, your phone's flash chip is functioning well enough to flash the ROM, but it will still kill it of you skip to the CWM step now!


Note: Just to be clear, both the memory needs to be OK and the Siyah kernel must be installed or else you will have a dead phone before this tutorial is over.


  1. Boot phone into Recovery Mode. (Home + Vol Up + Power.
  2. Hold until logo appears, release keys.
  3. You will be presented with the recovery menu. Some phones has alternate combinations.

Lastly:


  1. Wipe and factory reset
  2. Wipe cache
  3. Install CM from SDcard
  4. Install Apps from SDcard
  5. Reboot phone


Now, when you reboot, the phone will be a completely different beast. Modded or not, the S2 and S3 are  formidable devices, featuring multi-core CPU and GPU processing, as well as standardized USB connectors, an array of special-purpose sensor chips and last, but not least, a Linux-based operating system to glue it all together. With the right add-ons installed, your phone is essentially a powerful hand-held computer that can be used for a multitude of uses. While the comparison  is not fair, I would guess an S2 outperforms 5 year old laptops.

I think this was everything. Please comment if I missed something.

Anyway, here's the result:







9/14/12

The new OPUS codec


I was reading a thread on Reddit about a new audio codec, and I was going to post a reply to someone who was wrong on the internet. People were talking like mp3 was going to disappear and Linux would have the year of the desktop, and I was going lash out at the naiveity, but the TFA and related sites are pretty clear on the actual purpose of this codec.

From boingboing's article:

"The IETF has finished its standardization effort for Opus, a new free/open audio codec that reportedly outperforms all other codecs on all axes."

Obviously wary about a huge claim like that, I had to dig a bit. From IETF's abstract:

"This document describes the Opus codec, designed for interactive speech and audio transmission over the Internet."

Audio enthusiast site HydrogenAudio does real testing of digitally treated audio and supposedly has demonstrated that all existing formats encoded at over 128kbps yield inconclusive results in double-blind testing and so OPUS is apparently untested in that area.

OPUS focuses on low latency in the 64-96kbps@48k range, which makes this a decent option for for large-scale network streaming, exactly like the project claims. Encoding one single stream at that quality is not even noticeable on modern CPU, and this codec is not primarily for high fidelity listening even though the authors claims it can be used for music up to 512kbps@48k. It's designed to deal with network latency and packet drops.

Now, what got me thinking was that since HA does not even test files over 128kbps, yet I have often been able to recognize them when I had higher qualities available.

I was wondering what kind of demography HA did this test on. Was it musicians, producers and the like or was it a random group? It matters because if you work a lot with sound and music, you will eventually be able to identify a low bitrate song

This post by IgorC on is interesting and got me questioning the testing procedure. They are operating with sample sizes around 30 and 40, which I think is small, and considering the facts about subjects IgorC points out, maybe the grounds for a claim to beat every other codec on the planet is a bit high at this time. Even the authors does not claim that their fresh 1.0.1 release competes with the best implementations of other codecs out there

Testing


A ~50MB .wav file (Metallica,'Figth Fire With Fire') was encoded to FLAC level 8 and it took 7 seconds with flac.exe trough Traders Little Helper.

Encoding the .wav to mp3 with 128kbps@44100 took 22.2 seconds with the latest VLC. For 48000khz, about 32 seconds. That is just the default settings, no encoder options. The output mp3 was about 4.5MB.

Using winLame 2010 with LAME 3.99 and "-V2 --vbr-new" took 7 seconds, and 10 with the best compression "-b 320 --cbr". The 7-second output mp3 was 11.1MB.

Then it was time to try out the OPUS encoder, which still is a CLI only app.

OPUS with default setting produced a file of 3.4MB running at 94kbps in 6 seconds.


Using OPUS with --bitrate 256 produced a 8.5MB file with 255.6kbps bitrate in 7 seconds.


That would be about the same speed as FLAC, if you can even compare these two, since FLAC produces lossless quality at nearly 1Mbit bitrate, nearly triple as much data troughput as OPUS.

I further tried --96, and --128 and they use the same amount of time, around 6-7 seconds.
Streaming

Using rtp via VLC, streaming the first 128kbps mp3 encoded from an instance of VLC to another on the same host takes between 0 to 1 % in the encoding thread, and you can't even tell that the playback thread uses CPU time.
The 11MB maximum-encoded mp3 file was then streamed, at almost the same CPU usage as the file nearly 1/3 as big. Occasional spikes to 2%, but mostly 0% and 1%.

I am inconclusive about streaming, since VLC doesn't support OPUS yet, but it seems to me that all three formats hoovers around 1% for decoding.

Conclusion


From these simple tests, I have to conclude that OPUS is much slower to encode than recent FLAC and LAME releases at the moment. LAME and FLAC used about 30% and 37% CPU respectively while encoding, but OPUS used around 24%.

Playing back the OPUS file using the official CLI tools showed that the process doesn't even cross 1% to decode. FooBar2000 added support already, and shows a 1-2% CPU usage.
If this new codec can help huge organizations save bandwidth and CPU cycles, then good for them. It's irrelevant to end users not trapped in ISDN-land, but it may be a cost-saver if you are big inside the streaming industry.

Ofcourse, it's always nice to have more royalty-free codecs, but mp3 will be around a lot longer. And just to be clear, OPUS has already gotten attention from patent trolls, although the project claims these threats are groundless.(Qualcom and Huawei)
Further reading about audio:

XIPH.org explains why it's no point in being audiophile.

8/13/12

Removing and installing Widcomm drivers



Trying to cut down on my heavy headset casualty record, I needed something wireless. I got Teknikmagasinet's custom BT500 headset. My 1-2 year old Targus Bluetooth USB mini dongle would not run handsfree audio correctly under the supplied Vista drivers. Even Windows 7 pointed me to new drivers available from Broadcom, so I downloaded these drivers. This software complains about old BlueTooth software already installed, only problem is there was no uninstaller. Uninstalling drivers from device manager did not do it. After some testing, I found this to work:

On another Win7 box:
  1. Disable automatic driver updates
  2. Insert dongle 
  3. Answer no to install WHQ drivers
  4. Wait until all the USB discovering is over... could take a minute or two. (does not depend on your computer speed!)
  5. Install SE software
  6. Answer yes to all drivers from here on
  7. I had to cancel and reinsert dongle during device verification
  8. Copy Users/User/Appdate/Widcomm/Software to target machine

On target machine:
  1. Repeat steps 1-4
  2. Install retail drivers
  3. Install software from other box

I ended up having an unknown defect device in the device manager but everything works. So it appears the old 64 bit drivers from Vista works, only the software itself needed to be upgraded. Choosing this approach was better than a system reinstall, and not even 1 hour in regedit would let me hack my way out of the Widcomm registry mess.

7/30/12

Recording studio box setup. (Updated)

This is a single core P4 2.39Ghz on an Intel board with a pretty standard SoundMax AC97 integrated audio, driving a secondary sound monitor.



It's centered around a EWS 88MT system (Digital 8 track recorder with external breakbox), PCI, used as main recording hardware. There's also two FireWire connectors on a PCI card I just added in case I would ever need it.


I have a ESP Ltd F200 guitar hooked to a Fender Mustang 1 guitar amp by USB in addition to regular cabling, of course. The only problem here is that the audio jack will be disabled when you connect the USB and fire up the Mustang software. So if you need the advanced amp settings, you need to store them locally on the amp it self. (Not true, I had some setup errors.) The only feature I miss from the Mustang is to be able to monitor the guitar trough the amp itself while also pushing the signal trough the jack out. (Which doubles as line out)

Also, a Creative Soundblaster Live! PCI card for driving a Sony Digital Amplifier (not pictured yet) for main monitoring.

EWS88MT front connectors

Overview

The Fender amp doesn't have a line out, but it has a phone jack which can be used.

Special cable resembling a parallell cable connects the breakbox to a PCI card. (bottom card)
It also has digital out/in jacks and a mini jack monitor output.

Drivers for the 88MT can be found at TerraTec's FTP server
There is drivers for Linux, 98->XP.
Supposedly the download for Phase88 (mixer app for the card) contains drivers that should work with Windows 7. (citation needed!)

This setup gave a very clear guitar recording. A very very slight hiss could be heard at times when I did not touch the guitar. Much better than onboard capturing that usually records PCI bus noise as well. I can't tell if the almost non-existing noise was from the amp or the computer I played it back at.


Installing a good digital amp reduced playback noise considerably as well. Initially I had a Nvidia GeForce FX 5500 card installed, but I decided to downgrade to the fanless 440MX card instead to further reduce system noise. I could also turn off both the NIC and onboard audio as well as other controllers if I wanted, but it seems pretty quiet now.

Only having one video monitor, I use Nvidia's virtual desktop to have separate desktops for recording, mixer panels, and so on. Also, I spent a good hour on setting the computer up for being mostly mouse driven. Added window autofocus, and had all studio applications pinned to the start menu, etc. This is pretty handy when you're still holding the guitar while needing to do something on the computer.

Applications used:


GNU Solfege, for ear training
Reaper for recording, has low latency, comprehensible UI and a good routing/monitoring interface
Audacity and CoolEdit for secondary editing. CoolEdit used to be my favourite (now Adobe Audition) but it did not play nice with my hardware this time)
VLC and FooBar2000 for media playback, will probably reinstall WinAmp again purely for the fact that it is the only application I know that rewinds on pressing the arrow keys. (Vital for my guitar practice)

This is now pretty much a self contained studio and could be moved around to do various recordings. It can to at least 8 tracks at once, though both the SoundBlaster and the integrated audio has more recording slots. The breakbox has one additional 9 pin mic as wel,l and it's card has two SPDIF's as well. All this at 16, 24 or 32 bits samples up to 96Khz. Seems most of the audio hardware and drivers are proper, since the CPU seems rather unaffected by activity in the audio applications.

5/20/12

Specs for my once planned 2007 gaming rig

So I found some notes in a worksheet about the first "Dual CPU" computer I was going to build. I thought I was going to laugh at the performance, but actually, it's a machine I'd actually rather still have! I wonder how many fully functional Tyan boards got dumped by companies :(

One option was the Tyan Thunder S2895A2NRF (image from NewEgg)
 K8WE Dual Core Opteron DDR400 SATAII Audio GbE LAN IEEE1394a USB2.0


Specs: Dual CPU, Single/Dual Core Opteron (Socket 940) 800Mhz HT, North Bridge: NVidia 2200 and 2050 as well as an AMD8131 memory controller. 8x184 pins DDR 400 PC3200 (Total 16 Gb ECC/REG RAM). 1xPCI, 2xPCI-X 100Mhz,1xPCI-X 133Mhz and 2xPCI Express x16 for NVidia SLI. 1xATA, 4xSATA 3Gbps, RAID0+1+10.Dual Gbps ethernet ports. 4xUSB2.0

That's a "Dual CPU Dual Core|" with 16 GB and SLI support. My current board has 16GB, a single hex-core CPU and two more SATA ports. Oh, and it has DDR3 and 2xUSB3.

That is an impressive rig even by todays standards. That motherboard was from 2007. The rig would be about 2300 USD. (2007 rating). That's excluding PSU, case, mouse and keyboard! The current rig I have was about 1300 USD (2012 rating).

I was going to populate it with two Opteron 225 (Single Core, the Dual Core was too expensive), two 7900GT's and 8x1GB of DDR400 RAM. Which would probably just give me 4GB since it was probably arranged so each core was linked to a bank.

The other was a Tyan Thunder S2882UG3NR (image also from NewEgg)



It had similar specs, but the first one was slightly superior for gaming. This was more of a server board.

5/10/12

Windows 7 Command Prompt Here

So I was trying to install the trusty old CmdHereToy.exe from Windows XP, but Windows 7 would have none of that. So after a quick Google, like you just did, it's actually already built into Win 7.

The trick: Just hold the Shift-button while Right-Clicking and you get a few more options:

The usual menu
The OMG you just need to hold Shift menu

The Useful Utility Page

(Updated 14.09.2012, 05.09.2013)

File utilities:

Teracopy in action.
TeraCopy will copy your files, and also do a md5 check if you want. Integrates with Explorer too. Neat utiliy. not unlike NSIS's copy utility. Unfortunately, sometimes it does bug out when using it as a Shell-integrated copy-replacement. I recommend using this as a stand-alone app.










Locate32 in action, as you can see, it will search network drives too.
Locate32 is the file search utility you have been wanting since they took it away in Windows 7. This is like Windows XP's old file search, only vastly improved. It searches local disks and network mounts by default, but you can make any kind of setup with this program. For example, you can omit certain directories from a search, etc. Also comes in a 64 bit variant. 10/10 would search again.












TrueCrypt's interface.
TrueCrypt is one of the best encryption  packages out there. Protect your files with AES256 and just don't forget the password! Supports hidden volumes withing regular volumes.

Audio utilities

Recording & editing

Reaper for recording, has low latency, comprehensible UI and a good routing/monitoring interface. This is also the only recorder I have at the moment which actually works with my studio setup.
Audacity and CoolEdit for secondary editing. CoolEdit used to be my favourite (now Adobe Audition) but it did not play nice with my hardware this time)
Traders Little Helper + FLAC  and WAV workshop for audio traders.
winLAME - UI for the LAME mp3 codec

Musicians tools

GNU Solfege, for ear training

Playback & codecs

VLC and FooBar2000 for media playback, will probably reinstall WinAmp again purely for the fact that it is the only application I know that rewinds on pressing the arrow keys. (Vital for my guitar practice!)

flac codecs - this is what TLH uses.
OPUS codecs - A new codec

Windows Tweaking

Jumplist-Launcher will give you a custom JumpList on the Start+Menu. A jump+list is the sub+folder that a program creates on the Start-menu to for example let you access your last used files within that app. This utility will let you group and organize a custom Jumplist, to declutter your Start-menu.


Development

Visual SVN Server, sets you up with a working SVN server out of the box. Add and name your repo, and it's ready to go. I personally use this with Eclipse's SVN plugins. This is *actually* an out-of-the box setup, some of the SVN server packs I've seen doesn't actually work :)

TortoiseSVN, the definitive GUI client for SVN operations.

Portable Application Compilations

PortableApps.com, this is a huge collection of smaller apps and games. 

WSCC, Windows System Controll Centre, a compilation by NirSoft that includes all NirSoft itilities, as well as a comprehensive wrappe of all the SysInternals utilities.

5/8/12

Computer Techie Toolbox Round-Up:

Computer Techie Toolbox Round-Up:

After about a couple of years with little work to do, I've built and refurbished a few computers in the past few months.
Again, better than MacGyver's

Dispensable spare parts
For instance, I used a Pentium 3 to boot a Phenom with a broken pin

  1. Scissors
  2. Wide plyer/wirestripper
  3. Pointed plyer
  4. Wide Philips/flat screwdrivers
  5. Magnifying glass
  6. Multitool pocketknife
  7. The screwdriver that comes with Noctua SE fans
  8. Multi-bit screwdriver

Mini screwdriver set for repairing and cleaning laptops.

Assortment of parts: (Label the boxes!)
  1. Screws, sorted!
  2. Pins
  3. USB sticks (I like to keep special purpose USB sticks separate and labeled)
  4. Flash RAM
  5. Small cables (CrossFire/SLI,molex adapters)
  6. Stickers
  7. Misc++



Toolbox:
  1. Pens
  2. CPU cooling paste
  3. Glue
  4. Tape
  5. Antistatic wristband
  6. Q-tips
  7. Other tools!

A straight fan can improve RPM

Keep your rescue and OS disks sorted!
  1. Retail Diagnostic CD's
  2. Retail Driver CD's
  3. Your own accumulated custom driver compilations
  4. Windows/Linux OS CD's
  5. Live distros
  6. Rescue distros
  7. Forensic distros