[DEV] ICS AOSP (from CM's source) Development Passion (N1) [Alpha8]

Status
Not open for further replies.
Search This thread

pconwell

Senior Member
Aug 31, 2009
77
8
Nashville, TN
I know you're busy, but...

Can you clean up your first post instead of just mangling edits all over the place. I'm trying to keep up with what you are doing, but it's just a hodge podge of edits. Something like:

Code:
Working:
Wifi
MMS
Bluetooth
TouchScreen

Code:
Not working:
3g (severe connect/disconnect issues)
Audio
Home button
Trackball
Camera
GPS

Near the top would be awesome.

Thanks.
 
  • Like
Reactions: Bexton

skitty

Senior Member
Jul 17, 2005
207
49
I'm pretty sure drew Garen had the hard home button working in his sdk build. Maybe speak to him or have a sift through his build?
3g also is supposed to work but I never tested it as I could be bothered to enter my apn details

Sent from my Nexus One using xda premium
 

PeRKoniX

Senior Member
Jul 24, 2008
75
3
Cool that someone is developing this :D though it's still kinda slow (I hope it will get better?) it would be nice to see that bottom bar gone since N1 already has softbuttons. I know that the android emulator has similar behavior (no on-screen buttons) since the emulator has it's own menu/home/back button. Maybe it is something to look into in the future of this project :)

Nice work! Thanks allot!
 

babijoee

Retired Forum Moderator
Dec 7, 2008
1,548
163
Melbourne
Can you clean up your first post instead of just mangling edits all over the place. I'm trying to keep up with what you are doing, but it's just a hodge podge of edits. Something like:

Code:
Working:
Wifi
MMS
Bluetooth
TouchScreen

Code:
Not working:
3g (severe connect/disconnect issues)
Audio
Home button
Trackball
Camera
GPS

Near the top would be awesome.

Thanks.

I have to disagree. having the steps aswell as code encourages others to follow and help others who want to build/fix aosp. great work do far Texas.
 

DaXmax

Senior Member
Sep 16, 2008
10,846
9,928
Singapore
Great work texasice! Im waiting for a full ver from u if u successfully port... But libaudio is the problem itself or??

Sent from my Nexus One using Tapatalk
 

texasice

Retired Recognized Developer
Oct 27, 2009
603
3,434
Austin
Great work texasice! Im waiting for a full ver from u if u successfully port... But libaudio is the problem itself or??

Sent from my Nexus One using Tapatalk

DJ_Jedi and I have been investigating. We think the driver is fine but something to do with how audioflinger is handling it.
Code:
Get this when I open the phone app and press the 2 button (as a test)

createTrack_l() Bad parameter: sampleRate 44100 format 1, channelMask 0x00000001 "for output 0x103b0 with format 1
AudioFlinger could not create track, status: -22
Error creating AudioTrack
createTrack_l() Bad parameter: sampleRate 44100 format 1, channelMask 0x00000001 "for output 0x103b0 with format 1
AudioFlinger could not create track, status: -22
AudioTrack->initCheck failed
ToneGenerator init failed 
Exception caught while creating local tone generator: java.lang.RuntimeException: Init failed
playTone: mToneGenerator == null, tone: 2
Changed the audioflinger source for more detail
Code:
[ 11-19 06:20:47.159    78:0x242 E/AudioFlinger ]
createTrack_l() Bad parameter: sampleRate 44100 m 44100 format 1 m 1, channelMask 0x00000001 " m 0x00000003 for output 0x103a8 with format 1
So it is either channelMask or mChannelMask
And we're stuck here right now.
 

davelis828

Senior Member
Jan 30, 2010
130
5
Yea here's one that I wrote

Heres my logcat error if anyone knows what it means:

Code:
I/SystemServer(  152): Audio Service
E/AudioFlinger(   78): createTrack_l() Bad parameter: sampleRate 44100 format 1, channelMask 0x00000001 "for output 0x103b0 with format 1
E/AudioTrack(  152): AudioFlinger could not create track, status: -22
E/SoundPool(  152): Error creating AudioTrack
E/AudioFlinger(   78): createTrack_l() Bad parameter: sampleRate 44100 format 1, channelMask 0x00000001 "for output 0x103b0 with format 1
E/AudioTrack(  152): AudioFlinger could not create track, status: -22
repeat

Another logcat

I did adb logcat | grep Network

http://logcat.miui.us/506018

Here's one with logcat -b radio

http://logcat.miui.us/500034

thanx fella!
 

DaXmax

Senior Member
Sep 16, 2008
10,846
9,928
Singapore
DJ_Jedi and I have been investigating. We think the driver is fine but something to do with how audioflinger is handling it.
Code:
Get this when I open the phone app and press the 2 button (as a test)

createTrack_l() Bad parameter: sampleRate 44100 format 1, channelMask 0x00000001 "for output 0x103b0 with format 1
AudioFlinger could not create track, status: -22
Error creating AudioTrack
createTrack_l() Bad parameter: sampleRate 44100 format 1, channelMask 0x00000001 "for output 0x103b0 with format 1
AudioFlinger could not create track, status: -22
AudioTrack->initCheck failed
ToneGenerator init failed 
Exception caught while creating local tone generator: java.lang.RuntimeException: Init failed
playTone: mToneGenerator == null, tone: 2
Changed the audioflinger source for more detail
Code:
[ 11-19 06:20:47.159    78:0x242 E/AudioFlinger ]
createTrack_l() Bad parameter: sampleRate 44100 m 44100 format 1 m 1, channelMask 0x00000001 " m 0x00000003 for output 0x103a8 with format 1
So it is either channelMask or mChannelMask
And we're stuck here right now.

This logcat is somehow similar to my fellas at Optimus One while porting ICS.... One of the users manage to get the audio working but....

Sent from my Nexus One using Tapatalk
 

twistedddx

Senior Member
Oct 23, 2010
963
577
In one version of code I just skim read on CodeAurora, maybe not 4.0 code?:

channelCount is suppose to be an int.
If you do createTrack with channelCount set as 0 it will just set it to 2.
1 will be mono, 2 for stereo, all other values are invalid and will throw BAD_VALUE aka -EINVAL aka -22.

In theory 0x00000001 is valid(hopefully it's not being converted to a text string or something?!) but I saw a 0x00000003 also in your logs which would be invalid.

It can throw BAD_VALUE for more things than just setting a channelCount above 2.

I would start by proving you are REALLY setting channelCount as either 0, 1 or 2 and NOTHING else.


Edit: From other code i Just read on gitorious, is this 4.0 code?:
The only place I can find the same error output is in:
http://www.gitorious.org/0xdroid/fr...4a39b09278/libs/audioflinger/AudioFlinger.cpp

if (sampleRate != mSampleRate || format != mFormat || channelCount != mChannelCount) {
LOGE("createTrack_l() Bad parameter: sampleRate %d format %d, channelCount %d for output %p",
sampleRate, format, channelCount, mOutput);
lStatus = BAD_VALUE;
goto Exit;
}

I assume:
createTrack_l() Bad parameter: sampleRate 44100 m 44100 format 1 m 1, channelMask 0x00000001 " m 0x00000003 for output 0x103a8 with format 1

Is where you also printed the mChannelCount which was 0x00000003, but channelCount was at 0x00000001 and because they are not equal it throws the error.
Sounds like an AudioTrack object was created with mchannelCount as 3 instead of 1, then moments later you have channelCount as 1 and the code fails.

Why was the AudioTrack created with mchannelCount 3? I think if its created with no params it creates it as CHANNEL_OUT_STEREO
CHANNEL_OUT_STEREO = (CHANNEL_OUT_FRONT_LEFT | CHANNEL_OUT_FRONT_RIGHT),
CHANNEL_OUT_FRONT_LEFT = 0x4,
CHANNEL_OUT_FRONT_RIGHT = 0x8,

Which leads to 0x00001100 which is kind of close to, but entirely not, 0x00000011 which in hex would read 0x000003 :p

So well I have no great ideas where the problem stems from. Track down when the AudioTrack gets created, if you are setting it up with or without params. If without it'll set as stereo unless you later go back to re-set the channelCount correctly to your desired 1.
 
Last edited:

JieeHD

Retired Recognized Developer
Dec 29, 2010
734
388
Glasgow
Code:
AudioStreamOut* AudioHardware::openOutputStream(
        uint32_t devices, int *format, uint32_t *channels, uint32_t *sampleRate, status_t *status)
{
    { // scope for the lock
        android::Mutex::Autolock lock(mLock);

        // only one output stream allowed
        if (mOutput) {
            if (status) {
                *status = INVALID_OPERATION;
            } else { 
				LOGD("Output stream already exists, using existing channels and format"); 
				*status = NO_ERROR; 
			} 
		} 
		return mOutput; 
	}

        // create new output stream
        AudioStreamOutMSM72xx* out = new AudioStreamOutMSM72xx();
        status_t lStatus = out->set(this, devices, format, channels, sampleRate);
        if (status) {
            *status = lStatus;
        }
        if (lStatus == NO_ERROR) {
            mOutput = out;
        } else {
            delete out;
        }
    }
    return mOutput;
}


Hoping this should fix audio issues, will try it when I have time.
 

crazybyte

Senior Member
Jan 24, 2007
87
6
Code:
AudioStreamOut* AudioHardware::openOutputStream(
        uint32_t devices, int *format, uint32_t *channels, uint32_t *sampleRate, status_t *status)
{
    { // scope for the lock
        android::Mutex::Autolock lock(mLock);

        // only one output stream allowed
        if (mOutput) {
            if (status) {
                *status = INVALID_OPERATION;
            } else { 
				LOGD("Output stream already exists, using existing channels and format"); 
				*status = NO_ERROR; 
			} 
		} 
		return mOutput; 
	}

        // create new output stream
        AudioStreamOutMSM72xx* out = new AudioStreamOutMSM72xx();
        status_t lStatus = out->set(this, devices, format, channels, sampleRate);
        if (status) {
            *status = lStatus;
        }
        if (lStatus == NO_ERROR) {
            mOutput = out;
        } else {
            delete out;
        }
    }
    return mOutput;
}


Hoping this should fix audio issues, will try it when I have time.

In this code you're not relasing the mutex... i think that we have to relase it before return...
 

crazybyte

Senior Member
Jan 24, 2007
87
6
I cant write any line of code because i doesn't know where to find info about the NDK api, in android. But if in some pice of code we do a lock(mutex&) it's mandatory to do a relase(mutex&). Otherwise it will make a deadlock...

In other topic we saw that someone found the 3.0 android source. It's good idea to check the code associated to the non working parts and see the difference with the CM7 kernel.
 
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 85
    This thread has been superseded by this thread: http://xdaforums.com/showthread.php?t=1366897

    Changelog in Second Post:
    Screenshots attached at bottom:

    Link to Alpha8
    This tarball also contains a userdata image where most of the gapps are.
    People whose rotation/bluetooth doesn't work: Try flashing this new boot.img and see if it fixes it.
    I will not be uploading any more flashable zips as they seem to be broken

    Working:
    Wifi
    MMS
    Calling (People I talk to say they can hear me better than the could when i was on CM7)(Probably coincidence)
    Bluetooth (works for babijoee but broken for me)
    TouchScreen (Multitouch)
    Sound (Flawless)
    GPS (works for me)
    Accelerometer (rotation) (works for babijoee but broken for me)
    Home button
    3g (seems to like radio 5.08.00.04)(works for me)
    Headphone jack
    Network Stats and Quota
    Not Working:
    Trackball
    Camera
    USB mass storage (use adb)
    Hardware Accelaration
    Wifi Signal Strengh Icon in Status Bar.
    Questions? Check out this FAQ (thanks alex_mobile)
    Anyone that wants to colaborate
    Join us in #ics_desire_nexus_dev on freenode
    My nick is drewis.
    Any help is welcome.

    To flash the img files.
    Code:
    tar xjf ics-passion-alpha*.tar.bz2
    adb reboot bootloader
    fastboot -w
    fastboot flash system system.img
    fastboot flash userdata userdata.img
    fastboot flash boot boot.img
    fastboot reboot
    I'm using blackrose hboot (standard partitioning) but i dont think it matters what hboot you use.

    Don't tell me whats wrong with it (i already know that) Tell me how to fix it!

    Here's my sources to get you started:

    I have set up an organization on git hub where you can follow the progress
    https://github.com/ics-passion-dev
    [Note:] I am updating these regularly.

    Get source (cm ics repos)
    Code:
    repo init -u git://github.com/ics-passion-dev/android.git -b ics
    repo sync
    Fix Audio.
    Code:
    cd hardware/msm7k
    git fetch http://review.cyanogenmod.com/p/CyanogenMod/android_hardware_msm7k refs/changes/03/10303/1 && git cherry-pick FETCH_HEAD
    Build it.
    Code:
    . build/envsetup.sh
    lunch full_passion-userdebug
    mka
    Note: The above is not enough to get a clean build you will need to debug some minor errors.

    On amd hexacore w/ 12gb ram takes 40 minutes. (where CM7 takes 14)
    15
    CHANGELOG

    CHANGELOG
    Alpha8 Link to Alpha8
    New apn list from cm
    Update gapps with ones from koush's NS build.
    Headphone fix (thanks zivan56)
    Back to pershoot's BFS kernel as base.
    Added network stats and quota to kernel.
    Built with opengl enabled (currently causing blank screen)(REMOVED)(still no HWAccel)(disable Window/Transition effects makes it much nicer)

    Alpha7 Link to: Alpha7
    Same as alpha6
    Rebuilt with openjdk (this is aosp after all)
    Added Gmail and Market
    Market: login, try and download an app (only one), it will error. Reboot. Open market and it should start downloading. Then you're good.
    Market: I wiped and now market does not work. same error. Can't seem to fix it.
    Change to IntersectRaven's 2.6.38.8 AVS Kernel based on pershoot's

    Alpha6 Link to: Alpha6
    Added liba2dp for audio over bluetooth. (untested) (removed: caused build problems)
    AUDIO FIX: a real audio fix (thank you firesnatch [sean neeley])
    Head phone jack does not work yet. plays through speaker while plugged in.
    added back all apps but VideoEditor and its libs and Camera
    added back all ringtones and notifications
    switched back to userdebug build
    No gapps: Sorry. They were deleted when i rebased my tree. But they had issues anyway. So not bothering with them on this release.
    gralloc's back (hence the lag) Disabling animation in developer settings helps.
    3g seems to start the connect/disconnect thing after a while of non use. fix is either reboot. or go into setting and disable mobile data for a minute then turn it back on.


    Alpha5: Link to Alpha5
    switched from userdebug to eng variant
    got su back and some bluetooth files (still broke for me)
    removed most sounds (ringtones,notifications) to save some space
    removed apps: Camera, VideoEditor, libWnnJpnDic, PinyinIME, Email, Exchange, libvideoeditor_jni, libvideoeditorplayer, libvideoeditor_core
    Added Gapps: Market wont show up untill you sign in through settings
    Issues: screen now flashes an orange outline on edge of screen when you click some buttons

    Alpha4: Link to Alpha4 as system and boot images
    Home button works! (thanks again to rampv78)
    Removed soft buttons
    Changed lcd density back to 240

    Alpha3:Link to Alpha3 as a flashable zip
    Rebase latest changes in CM tree.
    Try new GPS code in CM gerrit.
    Better Audio fix: Still broken but more stable (closer to working out a real fix)
    Leave out gralloc since we dont have HW Acceleration yet.

    Alpha2:Link to Alpha2 as a flashable zip
    changed ro.sf.lcd_density to 220 to fix softkeys
    build with gralloc: kind of makes it laggy if it bothers you delete /system/lib/hw/gralloc.qsd8k.so (but not gralloc.default.so)
    Working:
    Calling: (mic works they can hear you)
    Sound/Mic: sort of (thanks to tip from rapmv78 and the Desire guys)
    Gps: I think (might just be googles location features even though its unchecked in settings)(tested by visiting maps.google.com in browser with wifi off)
    Not Working:
    3g: still very sporadic (a few reboots fixes it somtimes)(maybe i need to update to latest radio)
    Home button
    Trackball

    Alpha1: Link to Alpha1 as system.img and boot.img
    Migrate source to CM repos
    Using ICS init (alpha0 used CM7)
    Pershoots CM7 2.6.38.8 Kernel
    Added Soft Buttons to give us a working home button (although this causes the bottom row of the keyboard to be half way covered up) You can fix this by changing ro.sf.lcd_density to 220 or 200 in /system/build.prop
    Not working:
    3g (severe connect/disconnect issues)
    Audio
    Home button
    Trackball
    Some other stuff I can't remember
    12
    Alpha8 released. No HWAccel (sorry). But market works. headset. and network stats. Plus more gapps.
    7
    The driver structure looks very similar. I would guess that all you only need to change is https://github.com/pershoot/kernel-2638/blob/master/arch/arm/mach-msm/htc_35mm_jack.c

    and remove line 224:
    hi->ext_35mm_status |= BIT_35MM_HEADSET;

    This value makes the sysfs have a value of 120 instead of 2.
    #define BIT_35MM_HEADSET (1 << 7)

    ThankYou! this fixed it. packaging and uploading new kernel now.

    [edit] uploaded see OP
    4
    Presenting WORKING wifi! see OP