Thursday, July 31, 2008

ip_local_port_range

The following command modifies the file /proc/sys/net/ipv4/ip_local_port_range.
Some times I can not directly write to the file in proc. But this works:

$ sudo sysctl -w net.ipv4.ip_local_port_range="1024 64000"

Wednesday, July 30, 2008

Windows share folders with vmware Ubuntu

I have trouble to view share folder from Ubuntu 7.0.4. There are several ways to do it. One is through smb4k, the other is with vmware share folder settings. Neither works for me. So with the second way, I found out the solution from the Internet.

Here is the fix:

/*
#define INODE_SET_II_P(inode, info) do { (inode)->u.generic_ip = (info); } while (0)
#define INODE_GET_II_P(inode) ((HgfsInodeInfo *)(inode)->u.generic_ip)
*/
#define INODE_SET_II_P(inode, info) do { (inode)->i_private = (info); } while (0)
#define INODE_GET_II_P(inode) ((HgfsInodeInfo *)(inode)->i_private)

// inode->i_blksize = HGFS_BLOCKSIZE;

This fix changes the driver.c in /usr/lib/vmware-tools/modules/source. Make a backup on vmhgfs.tar, untar it (tar xvf vmhgfs.tar), make edit on driver.c, tar it back (tar cvf vmhgfs.tar vmhgfs-only) and re-run vmware-config-tools.pl.

Everything is fine on building hgfs module.

Tuesday, July 29, 2008

nyquist - built it on Ubuntu 7.04

I am not really familiar with Ubuntu, usually I use Fedora Core 5 at work, but this time I got a new project which need to install ACCESS Linux platform(ALP), ALP is provided with debian-based packages, so I can only do my job on Ubuntu or Debian.

I install Ubuntu 7.0.4 though vmware on PC at work and MacBook at Home. At work, I have a big trouble, is the amxier & aplay can not be used to play audio file, I do some fix to make amixer work, but aplay still not work. I also got Ubuntu 7.10 installed, it is OK with audio playing. And there's no audio problem on my MacBook with Ubuntu 7.04.

At I am trying to compile nyquist myself. At start, gcc complains it can not find "stdio.h" file. So I install libc-dev, then it complains could not find g++. So I install g++. After that, I got link errors. It could not find readline. The follow command solves the issue:
sudo apt-get libreadline5-dev

Then is asound. I use the following command to find libasound.

apt-cache search libasound
..
sudo apt-get install libasound2-dev


The last problem is it could not find javac, it is hard to find through "apt-cache search", the following command make it work.

sudo apt-get install sun-java6-jdk

Friday, July 25, 2008

Wind generation from Audacity-Nyquist

Audacity is a free audio editor for Windows, Linux and Mac OS X. What I found the interesting thing is -- it support writing plugins with Nyquist. Well, Nyquist is a Lisp enhancement for audio/synth based on a common language -- XLISP. XLISP is a very old Lisp Language with support of object-oriented concept such as "class", I print the manual, and the date for the manual is 1988.

So I have the platform to do the following:
1. Experiment writing in Lisp.
2. To Learn the two most common parts in DSP (DFT and Digital filters)
3. Learn audio processing (gain, db etc)

Wow, in my life I am eager to learn all these three parts, but I have not get any benefits even I have put years of time. I just could not understand. I think it may take more years. I am just not smart enough. But any way it is my direction.

Below you will hear wind, I generate it based on David R. Sky's Wind plugin. I am using Audacity 1.3.5, and the wind is a mono audio. It fails when I set it to stereo, not sure what is wrong with it.

note 20080818: I have removed the wind flash link.

Monday, July 21, 2008

audacity - build & install on FC5

The default audacity package does not have mp3 built as default on FC5. So I spend some time to build my own audacity on FC5.

1. Install libmad. This is the mp3 decoder library. I directly found a previous build at here.

2. Install libsndfile. (It is already there).

3. Build wxGTK. Since the default wxGTK is 2.4.2 (audacity 1.2.5) and I am try to build audacity 1.3.5 which needs wxGTK 2.6.1 plus, I have to uninstall the default install package.

Also, make sure gtk is installed. (FC5 default contains these libs). Following is the script to build wxGTK (2.6.4).

./configure --with-gtk --enable-gtk2
make
make install


And "wx-config --list" is a useful command to list how wxGTK is configured.

4. Build audacity.

./configure
make
make install


5. Fix libwx_gtk shared libary with ldconfig. Since my build shared library is installed at /usr/local/lib. So I have to do some fix with "/etc/ld.so.conf". I creat and edit a file named "audacity-i386.conf" in /etc/ld.so.conf.d directory of FC5, just add a line "/usr/local/lib", and do "/sbin/ldconfig". To check result use "/sbin/ldconfig -v".

6. Launch audacity to open a mp3 file to see is it work.

MISC.

To query a package (for example wxgtk) on FC5. I want to know what the package name is, is it installed on the system, and the version number etc.
I use "yum info wxgtk" to get the package information, but some times I have no idea with the package name, so I use the following command to find out:

rpm -q -a | grep -i wxgtk