As for I know you wont find a standard API set for FM radio in
Android, cos Google doesn't supports FM by default and so all the
vendors are using there own home brew FM framework.
One such thing is Texas Instruments FM radio solution below links give
you the details
Regards
Manju
Regards
Manju
> --
> unsubscribe: android-porti...@googlegroups.com
> website: http://groups.google.com/group/android-porting
--
Regards
Halli
The complete source code is at below location
Regards
Manju
--
Regards
Halli
Hi Manju, Could you share the SOP to build source code as SDK if available ? Thanks in advance. Regards, John Lee --- 12/3/22 (四),halli manjunatha <halli...@gmail.com> 寫道:
|
|
|
|
|
|
If your driver is V4L2 compliant then you can just use the complete
solution straight forward with minimal changes to JNI part which is at
service/src/jni/JFmRxNative.cpp for FM RX and
service/src/jni/JFmTxNative.cpp for FM TX
Regards
Manju
--
Regards
Halli
Once after booting the board you will have /dev/radio0 entry for your FM radio.
Seems you need to change the /dev/radio0 permissions to "666"
you can use the kfmapp (V4L2 compliant FM test application) at below
location to validate your FM driver.
http://git.omapzoom.org/?p=platform/hardware/ti/wpan.git;a=tree;f=tools/kfmapp;h=710184f873149f05c0550253419872ad8a0cce1d;hb=d03a9f4296d7b8523ad857dcf225287ab7d51a90
So if your FM driver is fully compliant with the V4L2 specifications then,
copy the complete FM GUI solution to package/apps/ of your Android
source code and build it, this create following
1) system/lib/libfmradio.so
2) system/etc/permissions/com.ti.fm.fmradioif.xml
3) system/app/FmRxApp.apk
4) system/app/FmTxApp.apk
5) system/app/FmService.apk
Now copy these binaries to your filesystem and boot the board.
Now you can see 2 icons on your android application pane one for FM RX
and one for FM TX, just launch the FM RX icon which eventually opens
the /dev/radio0
Regards
Manju
On Tue, Mar 27, 2012 at 10:37 AM, Ranganath TM
--
Regards
Halli
In the parent folder within which this kfmapp folder is present you
have to have below line to use the Android.mk of kfmapp.
include $(call first-makefiles-under,$(call my-dir))
I think this will solve your problem.
Regards
Manju
--
Regards
Halli
Sorry for delayed response.
Even I never used this app on Eclipse.
But you can try it by removing the dependicies of JNI layer in FM RX
JAVA files (FM/FmRxApp/src/com/ti/fmrxapp/FmRxApp.java).
Regards
Manju
--
Regards
Halli
Does your driver supports ioctl VIDIOC_S_HW_FREQ_SEEK? seems its not.
Thing is FM JNI calls this v4l2 ioctl when you do seek from the GUI.
Can you give me the link to your driver so that we can verify this.
If your driver is not supporting VIDIOC_S_HW_FREQ_SEEK ioctl then need
to tweek the FM JNI so that it will do SET_FREQ (for 200KHz gap
between 2 channels) and check the signal strength if signal strength
is good enough then come outt of seek else check next frequency.
Meanwhile you can check the set_freq by selecting
(menu->set_frequency-> enter the frequency desired in MHz).
Regards
Manju
On Wed, Apr 18, 2012 at 10:27 AM, Ranganath TM
--
Regards
Halli
Hi,
The error message indicates that the JNI layer is not able to find the vendor specific handler as already indicated by Manju.
The vendor driver is seeked run time in /system/lib on phone. To support the usage of different TX and RX chip, the search will first be done for a library libfmradio.(*)_rx.so (rx mode) / libfmradio.(*)_tx.so (tx mode), if neither is found it will try to load libfmradio.(*).so.
Therefore if you are using the STE FM Radio framework, the vendor library naming format should be of type..
libfmradio.(*)_rx.so
libfmradio.(*)_tx.so
libfmradio.(*).so
Best Regards,
Anupam
ST-Ericsson
Hi Ranganath,
Okay, looks like it’s an event which could not be mapped to a valid V4L2 format..
Can you please check what kind of event you receive from FM chip once scan is completed?
Btw, I assume you are using STE vendor plugin?
BR,
-Anupam
Hi Ranganath,
Yes Sure, can You please send me the file radio-cg2900.c? I would like to have a look into the code..
Hi Ranganath,
It seems You are using ST-Ericsson connectivity chipset(cg2900 ?). I would like to understand what is the activity that You are involved in?
Are you working on GingerBread code base(which kernel?) ? Also can You please send me the links from where You have accessed the STE vendor driver and FM kernel driver code?
Looks like the code You are using is quite old..
Thank You very much for the clarifications!
BR,
-Anupam
From: Ranganath TM [mailto:rangan...@asmaitha.com]
Sent: Tuesday, April 24, 2012 11:28 AM
To: Anupam ROY
Cc: halli manjunatha; Shivanagouda Biradar
Subject: Re: [android-porting] Porting FM In Android Along With The Application
Hello Anupam ,
Thanks for your support.
The events is handled in the file cg2900_fm_api.h ,
enum cg2900_fm_event {
CG2900_EVENT_NO_EVENT,
CG2900_EVENT_SEARCH_CHANNEL_FOUND,
CG2900_EVENT_SCAN_CHANNELS_FOUND,
CG2900_EVENT_BLOCK_SCAN_CHANNELS_FOUND,
CG2900_EVENT_SCAN_CANCELLED
};
I am also attaching the .h file please go through the file and confirm once from your end , and let me know if any changes needed.
Thanks ,
RanganathOn Tue, Apr 24, 2012 at 9:57 AM, Anupam ROY <anupa...@stericsson.com> wrote:
Hi Ranganath,
Can You please check whether you are supporting different events(Search channel found, scan channel found, scan cancelled etc) in cg2900_fm_api.h?
The case “V4L2_CID_CG2900_RADIO_GET_INTERRUPT” is indeed missing, but if You don’t support the above events, this particular case would not work as it is!
Hi Ranganath,
Possibly the CG2900 connectivity device could not initiate properly.
During this initialization, various MFD device nodes are also created. All these nodes should be available in /dev folder for e.g..
cg2900_audio
cg2900_bt_acl
cg2900_bt_audio
Only after this, FM Radio kernel driver is probed and registered as platform driver.
For e.g FM Kernel driver will be registered as platform driver and \dev\radio0 node should get added!
Hi Ranganath,
I am not an expert in CG2900 initialization module.
I add Nitin who is working on this area to comment further.
Hi Ranganath,
Cg2900_hu_open is called inside function hci_uart_set_proto(). It seems you haven’t set the correct protocol or wrong line discipline from the command line.
Please check the command line which you are using to initialize cg29xx, are you using this:
1) /system/xbin/ste-cg29xx_ctrl -b 115200 -p 6 -l 23 -i /system/bin/cg2900-channel_init.sh /dev/ttyAMA0
Or
2) /system/bin/hciattach -a 23 -n -s 115200 /dev/ttyAMA0 cg2900 115200 flow
Regards
Nitin
Hi Ranganath,
Good to hear it worked.
please make an entry for ste-cg29xx_ctrl in init.rc as below:
service ste-cg29xx_ctrl /system/bin/logwrapper /system/xbin/ste-cg29xx_ctrl -b 115200 -p 6 -l 23 -i /system/bin/cg2900-channel_init.sh /dev/ttyAMA0
class main
user root
group bluetooth net_bt_admin misc root
oneshot
regards
nitin
platform cw1200_wlan: cw1200_clk_ctrl: Failed to get clk 'sys_clk_out': -2
Can you please help to solve the error.
Thanks,
Ranga
4) For experiment, Can you first switch on BT and keep it on and then enable WLAN, do you still see this issue?
yes I did the above experiment as you said, but still seeing the issue.
Hi Ranganath,
This is strange.
For some background, Wlan requires a clock from cg2900 chip, for that purpose “sys_clk_out” is the clock which cg2900 adds for wlan to be used. For my knowledge can you tell me few things:
1) About your environment: are you using git provided by STE, which SI version (repo tag) are you using?
2) Do you see file clock-cg2900.c in path /kernel/drivers/staging/cg2900, can you provide me a zip of it?
3) Are you getting this error even after modifying the entry in init.rc?
4) For experiment, Can you first switch on BT and keep it on and then enable WLAN, do you still see this issue?
Hi Ranganath,
There could be multiple reasons for this:
1) There are 2 wlan modules, one is umac and the other is open mac. It could be that some wrong binary has gone for wlan. Can you tell me how you do make for the complete system? And do you separately build kernel?
a. To verify umac or openmac module inside the flashed image; goto /system/lib/modules/3.0.8+/kernel/net and do an “ls”. Give the name of the directory that is displayed.
b. To check the compilation flag, open file: vendor/st-ericsson/u8500/BoardConfig.mk and check flag WLAN_ENABLE_OPEN_MAC_SOLUTION, whether this is true of false.
It is True
2) You may require to do some debugging by putting printks:
a. file: clock-cg2900.c, function: cg2900_core_probe – this will confirm that clock is added by cg2900. And verify these prints during bootup.
b. Similarly, put prints inside file: kernel/arch/arm/mach-ux500/board-mop500-wlan.c function: cw1200_clk_ctrl and inside condition “if(enable)” – this will verify some wrong functionality of calling twice might not have happened.
Please find the log attached
Please do these and let me know.
Sent: Tuesday, May 08, 2012 6:13 PM
Hi Ranganath,
I don’t see that error anymore and I can see that wlan request completed successfully, it seems wlan got the clock (check the highlighted part below). Is wlan working now?
#insmod cw1200_wlan.ko
[ 260.808807] **AWT** Enter cw1200_sdio_init
[ 260.814727] **AWT** cw1200_clk_ctrl
[ 260.819335] cg2900-core cg2900-core.0: cg2900_open
[ 260.824157] cg2900-core cg2900-core.0: H:4 channel opened
[ 260.829620] **AWT** Enter cw1200_sdio_on
[ 260.956939] **AWT** Enter cw1200_detect_card
[ 260.961334] **AWT** Exit cw1200_detect_card
[ 260.965545] **AWT** Exit cw1200_sdio_on
[ 181.208801] ieee80211 phy0: Timeout waiting for scan complete notification. [ 182.209045] ieee80211 phy0: Missed interrupt? [ 183.208770] ieee80211 phy0: Missed interrupt? [ 184.209045] ieee80211 phy0: Missed interrupt? [ 185.209075] ieee80211 phy0: Missed interrupt? [ 186.209075] ieee80211 phy0: Missed interrupt? [ 187.209136] ieee80211 phy0: Missed interrupt?
can you please help in solving the issue,
Thanks and Regards,
Ranganath.T.M
Thanks And Regards,
Ranganath.T.M
Hi Ranganath,
I am adding Shivendra to help you further on this.
Bye the way can you please attached more logs (the complete console logs)
Regards
Ajitpal Singh