[ROM] CyanogenMod 6.1 for GT-I9000: DEVELOPER ONLY THREAD! - Galaxy S I9000 Android Development

CM6 for Samsung Galaxy S GT-I9000: Work in progress
+++++++++++++++++++++++++++++++++++++++++++++++++
Devs:
codeworkx (Aery) - http://twitter.com/codeworkx
coolya - http://twitter.com/dumdidum
finghin - http://www.twitter.com/finghin
PLS DONATE FOR COFFEE, PIZZA AND BEER!!! ;-)
I'm already redirecting 50% of all incoming Donations to coolya.
THANKS TO ALL DONATORS!!!
+++++++++++++++++++++++++++++++++++++++++++++++++
Official Beta Releases:
http://forum.xda-developers.com/showthread.php?t=842159
Known Bugs:
http://code.google.com/p/samsung-gt-i9000-cyanogenmod/issues/list
Please have a look at the issues list before reporting a bug.
Maybe it's already known.
DISCUSSION THREAD: http://forum.xda-developers.com/showthread.php?t=838841
Please use DISCUSSION THREAD, especially for OFF-TOPIC Stuff!!!
+++++++++++++++++++++++++++++++++++++++++++++++++
Howto build for GT-I9000:
mkdir -p ~/android/system
cd ~/android/system/
repo init -u git://github.com/codeworkx/android.git -b froyo
repo sync
cd ~/android/system/vendor/cyanogen/
./get-rommanager
./get-google-files -v HDPI
cd ~/android/system/
cp ./vendor/cyanogen/products/cyanogen_galaxys.mk ./buildspec.mk
. build/envsetup.sh
lunch cyanogen_galaxys-eng
make -j`grep 'processor' /proc/cpuinfo | wc -l`
+++++++++++++++++++++++++++++++++++++++++++++++++
Kernel Sources:
https://github.com/codeworkx/android_kernel_2.6.32
Initramfs:
https://github.com/codeworkx/cyanogenmod_initramfs_2.6.32
+++++++++++++++++++++++++++++++++++++++++++++++++
Updater-Script for creating a update.zip
https://github.com/codeworkx/update
+++++++++++++++++++++++++++++++++++++++++++++++++
DON'T BUILD WITHOUT ANY EXPERIENCE!
DON'T ASK HOW TO BUILD!
DON'T ASK WHY YOUR BUILD FAILS!
###################################################
# Info for Aery
###################################################
JPM build.prop:
http://pastebin.com/4b5Na6JP
Devices:
http://pastebin.com/ci1CLMZ5
JPM System:
http://pastebin.com/qnR93Ccz
Kernel Log:
http://pastebin.com/98FSKEqZ
Find Depencies:
objdump -x out/target/product/xxxxxx/system/lib/libmedia_jni.so | grep NEEDED
Android UID and GUID:
AID_ROOT 0 /* traditional unix root user */
AID_SYSTEM 1000 /* system server */
AID_RADIO 1001 /* telephony subsystem, RIL */
AID_BLUETOOTH 1002 /* bluetooth subsystem */
AID_GRAPHICS 1003 /* graphics devices */
AID_INPUT 1004 /* input devices */
AID_AUDIO 1005 /* audio devices */
AID_CAMERA 1006 /* camera devices */
AID_LOG 1007 /* log devices */
AID_COMPASS 1008 /* compass device */
AID_MOUNT 1009 /* mountd socket */
AID_WIFI 1010 /* wifi subsystem */
AID_ADB 1011 /* android debug bridge (adbd) */
AID_INSTALL 1012 /* group for installing packages */
AID_MEDIA 1013 /* mediaserver process */
AID_DHCP 1014 /* dhcp client */
AID_SHELL 2000 /* adb and debug shell user */
AID_CACHE 2001 /* cache access */
AID_DIAG 2002 /* access to diagnostic resources */
/* The 3000 series are intended for use as supplemental group id's only. */
/* They indicate special Android capabilities that the kernel is aware of. */
AID_NET_BT_ADMIN 3001 /* bluetooth: create any socket */
AID_NET_BT 3002 /* bluetooth: create sco, rfcomm or l2cap sockets */
AID_INET 3003 /* can create AF_INET and AF_INET6 sockets */
AID_NET_RAW 3004 /* can create raw INET sockets */
AID_MISC 9998 /* access to misc storage */
AID_NOBODY 9999
AID_APP 10000 /* first app user */
"root", AID_ROOT
"system", AID_SYSTEM
"radio", AID_RADIO
"bluetooth", AID_BLUETOOTH
"graphics", AID_GRAPHICS
"input", AID_INPUT
"audio", AID_AUDIO
"camera", AID_CAMERA
"log", AID_LOG
"compass", AID_COMPASS
"mount", AID_MOUNT
"wifi", AID_WIFI
"dhcp", AID_DHCP
"adb", AID_ADB
"install", AID_INSTALL
"media", AID_MEDIA
"shell", AID_SHELL
"cache", AID_CACHE
"diag", AID_DIAG
"net_bt_admin", AID_NET_BT_ADMIN
"net_bt", AID_NET_BT
"inet", AID_INET
"net_raw", AID_NET_RAW
"misc", AID_MISC
"nobody", AID_NOBODY
Check Dalvik-Cache:
dexdump -c /data/dalvik-cache/*
Mount sdcard to usb @ recovery:
echo /dev/block/mmcblk0 > /sys/devices/platform/s3c-usbgadget/gadget/lun1/file
Unmount:
echo "" > /sys/devices/platform/s3c-usbgadget/gadget/lun1/file

man, if you can do that i will come to you and kiss your feet!

did you wipe data and cache?
did you wipe data and cache?

Posting ur update-script / updater-script might help ?

Aery said:
Hello Guys.
It seems that i've builded CM6 for Galaxy S.
But when i apply update.zip from Recovery 2e, i get following error:
assert failed: write_raw_image("/tmp/boot.img","boot")
E:Error in /sdcard/update.zip
Does anyone know whats going wrong?
Part from BoardConfig.mk
Code:
BOARD_BOOT_DEVICE := /dev/block/bml7
BOARD_DATA_DEVICE := /dev/block/mmcblk0p2
BOARD_DATA_FILESYSTEM := rfs
BOARD_DATA_FILESYSTEM_OPTIONS := llw,check=no,nosuid,nodev
BOARD_HAS_DATADATA := true
BOARD_DATADATA_DEVICE := /dev/block/stl10
BOARD_DATADATA_FILESYSTEM := rfs
BOARD_DATADATA_FILESYSTEM_OPTIONS := llw,check=no,nosuid,nodev
BOARD_SYSTEM_DEVICE := /dev/block/stl9
BOARD_SYSTEM_FILESYSTEM := rfs
BOARD_SYSTEM_FILESYSTEM_OPTIONS := llw,check=no
BOARD_CACHE_DEVICE := /dev/block/stl11
BOARD_CACHE_FILESYSTEM := rfs
BOARD_CACHE_FILESYSTEM_OPTIONS := llw,check=no,nosuid,nodev
BOARD_SDCARD_DEVICE_PRIMARY := /dev/block/mmcblk1
BOARD_SDCARD_DEVICE_SECONDARY := /dev/block/mmcblk1p1
BOARD_SDEXT_DEVICE := /dev/block/mmcblk1p2
#BOARD_USES_BMLUTILS := true
Click to expand...
Click to collapse
You better post your update.zip for some who can check it closer

DO NOT FLASH THIS FILE!
http://www.multiupload.com/72EE5VK58S

hmm.. i'm not making any sense!
uhm.. the problem lies with the write command..
are you sure the boot.img is in the /tmp directory on your phone?

I'll have a quick look for you as well.

"boot.img" makes me suspect you are trying to update in the HTC way. It's likely that the CM devs haven't posted the info to allow you to build a fully flashable ZIP yet. WesGarner tweeted recently that he bricked his phone trying a dev build, so be careful.

Mail from wes:
Can't use raw image write
Since boot is the last to flash use my build kernel script which will flash the kernel using redbend

God CM soon maybe

Mitty1990 said:
God CM soon maybe
Click to expand...
Click to collapse
http://forum.cyanogenmod.com/topic/7774-cyanogenmod-6-running-on-the-epic-4g/

Aery said:
http://forum.cyanogenmod.com/topic/7774-cyanogenmod-6-running-on-the-epic-4g/
Click to expand...
Click to collapse
OOOOOOOOOOHHHHH jesus I can't wait loved this ROM before can only pray that it will come to SGS soon

You seem to be missing all of your proprietary files..
You should check in with noobnl on your bulding technique.

So finally new devs are trying to make this port possible? Hope it will be soon as anyone else!

For those who want to help, i've updated OP.

Aery said:
For those who want to help, i've updated OP.
Click to expand...
Click to collapse
nice! sync'ing with your repo asap

jodue said:
nice! sync'ing with your repo asap
Click to expand...
Click to collapse
ah, ein Wienerchen ;-)

Aery said:
ah, ein Wienerchen ;-)
Click to expand...
Click to collapse
wenn wir nicht von würsten oder geschlechtsorganen sprechen: ja, aber ohne das "chen"

jodue said:
wenn wir nicht von würsten oder geschlechtsorganen sprechen: ja, aber ohne das "chen"
Click to expand...
Click to collapse
22ter bez?

Related

[DEV] Compiling mplayer

Hi @all,
i want to compile the mplayer for Android.
The only "How-To" i found is this.
Maybe someone with more experience in cross-compiling can give me some more hint.
thanks
peter
Take a look at that, can probaly be helpful
http://forum.xda-developers.com/showthread.php?t=431329
compile finished
@mopodo
thanks, i think i have done
sandmen said:
@mopodo
thanks, i think i have done
Click to expand...
Click to collapse
Did you get it to run?
mplayer run's.
But i have some trouble to set VSCREENINFO.
Maybe wrong video fromat.
So I have to check some different video's.
what about audio? looking at some posts in the MPLAYER discussion VSCREENINFO issues appear to be something to do with framebuffer of the kernel.
I've been trying to get audio working, although in a Magic 32B, but I have failed so far.
Do you Hero owners see /dev/dsp or /dev/snd0 ?
Do you get any audio at all? If so, using what device?
From the very limited information I've managed to get so far, Dream owners do get sound, though I have no idea how and why.
I've used the how-to mentioned in the first post, no success so far.
Perhaps this helps: read-write access for /dev/msm_pcm_out
So chmod this device file and use it as audio out?
I'm actually curious about how a native linux app would render video on android. There is no X so framebuffer would be the only way. But then, how do you get user in/output?
status mplayer crosscompilation
@all
follow things i have tryed:
- Crosscompiling svn-version mplayer, there i have some segmentation fault's.
doesn't work
- Crosscompiling Mplayer1.02 (old version) there i have trouble to set VSCREENINFO.
So it takes time
If anybody have some hints, about crosscompiling, feel free.
sandmen said:
@all
follow things i have tryed:
- Crosscompiling svn-version mplayer, there i have some segmentation fault's.
doesn't work
- Crosscompiling Mplayer1.02 (old version) there i have trouble to set VSCREENINFO.
So it takes time
If anybody have some hints, about crosscompiling, feel free.
Click to expand...
Click to collapse
I managed to compile a working (by working I mean no segfault ) version of SVN-r29796 with the following config:
./configure --enable-fbdev --host-cc=gcc --target=arm --cc=arm-none-linux-gnueabi-gcc --as=arm-none-linux-gnueabi --ar=arm-none-linux-gnueabi-ar --ranlib=arm-none-linux-gnueabi-ranlib --enable-static
The resulting binary can be found here:
http://www.megaupload.com/?d=142QK29B
Together we can solve this, sandmen
What we need now is a Dream user to confirm that audio works on that hardware...
@Djhg2000
you can play a video without sound?
sandmen said:
@Djhg2000
you can play a video without sound?
Click to expand...
Click to collapse
No, I get the VSCREENINFO error. It does decode video though if I use "-vo null -ao null", but what probably won't get us anywhere...
I've heard the VSCREENINFO problem is a kernel bug, can anyone confirm this?
I don't have the time to look into it now, but maybe we can make a patch to workaround the problem?
Edit:
It seems like this piece of code in libvo/vo_fbdev.c is causing the problem:
Code:
if (ioctl(fb_dev_fd, FBIOGET_VSCREENINFO, &fb_vinfo)) {
mp_msg(MSGT_VO, MSGL_ERR, "Can't get VSCREENINFO: %s\n", strerror(errno));
goto err_out;
}
These lines can be found at 685-688 in r29796.
The problem is that my C skills are very limited and I have no idea what "&fb_vinfo" should be... C coders please help?
Typing "ioctl FBIOGET_VSCREENINFO" returns "ioctl: too few arguments".
Typing "ioctl FBIOGET_VSCREENINFO 0" returns "cannot open FBIOGET_VSCREENINFO"
From the information I can gather, ioctl seems to be a tool to pass instructions directly to drivers?
Yeah, it finally seems like we're getting somewhere
us1111 said:
Perhaps this helps: read-write access for /dev/msm_pcm_out
So chmod this device file and use it as audio out?
I'm actually curious about how a native linux app would render video on android. There is no X so framebuffer would be the only way. But then, how do you get user in/output?
Click to expand...
Click to collapse
I've tried this, "-ao oss:/dev/msm_pcm_out" gives "Can't set audio device /dev/msm_pcm_out to s16le output, trying s16le...".
"-ao pcm:file=/dev/msm_pcm_out" hangs MPlayer at the "Starting playback..." message.
"-ao pcm:file=/dev/msm_pcm_out -v" hangs MPlayer with the line "Increasing filtered audio buffer size from 0 to 65536".
So yes, it might be the right device, but I can't get it to work.
Perhaps you could download the binary and see if you get different results on a Hero?
@Djhg2000
Did you get the "get VSCREENINFO" error or the "put VSCREENINFO"
sandmen said:
@Djhg2000
Did you get the "get VSCREENINFO" error or the "put VSCREENINFO"
Click to expand...
Click to collapse
Wow, do I feel stupid
Of course it's the put VSCREEN error, here is the correct code from libvo/vo_fbdev.c:
Code:
if (ioctl(fb_dev_fd, FBIOPUT_VSCREENINFO, &fb_vinfo)) {
mp_msg(MSGT_VO, MSGL_ERR, "Can't put VSCREENINFO: %s\n", strerror(errno));
if (fb_tty_fd >= 0 && ioctl(fb_tty_fd, KDSETMODE, KD_TEXT) < 0) {
mp_msg(MSGT_VO, MSGL_ERR, "Can't restore text mode: %s\n", strerror(errno));
}
return 1;
}
This is at lines 814-820 in r29796.
It seems like the problem mostly remains the same.
However, I can't debug it properly (yet!) due to my lack of skills in C .
I'm making slow progress in understanding the real problem, but at least I'm learning some C while I'm doing it
Edit:
I've looked through the sources and I just can't figure it out:
Code:
static struct fb_var_screeninfo fb_vinfo;
means that fb_vinfo should look like fb_var_screeninfo, right?
But fb_var_screeninfo itself (defined in linux/fb.h) looks like this (copied directly form android kernel git tree):
Code:
struct fb_var_screeninfo {
__u32 xres; /* visible resolution */
__u32 yres;
__u32 xres_virtual; /* virtual resolution */
__u32 yres_virtual;
__u32 xoffset; /* offset from virtual to visible */
__u32 yoffset; /* resolution */
__u32 bits_per_pixel; /* guess what */
__u32 grayscale; /* != 0 Graylevels instead of colors */
struct fb_bitfield red; /* bitfield in fb mem if true color, */
struct fb_bitfield green; /* else only length is significant */
struct fb_bitfield blue;
struct fb_bitfield transp; /* transparency */
__u32 nonstd; /* != 0 Non standard pixel format */
__u32 activate; /* see FB_ACTIVATE_* */
__u32 height; /* height of picture in mm */
__u32 width; /* width of picture in mm */
__u32 accel_flags; /* (OBSOLETE) see fb_info.flags */
/* Timing: All values in pixclocks, except pixclock (of course) */
__u32 pixclock; /* pixel clock in ps (pico seconds) */
__u32 left_margin; /* time from sync to picture */
__u32 right_margin; /* time from picture to sync */
__u32 upper_margin; /* time from sync to picture */
__u32 lower_margin;
__u32 hsync_len; /* length of horizontal sync */
__u32 vsync_len; /* length of vertical sync */
__u32 sync; /* see FB_SYNC_* */
__u32 vmode; /* see FB_VMODE_* */
__u32 rotate; /* angle we rotate counter clockwise */
__u32 reserved[5]; /* Reserved for future compatibility */
};
Which is identical to the same struct in Ubuntu's kernel tree?
My conclusion so far is that one of these parameters are unsupported by the HTC Magic's graphics driver, but not the HTC Dream graphics driver?
I have no idea why the driver would even differ between them; they both use the same graphics chip, don't they?
Djhg2000 said:
I've tried this, "-ao oss:/dev/msm_pcm_out" gives "Can't set audio device /dev/msm_pcm_out to s16le output, trying s16le...".
"-ao pcm:file=/dev/msm_pcm_out" hangs MPlayer at the "Starting playback..." message.
"-ao pcm:file=/dev/msm_pcm_out -v" hangs MPlayer with the line "Increasing filtered audio buffer size from 0 to 65536".
So yes, it might be the right device, but I can't get it to work.
Perhaps you could download the binary and see if you get different results on a Hero?
Click to expand...
Click to collapse
I assume you have root ?
try
chmod o+rw /dev/msm_pcm_out
Jesterz said:
I assume you have root ?
try
chmod o+rw /dev/msm_pcm_out
Click to expand...
Click to collapse
Already tried that, I usually use root when debugging inside of Android, but not even "chmod 777 /dev/msm_pcm_out" helps.
I noticed there might be some relevant libraries in android:
/lib//libaudio.so
/lib/libhardware.so
/lib/libhtc_acoustics.so
/lib/libmedia.so
/lib/libmm-adspsvc.so
/lib/libopencore_player.so
/lib/libsoundpool.so
/lib/bluez-plugin/audio.so
Surely at least one of these libraries can provide a way to output audio?
Except maybe that bluez thing
I want to be a beta tester. My device is HTC Dream (g1).
1: pcm is the way to go. If you run mplayer -ao help, does it list pcm?
2: you can try compiling mplayer along with support for a sound server like pulseaudio, which would mean that you would need to add that package too...
Krasimir said:
I want to be a beta tester. My device is HTC Dream (g1).
Click to expand...
Click to collapse
Great, finally a Dream user (maybe thread should be moved to the Dream Development sub forum, as that's where people look for general android discussions).
Anyway, it's publicly available here:
http://www.megaupload.com/?d=142QK29B
Version SVN-r29796 for now, will probably upgrade later and post link here.
Save it to a SD card and use 'sh mplayer mediafilegoeshere.example -ao oss:/dev/msm_pcm_out' and post the results here.
Since you have a HTC Dream, it would be great if you could confirm it working/broken without the '-ao oss:/dev/msm_pcm/out' part.
Thanks for your help

How to get apps IDs ?

Hi everyone,
I'm in trouble with my Desire "network usage".
Here is a "screenshot" of my device.
How can I get the application name for "1013" ?
Thank you for your help.
This morning, the situation is worse
open the terminal on your phone (i use betterterminal pro) and type "ps -w" without quotes in superuser mode and it wqill display all the processes with their ids
Eek, that sounds like a really bad bug..
Take a look, not sure if it is what you can use and/or afford:
topic id=12318 on android fr forum
AID_ROOT 0 /* traditional unix root user */
AID_SYSTEM 1000 /* system server */
AID_RADIO 1001 /* telephony subsystem, RIL */
AID_BLUETOOTH 1002 /* bluetooth subsystem */
AID_GRAPHICS 1003 /* graphics devices */
AID_INPUT 1004 /* input devices */
AID_AUDIO 1005 /* audio devices */
AID_CAMERA 1006 /* camera devices */
AID_LOG 1007 /* log devices */
AID_COMPASS 1008 /* compass device */
AID_MOUNT 1009 /* mountd socket */
AID_WIFI 1010 /* wifi subsystem */
AID_ADB 1011 /* android debug bridge (adbd) */
AID_INSTALL 1012 /* group for installing packages */
AID_MEDIA 1013 /* mediaserver process */
AID_DHCP 1014 /* dhcp client */
leub said:
AID_MEDIA 1013 /* mediaserver process */
Click to expand...
Click to collapse
Thank you for your help leub.
Now I need to figure out which process is "mediaserver" ?!
The mediaserver is any Native or Application which uses or streams your media which can be music, videos, even apps like iMeem, streamfurious, Pandora, TuneWiki, You Tube, and the apps
Very interesting problem ...
Someone has a solution please ?!

Solved .[eVC++] How to use "srand" function?

Hello.
I want to ask some skilled developers,how to use "srand" function?
I found in help this:
Code:
/* RAND.C: This program seeds the random-number generator
* with the time, then displays 10 random integers.
*/
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
void main( void )
{
int i;
/* Seed the random-number generator with current time so that
the numbers will be different every time we run.
*/
srand( (unsigned)time( NULL ) );
/* Display 10 numbers. */
for( i = 0; i < 10;i++ )
printf( “ %6d\n”, rand() );
}
Problem is,when I use this example,I get errormessages:
CNS.obj : error LNK2019: unresolved external symbol time referenced in function "void __cdecl PrepareWheel(struct HDC__ *)" ([email protected]@[email protected]@@Z)
ARMV4Dbg/CNS.exe : fatal error LNK1120: 1 unresolved externals
Without this function,function "rand" returns all the time same sequence(as we know).
I am using Embedded Visual C++ 4.0 for PocketPC app development.
That's for now,thanks,Tomas.

HD2 Android board ID

I have been reading quite a lot regarding android-porting and notes to OEMs on writing bootloaders for android. However, due to the current situation of port on HD2, i have a small problem that is, stock android init recommends the bootloader to pass a hardware identifier string which it will use to do init. I know i cannot explain perfectly as english is not my native language, here is a quote from android-porting group:
After the kernel boot is complete, the init program in the Android root file system gets started. This program parses and executes the scripts init.rc and init.XYZ.rc, where XYZ is the name given by the hardware vendor. The XYZ has to be specified as a value for the kernel parameter “androidboot.hardware=XYZ”. The init program uses this parameter to know the name of the script it has to start. On the goldfish target, XYZ is goldfish. On HTC Desire, XYZ is bravo. ie. "androidboot.hardware=bravo" is included in the kernel cmdline, so init.bravo.rc is executed alongside.
Click to expand...
Click to collapse
I have seen roms using bravo, htcleo, leo as their hardware identifier tags. However using either one of them as static string in cLK would be impartial for either. As of MAGLDR, it passes no cmdline (as far as i've seen) since it uses the yaffs2 boot structure and there is no cmdline it attaches statically. This could also mean that the current kernels instead of depending on the bootloader supplied info, use spaghetti code which makes assumption that it is running on a leo board, which is a deterrent if we are to merge the leo codebase with mainline code such as cm-kernel.
The current possibile solutions for cLK i have brainstormed over are:
1) Let it go as it is and do not include the hardware parameter.
2) Cleanup kernel space, script file names in roms, include the hardware parameter.
3) Leave the script names as it is, cleanup kernel code and let the user supply the hardware string through fastboot.
Q) What about MAGLDR ? it is closed source, we cannot change the kernel commandline in it !
A) Ever since we had NAND boot on HD2, the devs included a special kernel atag that would signal that the kernel is booting through NAND, so if this particular atag is found then the kernel would use a static hardware string.
Code:
*ptr++ = 4; // Size of this atag. atag[0]
*ptr++ = 0x4C47414D; // NAND boot atag. atag[1]
*ptr++ = 0x004b4c63; // cLK sign tag. atag[2]
*ptr++ = 16; // cLK version tag. atag[3]
All this logic could be wrapped inside something like "#ifdef TARGET_HTCLEO" to make it more clean till i notify cotulla about this on irc and he does the needful before the mag 2.0 release.
This exact thing was put into light some time ago by Charansingh but had no proper outcome, the thread stands dead with no actual agreement between chefs.
I tried my best and read as much as i could before writting down this post, if you have any suggestions, insights, solution, correction. Please PM me and i will update this post.
I just don't get it sorry
Hi Rick,
I'm not a dev, I only try to understand how Android works by reading your sources of cLK
But in order to be "Android compliant" it should be better to include a hardware parameter.
Now if I have correctly understood your post, this hardware parameter is stored by the boot structure on native Android devices.
In HD2, yaffs2 is used and there is no need to specify any parameters with it.
But on native Android devices, how is the boot structure? yaffs2 is also used? or this an other?
I dont really know too much but when im porting bravo roms with the the get prop=bravo i change it to leo to make it boot.
john_matrix said:
Hi Rick,
I'm not a dev, I only try to understand how Android works by reading your sources of cLK
But in order to be "Android compliant" it should be better to include a hardware parameter.
Now if I have correctly understood your post, this hardware parameter is stored by the boot structure on native Android devices.
In HD2, yaffs2 is used and there is no need to specify any parameters with it.
But on native Android devices, how is the boot structure? yaffs2 is also used? or this an other?
Click to expand...
Click to collapse
The boot structure on native devices including on cLK is as follows:
Code:
#define BOOT_MAGIC "ANDROID!"
#define BOOT_MAGIC_SIZE 8
#define BOOT_NAME_SIZE 16
#define BOOT_ARGS_SIZE 512
struct boot_img_hdr
{
unsigned char magic[BOOT_MAGIC_SIZE];
unsigned kernel_size; /* size in bytes */
unsigned kernel_addr; /* physical load addr */
unsigned ramdisk_size; /* size in bytes */
unsigned ramdisk_addr; /* physical load addr */
unsigned second_size; /* size in bytes */
unsigned second_addr; /* physical load addr */
unsigned tags_addr; /* physical addr for kernel tags */
unsigned page_size; /* flash page size we assume */
unsigned unused[2]; /* future expansion: should be 0 */
unsigned char name[BOOT_NAME_SIZE]; /* asciiz product name */
unsigned char cmdline[BOOT_ARGS_SIZE]; /* kernel cmdline */
unsigned id[8]; /* timestamp / checksum / sha1 / etc */
};
/*
** +-----------------+
** | boot header | 1 page
** +-----------------+
** | kernel | n pages
** +-----------------+
** | ramdisk | m pages
** +-----------------+
** | second stage | o pages
** +-----------------+
**
** n = (kernel_size + page_size - 1) / page_size
** m = (ramdisk_size + page_size - 1) / page_size
** o = (second_size + page_size - 1) / page_size
**
*/
The cmdline argument is stored in the boot.img (for native devices and cLK) but cotulla felt that using yaffs2 is easier for testing many kernels, however you need a cwr zip package to flash a kernel in magldr, as using dwi.exe will format the phone while for cLK you can do "fastboot erase boot" and "fastboot boot zImage initrd.gz". However for cLK, the initramfs has to be reflashed with the new kernel.
Thank you Rick to reply me
Is the HD2 boot "trick" can be explain by the utilization of YAFFS2 for the whole HD2 NAND instead of EXT for native Android devices?
For example, maybe you need to specify the hardware parameter if you use EXT on the HD2 NAND (I don't know if this is possible?)
Correct me if I'm wrong (certainly )
Edit: for me, this is better to use fastboot commands in order to "manipulate" my HD2 but for the other users, I don't know. Maybe they can say to us.

[Q] Regarding USB audio (source code help)

By using the GlaDOS kernel and Usb audio recorder ROOT, I was able to listen to music with my USB headset, however I really would like a way to implement it into the kernel or the OS so I can reroute media sound to my headset with other apps.
Here's the source code of the driver... Maybe someone with more knowledge than me will be able to implement it or maybe point me in the right direction.
Code:
#ifndef __USBAUDIO_H
#define __USBAUDIO_H
/*
* (Tentative) USB Audio Driver for ALSA
*
* Copyright (c) 2002 by Takashi Iwai <[email protected]>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* handling of USB vendor/product ID pairs as 32-bit numbers */
#define USB_ID(vendor, product) (((vendor) << 16) | (product))
#define USB_ID_VENDOR(id) ((id) >> 16)
#define USB_ID_PRODUCT(id) ((u16)(id))
/*
*
*/
struct snd_usb_audio {
int index;
struct usb_device *dev;
struct snd_card *card;
struct usb_interface *pm_intf;
u32 usb_id;
struct mutex shutdown_mutex;
unsigned int shutdown:1;
unsigned int probing:1;
unsigned int autosuspended:1;
unsigned int txfr_quirk:1; /* Subframe boundaries on transfers */
int num_interfaces;
int num_suspended_intf;
struct list_head pcm_list; /* list of pcm streams */
int pcm_devs;
struct list_head midi_list; /* list of midi interfaces */
struct list_head mixer_list; /* list of mixer interfaces */
int setup; /* from the 'device_setup' module param */
int nrpacks; /* from the 'nrpacks' module param */
int async_unlink; /* from the 'async_unlink' module param */
struct usb_host_interface *ctrl_intf; /* the audio control interface */
};
/*
* Information about devices with broken descriptors
*/
/* special values for .ifnum */
#define QUIRK_NO_INTERFACE -2
#define QUIRK_ANY_INTERFACE -1
enum quirk_type {
QUIRK_IGNORE_INTERFACE,
QUIRK_COMPOSITE,
QUIRK_MIDI_STANDARD_INTERFACE,
QUIRK_MIDI_FIXED_ENDPOINT,
QUIRK_MIDI_YAMAHA,
QUIRK_MIDI_MIDIMAN,
QUIRK_MIDI_NOVATION,
QUIRK_MIDI_RAW_BYTES,
QUIRK_MIDI_EMAGIC,
QUIRK_MIDI_CME,
QUIRK_MIDI_AKAI,
QUIRK_MIDI_US122L,
QUIRK_AUDIO_STANDARD_INTERFACE,
QUIRK_AUDIO_FIXED_ENDPOINT,
QUIRK_AUDIO_EDIROL_UAXX,
QUIRK_AUDIO_ALIGN_TRANSFER,
QUIRK_AUDIO_STANDARD_MIXER,
QUIRK_TYPE_COUNT
};
struct snd_usb_audio_quirk {
const char *vendor_name;
const char *product_name;
int16_t ifnum;
uint16_t type;
const void *data;
};
#define combine_word(s) ((*(s)) | ((unsigned int)(s)[1] << 8))
#define combine_triple(s) (combine_word(s) | ((unsigned int)(s)[2] << 16))
#define combine_quad(s) (combine_triple(s) | ((unsigned int)(s)[3] << 24))
#endif /* __USBAUDIO_H */

Categories

Resources