FORUMS

Cyanogenmod, Legend, FM Radio & MONEY [MODS PLEASE CLOSE THREAD]

2,219 posts
Thanks Meter: 742
 
By and313, Senior Member on 9th February 2011, 12:48 PM
Post Reply Email Thread
3rd April 2011, 06:00 AM |#101  
Inactive Recognized Developer
Flag Ottawa/Gatineau, Canada
Thanks Meter: 4,186
 
Donate to Me
More
Quote:
Originally Posted by TheLamma

I tried using the app again... It keeps hanging and asking me to force quit, and the power button just counts to 20, but doesn't do anything (it didn't turn the bluetooth on for me, either, even though it said it would), and would tell me to power on whenever I clicked on something.
I was trying it without the headphones, though, because you mentioned they aren't required. Are they still necessary to start it up?

I was also wondering, is there a way to put an icon in the notification bar for quick access when audio is running? Both the HTC and CM apps do this.


No, the headphones are completely optional.


OK, re: the bugs. Let's just forget about this App Inventor app and call it a prototype.

I have the CodeAurora Java FM app running now and "de-frameworked". It's just the UI thus far, but I think it shouldn't be too hard to add my existing FM control code.

I still haven't seen the CM app, but I'd guess it's not too different than CodeAurora. And there ARE the letters "FM" in the notification bar. I'm not sure if that's an icon or just text,

Hypothetically (famous last words), I may have something presentable/usable in the next 1-7 days.

I wonder if the recording function will work...

Woohoo !
3rd April 2011, 06:19 AM |#102  
TheLamma's Avatar
Junior Member
Thanks Meter: 1
 
More
>No, the headphones are completely optional.

Okay, so hanging must be for a different reason.


>OK, re: the bugs. Let's just forget about this App Inventor app and call it a prototype.

Okay, well I look forward to the next version. [=


>And there ARE the letters "FM" in the notification bar. I'm not sure if that's an icon or just text,

Weird, because I sure didn't see that...


>Hypothetically (famous last words), I may have something presentable/usable in the next 1-7 days.
I wonder if the recording function will work...

Ooooooohhhhhhh. I (im)patiently await! ;]



Sent from my Legend using XDA App
3rd April 2011, 11:22 AM |#103  
Inactive Recognized Developer
Flag Ottawa/Gatineau, Canada
Thanks Meter: 4,186
 
Donate to Me
More
Quote:
Originally Posted by TheLamma

>
>And there ARE the letters "FM" in the notification bar. I'm not sure if that's an icon or just text,

Weird, because I sure didn't see that...


Tuning is working now.

This is the CodeAurora version, so there may be extra features. Some screenshots:

(Imageshack not responding for some reason. See my album: http://forum.xda-developers.com/album.php?albumid=3408 )


Removing Imageshack IMG URLs...
3rd April 2011, 03:25 PM |#104  
branch8's Avatar
Member
Thanks Meter: 4
 
More
After reinstalling the api i'm now just getting FC's. (see attached log)
Given your intentions to move to a straight java app is there any use in continuing to try to test the appinventor version?
Attached Files
File Type: txt 2011-04-03-16-13-15.txt - [Click for QR Code] (35.9 KB, 8 views)
3rd April 2011, 04:55 PM |#105  
TheLamma's Avatar
Junior Member
Thanks Meter: 1
 
More
Yeah, I wonder the same as Branch.

Those screenshots - do you mean they're from the app you're basing yours on, or one you've made?

Either way, it looks like some sweet features.

And what's this? Scanning by genre? How can it tell that...? Unless its possibly into the station's frequency..?

Sent from my Legend using XDA App
3rd April 2011, 08:02 PM |#106  
Inactive Recognized Developer
Flag Ottawa/Gatineau, Canada
Thanks Meter: 4,186
 
Donate to Me
More
Quote:
Originally Posted by branch8

Given your intentions to move to a straight java app is there any use in continuing to try to test the appinventor version?


Thanks for the log.

No, at this point I think it's pointless to trouble-shoot and try to fix this current app.

It's become clear to me that trying to create a robust, professional app with App Inventor is not feasible at this time.

I think my new app should be usable within a week or so.
3rd April 2011, 08:20 PM |#107  
Inactive Recognized Developer
Flag Ottawa/Gatineau, Canada
Thanks Meter: 4,186
 
Donate to Me
More
Quote:
Originally Posted by TheLamma

Those screenshots - do you mean they're from the app you're basing yours on, or one you've made?

Either way, it looks like some sweet features.

And what's this? Scanning by genre? How can it tell that...? Unless its possibly into the station's frequency..?

Yes, forget about this current app. Given the progress I've made over the last few 12+ hours days, I think this new app will be usable very soon. Let's call this new app "Spirit version 2", or perhaps "Free Spirit" since it's free.

The screenshots are from the new app currently running on my phone. It's the CodeAurora app that I've modified to be able to run on different firmwares (IE de-frameworked). I also added the basic code to allow tuning, so it's actually working a bit now.

I just added speaker/headset switching, so at this point, I think this new app is only missing one thing relative to the CM app: volume control. I see that operating the hardware volume buttons shows the standard Android media volume control (instead of the Ringer volume). Adding the volume feature shouldn't be too hard. The android volume control only supports 16 different values though.


The search categories are based on RDS data.

When I get the RDS working, the search categories may hopefully become functional, assuming your broadcasters of interest transmit this RDS. I'm not positive right now though, the TI chip might not allow directly scanning by program type, but it may be possible indirectly.

CodeAurora is a Qualcomm venture, to create open, Apache type licensed code for use with their chipsets by phone OEMs, carriers etc. A bunch of code in there is specific to the Qualcomm "TAVARUA" FM chip, and I have no idea what devices use that chip. Most are TI or Broadcom now. So there are features, like FM transmission, that will only work with the Tavarua chip, until someone adds the codes for other chips.


http://en.wikipedia.org/wiki/Radio_Data_System

"PTY (programme type)
This coding of up to 31 pre-defined programme types (e.g., in Europe: PTY1 News, PTY6 Drama, PTY11 Rock music) allows users to find similar programming by genre. PTY31 seems to be reserved for emergency announcements in the event of natural disasters or other major calamities."
4th April 2011, 08:11 PM |#108  
TheLamma's Avatar
Junior Member
Thanks Meter: 1
 
More
Well it sounds like you're making some awesome progress. I eagerly await. [=

Sent from my Legend using XDA App
5th April 2011, 11:12 AM |#109  
Inactive Recognized Developer
Flag Ottawa/Gatineau, Canada
Thanks Meter: 4,186
 
Donate to Me
More
Quote:
Originally Posted by TheLamma

Well it sounds like you're making some awesome progress. I eagerly await. [=

Sent from my Legend using XDA App

Now I'M stoked ! 5.5 days from old AI app to new Java app, with credit due to CodeAurora and a few lines of code credited to MIUI and/or CM Most of that time was spent learning more about the Android SDK and learning the Aurora code.

Here's a "sneak peek" at version 2:

Direct:
https://docs.google.com/uc?id=0B7UP2...download&hl=en

Page:
https://docs.google.com/leaf?id=0B7U...MDdiMDhj&hl=en


It's "hot off the presses", so who knows what strange bugs it might have on your phone. But it seems to be working nicely on mine.

It shouldn't need any of the previous files, but they shouldn't interfere. Due to the shared lineage with the CM app, it's possible there might be some conflict in naming or somesuch.

As before, it requires a working hcitool. No "daemon mode", but I'll be investigating the dbus APIs for direct bluetooth access. But hcitool works fine for now. It will create a file named "cmdout" in the /sdcard directory; this is used to read FM registers.

It needs SU (root) only to run the speaker/headset switching code, due to the bug in my older CM ROM.

You MUST switch bluetooth on manually before starting. When it starts, it should power up, go to speaker and tune to 98.1.

Note: The app has some code to handle muting during phone calls. I haven't tested to see if it works yet. If someone would like to test incoming/outgoing to see what happens, please let me know. I don't use this phone as a phone anymore, LOL.

For some reason, this app doesn't show up in the "recent applications" list. It can be returned to by (re)launching via home screen or whatever.

------------------
Instructions:
Click on "98.1" and get a dialog to enter a new frequency. Click to left/right and go down/up one channel. Long press on either to seek to next channel with an RSSI of 24 or greater.

Hardware volume control buttons should work. Turn up if you hear no sound. Hit speaker at lower left to mute, again to unmute. Power button should go off and on.

Find a favourite station and long press one of the 5 preset buttons to set etc.

Menu button gives some non-working options like scan. "Start recording" creates file(s) on the SD card, but I haven't seen if an actual recording can be made (it can't as of now I think). "Disable Speaker" switches audio to headset. "Enable Speaker" goes back to speaker.

Under "Settings", the mono/stereo switch should work. The "Regional Band" may partly work for other areas, but I have some code fixed to North America at the moment. Revert to factory defaults should work.

There should be multiple preset lists configurable but I haven't checked that much.

The display should reconfigure between landscape and portrait.

Please report back here...
The Following 3 Users Say Thank You to mikereidis For This Useful Post: [ View ] Gift mikereidis Ad-Free
5th April 2011, 05:30 PM |#110  
TheLamma's Avatar
Junior Member
Thanks Meter: 1
 
More
First impressions:

Pressing the speaker button still leaves sound, but not as loud, when headset isn't plugged in. Would there be a way for it to detect a headset? My local stations are a good thirty kms away, so I was mostly getting fuzz.

When I plug the headset in, though, all audio is cut, no matter if it's on speaker or headset modes, and is still cut when I take it out. I have to hit the power button on and off to get it back. It's kind of hard to test the other features if I can't hear audio. [=

I'll experiment some more, and see if there's anything else I can do.

EDIT: two more things. I think you should alphabetitize the band frequencies. It is for the most part, but China is after France or something. Also, why is the North America AND United States?
The second thing is that I tapped the "record" option and it FC'ed (so that doesn't work), but the audio kept playing.... but, unlike the last app, it appeared once again in the notification bar (without me opening it again) where I could turn it off no problem. =D However, I had it on headset audio (It's quieter that way... It still plays audio, but at like half volume. I should mention that the base audio is WAY too loud, at least when all you get is fuzz. Could you decrease the DB? This is on minimal volume...) and it reset itself to speaker audio.

EDIT 2: I just realized that my phone still thinks it's playing audio, because it has a very quiet fuzz coming from the speakers, even though the app is off. It's like something internally didn't turn off. I've tried resetting bluetooth, wifi, etc, to no avail. Here comes another reboot. [=

Sent from my Legend using XDA App
5th April 2011, 08:48 PM |#111  
Inactive Recognized Developer
Flag Ottawa/Gatineau, Canada
Thanks Meter: 4,186
 
Donate to Me
More
Thanks for testing TheLamma. I'm thrilled to hear it's at least more or less working for you so soon after I started version 2.

The code is there to detect headset. I disabled it to allow antenna-less operation. Do you think it would be better to re-enable the code as is so it enforces the insertion of a headset antenna, or just inform the user that an antenna is recommended ?

I'll look into your speaker/headset issues. I saw something weird myself.

Yes, I'll re-alphabetitize. The United States is likely effectively there twice as it's such an awesome country.
EDIT: There are some slight differences in the code for US versus North America. I also realise now that certain
areas (Europe and Japan) are favoured by being at the top of the list instead of alphabetical. I'd bet you were happy
to see North America conveniently at the top, even though (or perhaps because) it's the default. So, for now at least
I'll leave this the way CodeAurora set it up. If anyone else has an opinion, please speak up.

Record didn't FC for me. It created an empty file on SDcard each time. I'll disable it though until it works as most people won't read instructions/release notes and will just experiment.

I suspect that it was the FMRadio Service that FC'd. Android automatically restarts services that crash after 5 seconds or so and that's why the "FM" reappeared in the notification bar.


The version 1 app supported 100 volume steps. The standard Android media volume only supports 16 steps including 0 volume. I will try making volume an exponential function, more like decibels than linear. I hope that 16 steps will be sufficient, but if not, it would require code that goes beyond standard Android media volume control. I doubt many (any?) apps do that and I'd think Google must have thought 16 steps are sufficient.


I'm guessing the "quiet fuzz" is due to the analog path from FM radio still being open, despite the FM chip being off. I'll add some code to shut that path down completely when the app powers down FM.
The Following User Says Thank You to mikereidis For This Useful Post: [ View ] Gift mikereidis Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes