Results 1 to 8 of 8
  1. #1
    firesnatch's Avatar
    offline Developer
    Join Date
    Jan 2008
    Location
    Chicago
    Posts
    185
    Thanks
    76
    Thanked 342 Times in 82 Posts
    Downloads
    14
    Uploads
    0

    Need help building a working libaudio.so library

    I was able to compile a working kernel using the instructions I found on this forum. However, i'm having trouble building the files in the hardware folder. In particular, i'm trying to do 'mmm -B hardware/msm7k/libaudio' to get a custom libaudio.so built. Are there any instructions out there?

    12/13 UPDATE:

    I was able to get it built and working. This is roughly what I did:

    Part 1, Get the source

    Code:
    mkdir ~/android-src
    cd android-src
    repo init -u git://android.git.kernel.org/platform/manifest.git -b android-2.1_r1
    repo sync
    *Don't* run make

    Code:
    mkdir ~/cliq-src
    cd ~/cliq-src
    Download all of the Cliq 2.1 source code.  
    Uncompress the archives and run the unpack scripts
    cp -r * ~/android-src
    Part 2, get static library libaudiointerface.a built

    Pull the following files from your phone

    Code:
    /system/lib/liba2dp.so
    /system/lib/libbinder.so
    /system/lib/libhardware_legacy.so
    /system/lib/liblog.so
    /system/lib/libmedia.so
    and put them in

    Code:
    ~/android-src/out/target/product/generic/obj/lib
    Add these near the top of ~/android-src/frameworks/base/libs/audioflinger/Android.mk

    Code:
    BOARD_HAVE_BLUETOOTH := true
    BOARD_USES_GENERIC_AUDIO := false
    Code:
    . build/envsetup.sh
    mmm -B frameworks/base/libs/audioflinger
    Part 3, Build libaudio

    Add these near the top of ~/android-src/hardware/msm7k/libaudio/Android.mk

    Code:
    BOARD_HAVE_BLUETOOTH := true
    BOARD_USES_QCOM_7x_CHIPSET := true
    Put these defines near the top of ~/android-src/hardware/msm7k/libaudio/AudioHardware.h and AudioPolicyManager.h:
    Code:
    #define DEVICE_OUT_TTY 0x2000
    #define MOT_FEATURE_PLATFORM_MSM7K 1
    Code:
    mmm -B hardware/msm7k/libaudio
    Last edited by firesnatch; 12-14-2010 at 08:25 AM.

  2. The Following User Says Thank You to firesnatch For This Useful Post:

    adlx (12-14-2010)

  3. #2
    fkcoder's Avatar
    offline Itty Bitty Modder
    Join Date
    Aug 2010
    Posts
    10
    Thanks
    1
    Thanked 8 Times in 3 Posts
    Downloads
    3
    Uploads
    0
    See audioflinger source.

    Code:
    // frameworks/base/libs/audioflinger/AudioHardwareInterface.cpp
     #ifdef GENERIC_AUDIO
         hw = new AudioHardwareGeneric();
     #else
         // if running in emulation - use the emulator driver
         if (property_get("ro.kernel.qemu", value, 0)) {
             LOGD("Running in emulation - using generic audio driver");
             hw = new AudioHardwareGeneric();
         else {
              LOGV("Creating Vendor Specific AudioHardware");
              hw = createAudioHardware();
     #endif
         if (hw->initCheck() != NO_ERROR) {
             LOGW("Using stubbed audio hardware. No sound will be produced.");
             delete hw;
             hw = new AudioHardwareStub();
    Change it to create your class, for example

    Code:
        hw = new AudioHardware();
    
        if (hw->initCheck() != NO_ERROR) {
            LOGW("Using stubbed audio hardware. No sound will be produced.");
            delete hw;
            hw = new AudioHardwareStub();

  4. 2 Users Say Thank You to fkcoder For This Useful Post

    adlx (12-13-2010), Pzyduck (12-13-2010)

  5. #3
    adlx's Avatar
    online Maker of adlxmod
    Join Date
    Jan 2010
    Location
    Madrid, Spain
    Posts
    1,034
    Thanks
    610
    Thanked 1,485 Times in 366 Posts
    Downloads
    30
    Uploads
    0
    Very interesting thanks.

    How do you find out the list of libs you need to pull out of the phone and copy to ~/android-src/out/target/product/generic/system/lib?

    In the particular case of libaudio.so, I could list the phone's lib dependencies (Cliq with Motoblur build 2.1.5):

    libaudio.so depends on all the following libs:

    liblog.so
    libcutils.so
    libutils.so
    libmedia.so
    libhardware_legacy.so
    libdl.so
    liba2dp.so
    libc.so
    libstdc++.so
    libm.so

    but I can see that list isn't the same as the one you needed to pull from the phone. So there may be another explaination :-)

    FYI build your own aosp for backflip 2.1 also has relevant information about the subject.
    Last edited by adlx; 12-14-2010 at 04:48 AM. Reason: Automerged Doublepost
    Download my 1-click Recovery Flasher to flash a custom or stock recovery to your phone: Cliq, CliqXT, Backflip, ...

    Like my work? Support me: & visit my adlxmod site and follow me on Twitter
    Tambien me puedes encontrar en Movilzona (Esp)

  6. #4
    firesnatch's Avatar
    offline Developer
    Join Date
    Jan 2008
    Location
    Chicago
    Posts
    185
    Thanks
    76
    Thanked 342 Times in 82 Posts
    Downloads
    14
    Uploads
    0
    Quote Originally Posted by adlx View Post
    Very interesting thanks.

    How do you find out the list of libs you need to pull out of the phone and copy to ~/android-src/out/target/product/generic/system/lib?
    [MENTION=3081367]adlx[/MENTION], Before copying the libs, I ran the mmm command to build the library and it would complain about a missing .so. I would then copy over that .so and repeat. The list I posted might be incomplete. I built libaudio.so a few days ago and was going off the date stamps on my files to see which ones I might have copied. Start with my list, and if there are others needed, copy them over one at a time and let me know so I can update my post.

  7. #5
    adlx's Avatar
    online Maker of adlxmod
    Join Date
    Jan 2010
    Location
    Madrid, Spain
    Posts
    1,034
    Thanks
    610
    Thanked 1,485 Times in 366 Posts
    Downloads
    30
    Uploads
    0
    Quote Originally Posted by firesnatch View Post
    [MENTION=3081367]adlx[/MENTION], Before copying the libs, I ran the mmm command to build the library and it would complain about a missing .so. I would then copy over that .so and repeat. The list I posted might be incomplete. I built libaudio.so a few days ago and was going off the date stamps on my files to see which ones I might have copied. Start with my list, and if there are others needed, copy them over one at a time and let me know so I can update my post.
    Thanks for the answer. Before seeing the answer I actually ran the commands (without copying the libs), and I got the 1rst error:


    make: *** No rule to make target `out/target/product/generic/obj/lib/liba2dp.so', needed by `out/target/product/generic/obj/SHARED_LIBRARIES/libaudioflinger_intermediates/LINKED/libaudioflinger.so'. Stop.


    So, I can see that I am actually following your same steps LOL

    Just a correction, in my case at least I had to copy the liba2dp.so to out/target/product/generic/obj/lib/, (obj, not system)

    Actually yesterday I saw that same error when issuing a make command, and I didn't know how to solve it. Thanks!
    Last edited by adlx; 12-14-2010 at 07:32 AM.
    Download my 1-click Recovery Flasher to flash a custom or stock recovery to your phone: Cliq, CliqXT, Backflip, ...

    Like my work? Support me: & visit my adlxmod site and follow me on Twitter
    Tambien me puedes encontrar en Movilzona (Esp)

  8. The Following User Says Thank You to adlx For This Useful Post:

    firesnatch (12-14-2010)

  9. #6
    firesnatch's Avatar
    offline Developer
    Join Date
    Jan 2008
    Location
    Chicago
    Posts
    185
    Thanks
    76
    Thanked 342 Times in 82 Posts
    Downloads
    14
    Uploads
    0
    Quote Originally Posted by adlx View Post

    Just a correction, in my case at least I had to copy the liba2dp.so to out/target/product/generic/obj/lib/, (obj, not system)
    You are right. I'll update my post. I was going off memory, and my memory isn't so good these days
    Last edited by firesnatch; 12-14-2010 at 08:27 AM.

  10. #7
    bestialbub's Avatar
    offline Operator3B
    Join Date
    Sep 2010
    Location
    bakersfield, ca
    Posts
    702
    Thanks
    191
    Thanked 406 Times in 215 Posts
    Downloads
    18
    Uploads
    4
    for reference, its always possible to find official documentation from an authority.

    Audio | Android Open Source

    ILLUSTRATES and documents a recommended method for importing/creating your audiolib. disregard if you already have your answer.

    the url provided appears to be part of a larger audio library documentation not available on android.com but appears to be available here;

    Android - Porting Guide
    Last edited by bestialbub; 12-14-2010 at 10:21 AM. Reason: Automerged Doublepost

  11. The Following User Says Thank You to bestialbub For This Useful Post:

    adlx (12-14-2010)

  12. #8
    offline Itty Bitty Modder
    Join Date
    Jan 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Downloads
    0
    Uploads
    0
    Nice to know this

    Sent from my Droid using Tapatalk

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •