yashsingh1/xdaforums huggingface dataset:
[Windows Mobile Software Development] flywhc:
Thunichgud, I know my code doesn't work on V900.

I need some time to rework on v900 because it is different from M800/900.

The current etentest.exe was written for M800/M900.
[Windows Mobile Software Development] phjz:
Dear flyhwc, using your new API I was made a dll using all the entries filled in the kit. Unfortunately the XFMRadio said: "Failed to init. FM radio" and exit. Using XFMRadio ver 1.4 debug, but not find any debug info. The dll placed to the application directory. Maybe the DLL must be signed?
[Windows Mobile Software Development] flywhc:
Should use APITest.exe in the "GFMAPI for HTC devices 1.6"

It has source code of APITest.

PowerRadio is not required to be signed.

Once they are working, sign the DLL with privilege certificate. then it should work with hyperGPS.

Update V900: it has same function name as M800 but arguments are different. have to rework it.

Such as

FMOpen(0, 0, 1),

FMSetEventNofication(Handle, 1, pEventProc)
[Windows Mobile Software Development] boiacchi:
Good morning

i'm using the latest version, the one you attached along with the dll file.

-it seems set property and get property for frequency work perfectly; i've tested just with a bounch of frequencies, but if it is needed, i can test all the frequency i can receive from here.

-I cannot find FMSetChannel property, but as you can see from the log, i've tested all of them trying to find it.. i don't know maybe i am wrong, sorry.

-After set a invalid frequency, Get Frequency does not return 113000, but remailns to the last valid frequency; please check the atached log about that.

-Audio path doe not work as expected 0: loud speaker 1: headset, but as soon as i switch from 1 (default value) to 0, i cannot turn back.

Any other change wont take effect; i mean, after set 0 from 1, if i set 1 again i get 1, but the audio source remain loud speaker, the same for any other value i can try to set... i cannot hear the sound from head set anymore.

-Volume, as you can see from the attached log, there is no corrispondence from the value used for set property, and what i get from get properties.

Hope it was userful.

Have a nice week end.
[Windows Mobile Software Development] Rapid81:
Sorry for the late. I was tuned to FM102.7.

Here's the values:

AFCount = 8

AltFreq = 0

ProgramType = 15

PSName = " PETOFI "

StationID = 45569
[Windows Mobile Software Development] flywhc:
boiacchi, from the log you attached I cannot see which one is invalid frequency was set. The frequency you entered wasn't specific to band boundary.

Please do following tests, use exact sequence:

Set Band =0

Set Frequency = 87400

Set Frequency = 87500

Set Frequency = 108000

Set Frequency = 109000

Set Band = 1

Set Frequency = 76000

Set Frequency = 77000

Set Frequency = 107000

Set Band = 0

Set Frequency = 87600

SeekBack

Get Frequency

FMSetChannel is not a property, it is a line in the log. This value indicate the Set Frequency operation is succussful or failure. e.g. 324 means invalid frequency.

To help me solve the audio path problem, please download this Old version of EtenTest. It uses original value of audio path.

Set Audio path from 0 - 5.

you wrote that 2 is handsfree, 0 is mute, others are headphone.

Because there are 4 values (1,3,4,5) for headphone, I guess I used wrong value.

Please find one value, or combination of values that solve audio path problem.

such as set audio path to 2 then 1, if headphone is silent, try 3, 4, 5.

if works, write this number down and repeat the test but use this number first. Maybe have to set audio path to two numbers to ensure headphone has sound, maybe just set to one number.

Again, if someone know c++ programming to do this job, it would be much easier.

I don't have device so I only can use my imagination and guess to make different attempts, which is very hard.
[Windows Mobile Software Development] vmm333:
Eten X650 Power Radio

Hi, flywhc

I'm novice in Power Radio, but after download your GFMAPI for Eten i have tried to run EtenTest and PowerRadio with GFMAPI from your.

The Power On/Power Off/Set Frequency functions are ok, but Scan stop at magic 113000 frequence.

When i run Power Radio, all shortcut buttons after scan band have 113 label

FMGetNumDevs = 1

Failed to load 'FMSetRSSITH'

FMOpen(0) = 263680

FMGetProp(AUDIOPATH) = Success, val = 1

FMGetProp(BAND) = Success, val = 1

FMGetProp(AFJUMP) = Err 120, val = 0

FMGetProp(MUTE) = Success, val = 0

FMGetProp(CARRIER DETECT) = Success, val = 0

FMGetProp(Power) = Success, val = 0

FMGetProp(STEREOBLEND) = Success, val = 1

FMGetProp(MIN_SEEK_RSSI) = Success, val = 0

FMPowerOn: On Success

FM_SetAudioVolume(100)=1

FMSeekChannel(0)=1

FMGetFrequency(1)=87600

FMGetFrequency(1)=87600

FMGetChannelFromFrequency(99100)=116

FMSetChannel(116)=1

FMGetFrequency(116)=99100

FMSetProp(FREQUENCY, 99100) = Success

FMSeekChannel(0)=255

FMGetFrequency(255)=113000

FMGetFrequency(255)=113000

FMSeek: FMSeek_Forward Success

FMPowerOn: Off Success

FMClose ...

FMPowerOn(h, TRUE) = 0
[Windows Mobile Software Development] phjz:
Dear flyhwc,

APITest is working fine, all the implemented property , seek, etc. working - But The XFMradio does not start. Interestingly PowerRadio did, but after the start there is an exception in RdsInit() stated that in gfmapi.dll there is a null pointer. Moreover when started HyperGPS, Powerradio begin to work - at least the scannings ( the SNR seems to cyclyng fro 7 to 0 ) and the sound level is 0 ( I dont know how to increase).

Independent from the above problem can you give me the volume level borders? There is a mystic conversion in the sample code - my hw interface working in the 0-100 area.
[Windows Mobile Software Development] flywhc:
vmm333, happy to see your device is supported. that is known bug will be solved. to help me solve the priblem, please (any eten/acer user) do the test steps i wrote in the previous post.

phjz, xfmradio won't work because it doesn't use gfmapi.

I had a plan to upgrade it but since powerradio is released I didn't work on it.

you may want to discuss with 6Fg8 for powerradio issue. it has logs can help you trace issues.

or you can use apitest.exe to see return values from your dll - it has source code so should be easy to debug.

volume was defined from 0-100.most device use 0-15 so I conveted it to 0-100 by using math in code.
[Windows Mobile Software Development] vmm333:
flywhc,

i done steps described on previous page exactly

see attach

thanx
[Windows Mobile Software Development] vmm333:
flywhc,

some details about Eten X650 bands, possible it's useful

0 : europe - 87.5 - 108.0

1: japan - 76.0 - 90.0

2: usa 87.5 - 107.9
[Windows Mobile Software Development] flywhc:
@vmm333, thanks. results were interesting.

Attachment is another attempt for Eten/Acer including V900.

I hope it works on M900/M800/X650. (may even worse because I cannot test at all)

For V900 (Thunichgud), it may still hang your device when click on power on, but try to get logs just before it hangs. I added more logs for this function.
[Windows Mobile Software Development] Thunichgud:
Moin, flywhc,

I've to beg you pardon. At weekend I remembered, that I didn't install the FM_Patch after updating to new OS version. So I installed it and "hoppla !": everything works !!

Forget all what I've written - except the infos about "Audiopath". These Infos keeps true. Including the fine white noise, which appears, when setting Audiopath to a value other than 0. This noise don't disappears, as I wrote, when setting Audiopath to 0, clicking on "PowerOff" or exiting the app. It disappears only when the device is switched to sleep. This could be a problem, because the loudspeaker continues consuming power all the time.

Other (little) problem: When seeking foreward or backward the app don't finds stations which has light interferences.

I don't understand the "Band" property. It seems not to have any real effect. When I change the band value during a station is received, the station keeps received. When I set Band to 0 it shows 1, when I set Band to 1, it shows 2.

Little problems ! You are on the right way !!!

- Thunichgud -
[Windows Mobile Software Development] flywhc:
1. Audio Path: I post the test instruction for AudioPath again to bring all testers' attention:

To help me solve the audio path problem, please download this Old version of EtenTest. It uses original value of audio path.

Set Audio path from 0 - 5.

boiacchi wrote that 2 is handsfree, 0 is mute, others are headphone.

Because there are 4 values (1,3,4,5) for headphone, I guess I used wrong value.

Please find one value, or combination of values that solve audio path problem.

such as set audio path to 2 then 1, if headphone is silent, try 3, 4, 5.

if works, write this number down and repeat the test but use this number first. Maybe have to set audio path to two numbers to ensure headphone has sound, maybe just set to one number.

I will turn off audiopath when clicking when poweroff in next release.

2. Band problem, I just remember BeamRider told me about si4700 chipset: band cannot be changed after power on! I will try to fix this in next release.

3. seek. I guess Thunichgud wanted to say if a radio channel has very weak signal, it cannot be found by Seek functions.

This is set by MIN SEEK RSSI property. Try to set it to low value such as 0 or 1.

If you see "Failed to load 'FMSetRSSITH'" in the log, that means your device doesn't support this property. In this case, other than manually tune to that channel by setting frequency property, I guess you can replace the driver with M900 version.

try to extract FM.DLL and fm_si4700.DLL from M900 and build into your ROM. This requires good ROM building technique. You can't simply copy the file from/into the ROM. I hope ROM chefs will cook these DLLs into those devices do not support FMSetRSSITH.

I hope everything else is working so that you can use PowerRadio, hyperGPS etc.
[Windows Mobile Software Development] Thunichgud:
That don't seems to be true. It is possible to change the band in the origin V900 FMTuner during the receiving of a channel. The channel disappears until I return to my home band.

No, not only at VERY weak signal, also at a channel with rather good quality (RDS: about 10 counts per second) but a light noise - nearly unhearable. I will test the RSSI property.

- Thunichgud -
[Windows Mobile Software Development] phjz:
Dear flyhwc,

Everything is working fine, I need just some clarifications in the parameters:

- what is the range of the RSSI ( in Si4709 native in dBuV and the range is 0-75 )

- the deemphasis is in usec, so 50 or 75?

- stereoblend ? (Si4709 0-3 , 0=31-49dB, 1=+6dB 2=-12dB, 3=-6dB)

and the audiopath: in the driver just there is an ioctl to switch the speaker in Omnia2

Can you help me to clarify the above ranges?
[Windows Mobile Software Development] flywhc:
Band: maybe it used software simulation, such as quickly power on then off

Good news. They are defined in comments in FMAPI.h

I searched definition of RSSI, it seems there is no spec for it. On my HTC Rapheal, it is:

8+: almost no noise, 15+: stable stereo, 18+: stable RDS

de-emphasis: only on and off on htc devices. I like to update the FMAPI.H with your results and change type of this value from a boolean to integer. Can you suggest a list of values but keep 0 for off, 1 for enable (50?)?

stereoblend: same as above. please suggest a list of values.

audiopath: 0: loud speaker; 1: wired headset. I guess OmniaII also sends IOCTRL to WAV1: device. If you feel necessary, add more like 2: bluetooth A2DP etc.

Please post here if you find any mistake in GFMAK or add more feature definitions into FMAPI.

thanks
[Windows Mobile Software Development] phjz:
RSSI: it seems that the values from Si4709 is doubled - the documentation said that this value in dBuV , but I think it is a must to gain similar RSSI from different chipset, so in the code I will divide the value by 2.

De-emphasis: as I remember it is a value determined by the region, and just two used value, 75 usec in the US and 50 usec elsewhere, we can use a digital 1 for 50 us , 0 for 75 usec I think

Stereo Blend: once again the chip can use the default, +6,-6,-12 dB; but how other chips interpret it is a question. Maybe 0=(default) 1=(higher) 2=(lower) 3=(lowest) ????

audiopath: ok, will try it

Otherwise GFMAK seems to be good - all the problems I faced were not in that code.

Thank you....
[Windows Mobile Software Development] phjz:
The last questions: the meanings of the FMRDS_CHUNKx_ERROR. If this flag is set means the data has uncorrectable errors or a correctable one, so the data is valid?
[Windows Mobile Software Development] flywhc:
De-emphasis: I suggest to use 0: No de-emphasis; 1: 50 usec ; 2: 75 usec. because HTC device only has on or off. If the device doesn't support no de-emphasis, just return error ERROR_NOT_SUPPORTED

Stereo Blend: I like your suggestion but add an option "highest" for future devices.

0= default/off

1= higher

2= highest

3= lower

4= lowest

again, return ERROR_NOT_SUPPORTED if not supported.

FMRDS_CHUNKx_ERROR: if the flag is set, means the checkword indicates an error, may be corrected maybe not. Data is valid but not reliable.

In this case, radio player may display junk characters and TMC application should discard them.
[Windows Mobile Software Development] phjz:
OK, agreed...
[Windows Mobile Software Development] flywhc:
phjz, hope you saw my update in the previous post.

one thing I just realized: Samsung Omnia II use si470x chipset for radio, and FM device name is "FMR1:", this is exactly same as Eten/Acer devices I am working on!

On Eten/Acer the driver name is FM_si4700.dll, with a wrapper FM.dll. My works is based on FM.DLL, indirectly talk to FMR1:

Files for Eten V900 in here

we might be doing same job....
[Windows Mobile Software Development] casouzaj:
Hi, flywhc,

Are you sure you have uploaded the right file? I'm asking you this because both EtenTest.exe and GFMAPI.dll have exactly the same sizes as their previous versions, dated Jan. 07. I have not compared their contents, though, to be sure...

Thanks, anyway.

Cheers!

Carlos
[Windows Mobile Software Development] flywhc:
I just opened the zip file in the post #905.

date of files is 18/01/2010
[Windows Mobile Software Development] phjz:
Sure we do tha same - but unfortunately with different dll; I have a coarse C disassembly from the i8000 - focusing just the very important parts. In the case you are interested, I can send it to you. In nutshell: There is two thread, one is the "normal" RDS interrupt, one for the AF. The chip inside accessed using open the "I2C2:" device and communicate with it over IOCTLS, for ex. the write is IOCTL 0x40000, and there is a 12 byte memory area as input parameter which contains data, prepared by a function. So in the next gfmapi version I planned to use this method after I decode who responsible for I2C2 and what is the input format meaning....
[Windows Mobile Software Development] boiacchi:
Hi Flywhc,

i've followed your instructions and used the version you linked, please find attached the log.

About the audiopath: the only number that works to redirect audio to headphone once switched to handsfree is 3.

Is there anything esle i shoud try?

Good evening

p.s.

i could imagine how frustrating it should be working without the device, i'm sorry about that, but trust me, i'm still looking for someone ith programming skill o help, but without success yet.
[Windows Mobile Software Development] flywhc:
Yes, please test the new EtenTest. I added the link on the first post.

I try to fix Set Frequency and Seek feature.

Update: attached EtenTest beta 3. try to fix audio path (0: speaker, 1: headset) and Band problem.

Does your device still mute after awake from sleep mode?

After set Band = 1, Can you set a frequency to a Japanese frequency such as 79000? if yes, what is frequency range?

I hope seek and set frequency/get frequency are working as expected.
[Windows Mobile Software Development] casouzaj:
Preliminary results with Beta2

Ok, differences I've noticed, compared to the previous version:

1 - when I power it up, the automatic band detection now is 3, while the old one was 1.

2 - now it seems that seek forward and backward do flow in the right direction, but both of them pass on frequency 108000 (although there is nothing there). Nevertheless, during the seeking process, some valid channels here are shown with odd frequency values, such as 157, 165, 231.

3 - maximum volume is now 13. The old version showed 15 there.

Audiopath, on the other hand, doesn't seem to have changed. It starts at 1 (headset). It sounds, as expected, on the wired headsets. For any value I set there (I've gone through 9), except for 0 (loudspeaker), sound stays in the headsets, but, as soon as I set it to 0, I can't take the sound from the loudspeaker anymore (although all the set prop operations succeed), unless I power off, quit EtenTest, relaunch it and make all the settings again.

Hope you can make use of such informations.

Cheers!

Carlos

EDIT: after having posted, I've seen that you've released B3. Downloading it now...
[Windows Mobile Software Development] casouzaj:
Now results for B3

Default band has returned to 1.

During the seeking process, it keeps showing odd frequency values to real stations. The only values it passes by, and shows valid values (but, in fact, don't have any real stations here), are the ends of the dial, i.e. 87500 and 108000. I mean, these values are shown as if it had found something threre, but there ain't. It cycles through them, as expected.

Audiopath now is worse, because it stays in value 1 (headsets). Any other value I set it to, including 0 (speakerphone) results in success, but sound is kept in the headsets, and getprop always returns value 1.

Cheers!

Carlos
[Windows Mobile Software Development] flywhc:
thanks casouzaj!

uploaded Beta 4 to (hopefully) fix audio path and seek
[Windows Mobile Software Development] casouzaj:
Thanks, you're really fast! Have already downloaded it, but I'll be able to test it only tomorrow, because my device is charging right now (I've been listening to Brahms' piano concerts all day long :), and its battery got almost flat some minutes ago).

Cheers!

Carlos
[Windows Mobile Software Development] boiacchi:
Using BETA 4:

-Audiopath now is 0=handsfree, 1=headphones; any other value higher than 1 does not apply and lead back to 1 and now audio can be swithed from 0 to 1 and backward without problem.

-If the phone goes to sleep mode, the audio stops, after awake from sleep mode there is no audio, the volume properties still has the same value, but the audio get back only after having set again 0 or 1 for the audiopath.

-Default value for Band is 1; if i set to 0 i get property 1 and volume value automatically get back to 0

-With Band 1 (as i said i cannot seti it to 0), i cannot set frequency 79000.

if i use seekback and seekfore, i get max of 107900 and min of 88100, but also i get two times 1.

when i get 1, if ai get the property i read 108000 and 87500.

-volume; i don't get the same value that i set, if i set 1, i get 0, if i set 11, i get 6 (please see the attached log), and also, from value 6 (getted value) any other value getted (ex 13) gives tha same volume level as 6.

I mean, the real volume doesn't grow.

Have a good day.
[Windows Mobile Software Development] flywhc:
ok, more bugs to be fixed.

I just saw phjz published his gfmapi for Samsung OmniaII. This device has similar FM radio hardware with Eten so it is worth to try it:

http://phj.hu/i8000/TMC/gfmapi.CAB
[Windows Mobile Software Development] boiacchi:
ehm... forgive my ignorance...

how should i try it?
[Windows Mobile Software Development] flywhc:
If open the cab file with winzip/winrar, you can find 00gfmapi.001.

extract and rename it to GFMAPI.DLL

Install powerradio and replace GFMAPI.dll with this one.

Try if powerRadio is working.

If install that cab file, it should install GFMAPI.DLL into \Windows folder

delete GFMAPI.dll from powerradio should also works.
[Windows Mobile Software Development] Nycro:
Im working a simlar problem with a HTC device. The nexus one has the 4329 chipset which includes a FM radio transmiter reciver. I know over here your working with the windows mobile platform but any usefull information you could offer someone with android/linux related infomration. such as driver information or even calling the hardware?

much aprecated!

Nycro
[Windows Mobile Software Development] phjz:
On the same page you can find the access of the SVN repository, which contains the driver source code also.
[Windows Mobile Software Development] phjz:
@flyhwc

Thinking about the further development, I have a dream: a common solution using different chips over the I2C. As I know, every chip has this interface, so in the case we find the way to address the chip over i2c, we need to implement just and only the few chip register settings - and we will independent from the OEM drivers. If you think this is good idea, I can set up an SVN to work.
[Windows Mobile Software Development] flywhc:
Assume you were talking about Broadcomm BCM4329.

HTC Rhodium/Leo uses BCM4325. Broadcomm provided a set of complicated driver that make reverse engineer very difficult.

The FM functions is provided by bluetooth driver, which is using undocumented broadcomm interface.

we cannot find code to read and write hardware yet.

well done, phjz.

In the original design and plan, there is a plan to make a dispatch interface that load driver according to the hardware. It gives us two advantages:

1. an application package will include gfmapi for all hardware without additional code.

2. support device that support two or more FM radio devices.

However because there was only one GFMAPI (HTC) it wasn't necessary. And I am busy on different things like HTC Rhodium and Eten.

phjz, do you know haRET? I heard that it helps developers to discover hardware information. See linux/android related thread and website.

They documented device address map for many HTC devices.

si470x has good documents so it is easy to implement driver for it if know physical address.

but programming documents for other chipset are not published. so we don't know what control data should be sent to the device.

I don't know how this I2C driver will help on this situation.

I have an idea that (if I have time) write a interprocess API hook program that help IDA pro to debug and trace the current driver.

Drivers like Broadcomm bluetooth/FM has a timer guard and running kernel mode to prevent IDA pro debug into it.

I found sample code to do this.
[Windows Mobile Software Development] phjz:
OK, I were think that simpler to get chip info than debug a complex code, therefore I suggest to use the I2C. The present driver problem is the chip interrupt - I cannot hook it, because the original driver will not work, therefore gfmapi cannot sync with RDS interrupts.(there is a named event which fired at interrupt, but from outside it never set, so unusable). This lead to use the periodic poll - not an elegant and energy saving thing. On the other side the original driver also communicate with the chip over i2c, and the only usable part is the audio drive, which I think easily can implement - really doesn't need to have a registry entry containing the station name, etc....