Usable technology

Peter Kuhar

Archive for the 'IT - ENG' Category

Sound problems with Ubuntu 8.10 and flash in firefox

Thursday, December 18th, 2008

I recently had problems with sound in Ubuntu. Instead of playing there were just some popping/squeaking/clicking sounds from the speakers. The other side effect was that sometimes the flash video on sites like youtube etc. just stopped after 2-3s ( I guess becouse the audio buffer was full ).

I traced the problems down to pulseaudio sound server that is included in recent ubuntus. It was well hided behind ALSA( probably something like app->alsa->pulseaudio->alsa->soundcard )

The solution: disable pulseaudio

sudo gedit /usr/share/alsa/alsa.conf

and comment out the pulse stuff

files [
#”/usr/share/alsa/pulse.conf”
“/usr/share/alsa/bluetooth.conf”

I hope this helps.

Converting mpeg/avi/… to flv flash movie under Ubuntu Linux

Sunday, June 29th, 2008

1) Install ffmpeg in flvtool2 ( sudo apt-get install ffmpeg flvtool2 )

2) Create file avi2flv.sh with the following content(or download it here avi2flv.sh ):

#!/bin/bash
tempfile=$(tempfile).flv

ffmpeg -y -i "$1" -r 20 -s 360x288  -deinterlace -ar 22050 "$tempfile"
cat "$tempfile" | flvtool2 -U stdin "$2"
rm -rf "$tempfile"

3) Run bash avi2flv.sh input.avi output.flv

4) Upload to web and use some free flv player like  http://pyg.keonox.com/tests/flash_flv_player/flvplayer.html to display it.

The most anoying programming mistakes

Thursday, May 22nd, 2008

In c:
‘/n’ instead of ‘\n’: gcc will warn you, sdcc will not. ( cost 4 hours of staring into wireshark. )

In JavaScript:
string.chatAt(0) -> Unknown method: Since javascript is not a strongly typed language -> 30 minutes of figuring why javascript thinks that the give object is not a string.

tusb3410/ez430-f2013 and company on kernel 2.6.24 ( ubuntu 8.04 ) patching

Monday, April 28th, 2008

Update: Kernel 2.6.25, has this problem fixed. Unfortunately this is not the version that Ubuntu 8.04 uses

After updating to 8.04 the tusb3410 devices stopped working. There is a patch but it requires a new kernel version( not available for ubuntu jet ).
It basically requires a change in a structure in the ti_usb_3410_5052 driver ( see the above patch link ).

I’ve compiled the patched ti_usb_3410_5052.ko for kernel version 2.6.24-16-generic ( ubuntu 8.04 )
ti_usb_3410_5052.ko.gz

You still need the udev rules for switching the configuration.

For vanilla TUSB3420:

#TI USB 3410
SUBSYSTEM==”usb”, ACTION==”add”, \
ATTR{idVendor}==”0451″, ATTR{idProduct}==”3410″, \
ATTR{bNumConfigurations}==”2″, \
ATTR{bConfigurationValue}==”1″, \
RUN+=”/bin/sh -c ‘echo 2 > /sys%p/device/bConfigurationValue’”, \
SYSMLINK+=”ttyModulaTalker”

For ez430

#TI ez430
SUBSYSTEM==”usb”, ACTION==”add”, \
ATTR{idVendor}==”0451″, ATTR{idProduct}==”F430″, \
ATTR{bNumConfigurations}==”2″, \
ATTR{bConfigurationValue}==”1″, \
RUN+=”/bin/sh -c ‘echo 2 > /sys%p/device/bConfigurationValue’”, \
SYSMLINK+=”ttyEZ430”


I’ve been informed that the download link was not working. The problem is now solved.

With the new updates of the kernel on 8.04, this module/driver will stop working. I don’t have the time to rebuild it again, but you can use my original one and load it with:

modprobe -f  ti_usb_3410_5052

ez430 in Linux ( ubuntu )

Thursday, March 6th, 2008

Some hints for setting up development environment for TIs msp430f20xx MCUs.
What you need for mspgcc
How to build mspgcc
ez430 dev tool setup under linux
Connect it with Eclipse for debbuging

The instructions on installing eclipse with embedded debugging support

Eureka, I’ve found the debs

Simple file transfer

Sunday, December 9th, 2007

When you have to transfer a large amount of data from on computer to another you’ll find that simplicity rules. Using two basic tools that are on most linux machines ( works on windows with cygwin ) tar and netcat (nc). You don’t need any samba, http, ftp, rsync…
Here it goes:
On the receiving end:
$ nc -l -p 1234 | tar -x

This will make a tcp server listening on port 1234 and pass any received data to tar

On the sending end:
$ tar -c FolderToTransfer | nc receivershost 1234

This will create tar file on the fly and pass it to the server.

To enable compression use( only for slow networks, since it consumes a lot of CPU ): tar -xz and tar -cz

The essential windows geek tools

Thursday, December 6th, 2007

This is what I install on windows.

  • Editor - Programmers notepad 2 - http://www.pnotepad.org/
  • Utility - Power toys(Image Resizer, Open Command Window Here) - http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx
  • Diff - WinMerge - http://winmerge.org/
  • EDA - Eagle - http://www.cadsoft.de/
  • FTP - FileZilla - http://filezilla-project.org/
  • Unix shell - Cygwin(with ssh, gcc, mingw,X11,rxvt,openssl) - http://www.cygwin.com/
  • Source control - TortoiseSVN - http://tortoisesvn.tigris.org/
  • IDE - Eclipse - http://www.eclipse.org/
  • Compiler - SDCC - http://sdcc.sourceforge.net/
  • Compiler - WinARM - http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/
  • Compiler - WinAVR - http://winavr.sourceforge.net/
  • Software prototyping - Visual C# Express - http://www.microsoft.com/express/vcsharp/
  • Internet - Skype - http://www.skype.com/intl/en/
  • Internet - Firefox/Thunderbird - http://www.mozilla.org
  • Utility - HHD Hex Editor - http://www.hhdsoftware.com/Family/hex-editor.html
  • Office - OpenOffice.org - http://www.openoffice.org/
  • Compression - WinRAR - http://www.rarlab.com/
  • PDF - Adobe reader - http://www.adobe.com/products/acrobat/readstep2.html
  • PDF - CutePDF( pdf printer ) - http://www.cutepdf.com/
http://www.pkuhar.com © 2006 Peter Kuhar peter@pkuhar.com