I don't see the logs from init when it tries to fork/exec mediaserver.
That step must be failing, probably because it doesn't find the .so,
but I don't see the log.  Maybe it's scrolled off, or is in another log?
(dmesg is usually for kernel, but it's worth taking a look there)

See system/core/rootdir/init.rc and search for "service media 
/system/bin/mediaserver".
That's what tells init to fork/exec mediaserver, which contains 
AudioFlinger.

Besides looking at more and earlier logs, you could instrument the .so 
dynamic loader
in bionic.   Another suggestion is to copy your .so to /system/lib/ as a 
test.

On Wednesday, October 30, 2013 12:52:30 PM UTC-7, Kieran Cox wrote:
>
> Hello,
>
> First, thanks in advance for taking a look and any help you can offer.
>
> I have made some modifications for AudioFlinger that have the dependency 
> of a prebuilt external library. Initially I linked the library in as a 
> static library. To facilitate this I added a new folder for my library at 
> "androidRoot/external/libaudiodsp". Inside that directory I dropped in the 
> *.so and *.a library files. The necessary include files are also added in a 
> sub-directory "androidRoot/external/libaudiodsp/include"
>
> I also added a brief Android.mk file:
> ****
> LOCAL_PATH:= $(call my-dir)
> include $(CLEAR_VARS)
>
> LOCAL_PREBUILT_LIBS := libaudiodsp.a
> #LOCAL_PREBUILT_LIBS := libaudiodsp.so
>
> include $(BUILD_MULTI_PREBUILT)
> ****
>
> Then I added the new external library to the "build/core/pathmap.mk" 
> file. (see attached)
>
> After making two small changes to the AudioFlinger Android.mk file, namely:
> LOCAL_C_INCLUDES := \
>     $(call include-path-for, audio-effects) \
>     $(call include-path-for, audio-utils) \
>     $(call include-path-for, libaudiodsp)
>
> LOCAL_STATIC_LIBRARIES := \
>     libscheduling_policy \
>     libcpustats \
>     libmedia_helper \
>     libaudiodsp
>
> Viola, everything builds, and runs as expected.
>
> Now I went to try to use the shared library. Which requires me commenting 
> out the *.a file and commenting in the *.so in the 
> external/libaudiodsp/Android.mk file.  I  removed "libaudiodsp" from 
> the LOCAL_STATIC_LIBRARIES tag in the AudioFlinger Android.mk file.  I then 
> added it to the shared library tag, ie:
> LOCAL_SHARED_LIBRARIES := \
>     libaudioutils \
>     libcommon_time_client \
>     libcutils \
>     libutils \
>     libbinder \
>     libmedia \
>     libmedia_native \
>     libnbaio \
>     libhardware \
>     libhardware_legacy \
>     libeffects \
>     libdl \
>     libpowermanager \
>     libaudiodsp
>
> Everything then builds/compiles just fine. However, the system now will 
> not boot! It's stuck in the initial Android bootup screen. The logs show 
> issues with AudioPolicyService and Media player service (see attached 
> crashlog.txt):
>
> W/AudioSystem(  718): AudioPolicyService not published, waiting...
> I/ServiceManager(  718): Waiting for service media.player...
> I/ServiceManager(  718): Waiting for service media.audio_policy...
> I/ServiceManager(  718): Waiting for service media.player...
> I/ServiceManager(  718): Waiting for service media.audio_policy...
> W/IMediaDeathNotifier(  718): Media player service not published, 
> waiting...
> I/ServiceManager(  718): Waiting for service media.audio_policy...
> I/ServiceManager(  718): Waiting for service media.player...
> I/ServiceManager(  718): Waiting for service media.audio_policy...
> I/ServiceManager(  718): Waiting for service media.player...
> I/ServiceManager(  718): Waiting for service media.audio_policy...
>
>
> I've read quite a few posts about adding shared libraries, even rebuilt 
> the *.so with the Android toolkit and nothing seems to help thus far. 
>
> I tried changing the external/libaudiodsp/Android.mk file to the 
> following, but it made no difference:
> LOCAL_PATH:= $(call my-dir)
> include $(CLEAR_VARS)
> LOCAL_MODULE := libaudiodsp
> LOCAL_SRC_FILES := libaudiodsp.so
> LOCAL_MODULE_TAGS := optional
> LOCAL_MODULE_CLASS := SHARED_LIBRARIES
> LOCAL_MODULE_SUFFIX := .so
> include $(BUILD_PREBUILT)
>
> An attempt was made to add "LOCAL_REQUIRED_MODULES := libaudiodsp" to the 
> AudioFlinger Android.mk file. Again this had no effect, system hangs in the 
> same manner.
>
> I tried making a "shared static" library. In which the library itself was 
> shared, but all of it's dependencies were linked into the *.so statically. 
> This change again had no effect on the crash.
> Example:
> $CPP -shared -static -o libaudiodsp.so \
> -Wl,--whole-archive libaudiodsp.a \
> -Wl,--no-whole-archive
>
> Unfortunately only solution that works is retreating back to the static 
> library configuration. :-(
>
> Since the only thing that changed was converting the static library to a 
> shared library, it would seem that the new dependency on the shared library 
> is not being properly propagated through the build system (also not  being 
> checked/verified as a dependency) and is thus causing a crash during 
> bootup. This is confusing as the entire system rebuilt without error, even 
> after doing a fresh build from scratch as opposed to a rebuild.
>
> Any ideas or suggestions?
>
>
> Thanks again,
> Kieran
>
>
>

-- 
-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting

--- 
You received this message because you are subscribed to the Google Groups 
"android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to