[Galaxy Tab Q&A, Help & Troubleshooting] daniel.weck:
- UPDATE 16 February 2011 -

Attached to this post is the relevant FM source code extracted from the CyanogenMod git repository [1] and merged into the AOSP code base (note that so far I haven't used any of the "Update1" source code released by Samsung, but this would be advisable). This is not a straight copy from CM, I manually imported the FM-related code snippets (CM tweaks the audio framework further, with effects, etc.).

The good news is that this compiles fine, the bad news is that when I copy the resulting libs to the device, the Tab gets stuck at the Samsung logo. :o

/system/lib/libandroid_runtime.so

/system/lib/libaudioflinger.so

/system/lib/libmedia.so

/system/lib/libmedia_jni.so

At this stuck boot stage, I was able to open an ADB session, but /proc/kmsg (and other logs) were not showing any obvious problems so I couldn't diagnose the actual issue. I mounted the SD card (onto which I had a backup of the original libraries), and I restored the *.so files. The Tab immediately generated the audio welcome cue and booted to completion. :cool: So I guess that my newly-compiled libraries set was blocking the audio system, somehow.

At any rate, more work is needed to understand how to build required framework bits from AOSP so that they work on the Tab. Maybe there is more to it than just the aforementioned 4 *.so libs. For example, I'm not sure where these files take part:

media/java/android/media/AudioManager.java

media/java/android/media/AudioService.java

media/java/android/media/AudioSystem.java

media/java/android/media/MediaRecorder.java

Furthermore, I wonder how to setup the /dev/radio0 at kernel level ? It doesn't even seem to be needed at all, because the code ignores the device path altogether !! :confused: (/dev/radio0 would be a video-for-Linux v4l device, possibly required by the FM framework...although access to the Broadcom BCM4329 chipset seems to be direct in the source code) I can't see any obvious kernel diff on the CyanogenMod repository, so I'm a bit stuck to be honest ! :( Ultimately the v4l device should allow us to query the FM functionality directly: [v4l2-ctl -d /dev/radio0 --all -L], but it looks like CyanogenMod implements a FM hack by querying hci_w().

Talking about CM, it is clear that Techomancer's porting effort is worth mentioning, as it may be possible to enable FM support more easily there: https://github.com/techomancer / http://xdaforums.com/showthread.php?t=931857

The FM app compiles fine (I just dropped the source code [2] straight into the AOSP tree). The only problem I have is JAR/APK signing, but I could use Eclipse to build the app separately from the AOSP build system. I haven't bothered, there's no point spending time on this until the FM driver/kernel stuff works. ;)

Cheers, Daniel

[1]

https://github.com/CyanogenMod/andr...mmit/350dcf82f0c95d15ae286240d9792a6d90891f4e

[2]

https://github.com/CyanogenMod/android_packages_apps_FM

Here's a bunch of useful links:

http://www.ifixit.com/Teardown/Samsung-Galaxy-Tab-Teardown/4103/2

http://hk.samsungmobile.com/ENG/mobile-phones/samsung-galaxytab-specification

https://www.codeaurora.org/gitweb/quic/la/?p=platform/packages/apps/FM.git;a=summary

http://android.git.kernel.org/?p=pl...it;h=f427424c414886903e4ad654c143c8ce6ec10e3c

https://www.codeaurora.org/gitweb/q...o;hb=487ae541eb618b91431d0a19ae0a6eab1f6019aa

https://github.com/millenomi/nomadikradio

http://gitorious.org/0xdroid/packages_apps_fm/trees/master/src/com/quicinc/fmradio/

https://github.com/j-r0dd/android_packages_apps_FM/tree/froyo/src/com/quicinc/fmradio/

http://www.miui.com/thread-1687-1-1.html

http://android.modaco.com/content-page/318792/how-to-tune-a-fm-radio-station/page/40/#entry1422743

http://forum.cyanogenmod.com/topic/10377-qrequest-fm-radio-on-bcm4325-phones/