mingw – cross compile x64 libavcodec on debian6

This is a guide of cross compile libavcodec into mingw32 bit to run on win64 system from linux debian6 64bit version:

  1. git clone the libavcodec: git clone git://git.libav.org/libav.git
  2. apt-get install gcc-mingw32
  3. ./configure –enable-cross-compile –enable-w32threads –cross-prefix=amd64-mingw32msvc- –arch=x86_32 –target-os=mingw32 –enable-memalign-hack –enable-shared

This is actually a mistake because I want to get x86 code, it turns out amd64-mingw32msvc on debian6 x64 is generate x64 code, it’s pretty confusing here. So keep it simple, if you want to have x86 bits, do this steps:

  1. install mingw32 on win32 OS
  2. git clone the latest libavcodec: git clone git://git.libav.org/libav.git
  3. go the source directory:
    ./configure --enable-w32threads --enable-memalign-hack --enable-shared
  4. make

 

 

Have fun.

 

Avoid boot stopper: give root password for maintenance

When messed around, you will get a message: give root password for maintenance, and require you to press ctrl+D to continue during linux boot, then freeze the boot process. Most likely, it is because it’s booting into the single user mode.

To have the linux boot without this blocking issue, open file: /boot/grub/menu.lst, and set the default option to the config with a quiet in it, the index is zero based, so in my case, here is my config file, I am setting it to take the config with this line:

kernel          /boot/vmlinuz-2.6.32-5-xen-amd64 root=/dev/xvda1 ro quiet

root@debian-linux:~# cat /boot/grub/menu.lst
default 0
timeout 5
title           Debian GNU/Linux, kernel 2.6.32-5-xen-amd64
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.32-5-xen-amd64 root=/dev/xvda1 ro quiet
initrd          /boot/initrd.img-2.6.32-5-xen-amd64

title           Debian GNU/Linux, kernel 2.6.32-5-xen-amd64 (single-user mode)
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.32-5-xen-amd64 root=/dev/xvda1 ro single
initrd          /boot/initrd.img-2.6.32-5-xen-amd64

installed .net framework 3.5 doesn’t mean you have got .net framework 3.5 client profile

Something strange when you are deploy .net framework based apps, it just doesn’t follow the way you would expect it would be, for example, from my experience:

Installed .net framework 3.5 doesn’t mean you have got .net framework 3.5 client profile

You are still prompted error if you want to run apps target .net 3.5 client proflie while having only .net 3.5 installed. It’s just like the law of classical physics doesn’t have to happen at the universe level: nothing could be counted on.

So be careful and good luck.

minor cracks discovered on the wing rib of air bus a380

Minor cracks discovered on the wing rib of air bus a380. The news says it’s not a safety issue. Do you trust your instinct or their mouse? This may just be a psychological panic, since there is so many parts on the plane, so easy to get wrong. Why don’t they get it fixed right now? So many work involved, it’s beyond their control, at least very not economically. I think the plane is tested against the cruel mother nature everyday, if they already know the issue, should get it fixed.

audio terminology

When coding sound apps, you will run into these components built into windows: ASIO, WASAPI, DirectSound, WaveOut, DirectMusic

ASIO
ASIO: Audio Stream Input/Output
ASIO bypasses the normal audio path from a user application through layers of intermediary Windows operating system software so that an application connects directly to the sound card hardware.

WASAPI
WASAPI: Applications communicate with the audio driver through Sessions, and these Sessions are programmed through the Windows Audio Session API (WASAPI).
starting with Windows Vista, KMixer has been removed and replaced by WASAPI and a new WaveRT port driver.

DirectSound
DirectSound is a software component of the Microsoft DirectX library for the Windows operating system. DirectSound provides a low-latency interface to the sound card driver and can handle the mixing and recording of multiple audio streams.

WaveOut
WaveOut: legacy api

DirectMusic
DirectMusic is a deprecated component of the Microsoft DirectX API that allows music and sound effects to be composed and played and provides flexible interactive control over the way they are played. Architecturally, DirectMusic is a high-level set of objects, built on top of DirectSound, that allow you to play sound and music without needing to get quite as low-level as DirectSound. DirectSound allows for the capture and playback of digital sound samples, whereas DirectMusic works with message-based musical data. Music can be synthesized either in hardware, in the Microsoft GS Wavetable SW Synth, or in a custom synthesizer.

unzip 7z file on debian (linux)

To upzip .7z file on the debian (linux), you need to

  1. Install the package with:
    apt-get install p7zip
  2. If your file to unzip is: test.7z, then run:
    7zr x test.7z

Going further, for a list of parameter type:
7zr --help
And you will get:

7-Zip (A) 9.04 beta Copyright (c) 1999-2009 Igor Pavlov 2009-05-30
p7zip Version 9.04 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,2 CPUs)

Usage: 7zr  [...] [...]
[]
a: Add files to archive
b: Benchmark
d: Delete files from archive
e: Extract files from archive (without using directory names)
l: List contents of archive
t: Test integrity of archive
u: Update files to archive
x: eXtract files with full paths

-ai[r[-|0]]{@listfile|!wildcard}: Include archives
-ax[r[-|0]]{@listfile|!wildcard}: eXclude archives
-bd: Disable percentage indicator
-i[r[-|0]]{@listfile|!wildcard}: Include filenames
-m{Parameters}: set compression Method (see the manual)
-l: don't store symlinks; store the files/directories they point to
CAUTION : the scanning stage can never end because of symlinks like '..'
(ex: ln -s .. ldir)
-o{Directory}: set Output directory
-r[-|0]: Recurse subdirectories
(CAUTION: this flag does not do what you think, avoid using it)
-sfx[{name}]: Create SFX archive
-si[{name}]: read data from stdin
-slt: show technical information for l (List) command
-so: write data to stdout (eg: 7zr a dummy -tgzip -so Doc.txt > archive.gz)
-ssc[-]: set sensitive case mode
-t{Type}: Set type of archive
-u[-][p#][q#][r#][x#][y#][z#][!newArchiveName]: Update options
-v{Size}[b|k|m|g]: Create volumes
-w[{path}]: assign Work directory. Empty path means a temporary directory
-x[r[-|0]]]{@listfile|!wildcard}: eXclude filenames
-y: assume Yes on all queries