Rockbox Technical Forums

Rockbox Development => New Ports => Topic started by: RowaN on August 25, 2006, 09:02:57 AM

Title: Rockbox for Java (mobile phones)?
Post by: RowaN on August 25, 2006, 09:02:57 AM
Is it possible to port rockbox to java? Theres lots of java supporting mobile phones that support high capacity microSD cards.. rockbox on my phone would be heaven! But I guess different java ports would be needed for each model of phone due to differences in hardware?

Sorry if this topic has already been covered.
Title: Re: Rockbox for Java (mobile phones)?
Post by: Febs on August 25, 2006, 09:48:51 AM
I'm trying to imagine how this would work, considering that Rockbox is complete replacement firmware and doesn't offer features like, say, telephone functions.
Title: Re: Rockbox for Java (mobile phones)?
Post by: RowaN on August 25, 2006, 11:25:26 AM
I was thinking it could run as a stand alone java application, as other applications do on phones. I don't expect rockbox to replace the entire phone firmware! Maybe that sounds ludicrus .. I'm not very technical, despite my job title. I just get the feeling that the devs behind commercial devices such as phones have no interest in ever implementing seemingly simple features like replaygain.. rockbox is our only hope.
Title: Re: Rockbox for Java (mobile phones)?
Post by: mnhnhyouh on August 25, 2006, 06:51:14 PM
I think that stand alone DAPS will go the way of wax records as phones become even more multi-function and get larger storage.

It may be that Rockbox will either need to adapt to this situation, or follow them to extinction...

h
Title: Re: Rockbox for Java (mobile phones)?
Post by: ryran on August 25, 2006, 07:11:22 PM
riiiiiiight...
Title: Re: Rockbox for Java (mobile phones)?
Post by: Llorean on August 25, 2006, 10:35:27 PM
I'm sorry, but having your Phone and your DAP be the same device is an *incredibly* horrible idea. A phone is a work-related gadget in many cases. You need it to communicate. A DAP is a leisure device. You don't need it, but it's nice to have. Now here's the problem if they're the same thing: They share a battery. Music time costs you phone time. A very bad idea, as then in some situations your phone will be unavailable.

I think because of the battery issue alone they'll never be merged wholly.
Title: Re: Rockbox for Java (mobile phones)?
Post by: Sando on August 25, 2006, 10:55:28 PM
Now now, aren't you exageratting the battery problem just a little bit? I use my phone pretty much every day when I don't happen to have my H120 with me and it doesn't seem to impact battery levels that much. I'm not saying that Rockbox for J2ME will ever have the slightest chance of happening (it won't :P) but an open-source Java media player would be nice. The interface on the media player for my SE K750i sucks quite a lot. :)

In the same sense, you could say that any video/plugin work on Rockbox is a horrible idea. :D
Title: Re: Rockbox for Java (mobile phones)?
Post by: Llorean on August 25, 2006, 11:06:52 PM
Video/plugin work still just means alternate leisure uses.

In a situation where you can charge yoru phone nightly, battery life is not a major concern. But, missing an important call because you didn't realize you'd been listening to too much music is not a situation you want to be in.

My phone has a media player, and I absolutely refuse to use it below half battery so that I'm sure that I always have a certain minimum amount of talk time between now and the next time I charge my phone.
Title: Re: Rockbox for Java (mobile phones)?
Post by: mnhnhyouh on August 25, 2006, 11:27:57 PM
Given the rapid increase in battery playback time over the last 10 years, we should be fine on that front....

h
Title: Re: Rockbox for Java (mobile phones)?
Post by: Llorean on August 25, 2006, 11:35:51 PM
I think, from my perspective, we'd need to at least triple battery life as it is currently, as well as have vastly larger storage capacities (in phones, as they still don't compare to HD players) before this even becomes remotely an option I'd consider.
Title: Re: Rockbox for Java (mobile phones)?
Post by: RowaN on August 26, 2006, 03:19:18 AM
I can only dream of a life where important people try to call me all the time. I don't use my mobile at work, I'm too busy working. It is essentially a leasure device for me in that I only call people up for a laugh.

Llorean regarding DAPs you say "You don't need it, but it's nice to have". I would say the same about mobile phones. I managed to survive the 80's without needing one (but it would have been nice to have I guess).
Title: Re: Rockbox for Java (mobile phones)?
Post by: dmd on August 26, 2006, 04:39:59 AM
Given the fact that Nokia is the biggest selling camera AND music-player manufacturer in the world, I don't see the future very bright for separate DAPs. IIRC Sony-Ericsson already has phone with 4GB memory. And 5 years from now, there'll be phones with dozens of gigabytes of storage space.

Also, if your using some noise cancelling headphones, how can you hear if someone is calling you?

Don't get me wrong, I really like all the features that Rockbox offers, but this is just the way we're heading.
Title: Re: Rockbox for Java (mobile phones)?
Post by: RowaN on August 26, 2006, 06:07:42 AM
Quote
Also, if your using some noise cancelling headphones, how can you hear if someone is calling you?


vibrate   ;)
Title: Re: Rockbox for Java (mobile phones)?
Post by: mnhnhyouh on August 26, 2006, 08:41:21 AM
If the phone is also the DAP then it can easily, if programmed to do so, put the call sign into/instead of the music....

As for doubling battery life, that is almost assured over the next 5 - 10 years.... at least.

h
Title: Re: Rockbox for Java (mobile phones)?
Post by: dmd on August 26, 2006, 09:21:25 AM

If the phone is also the DAP then it can easily, if programmed to do so, put the call sign into/instead of the music....


Mine already does that (Nokia 6230i).
The point is, if your phone is your DAP also, you can easily hear if someone is calling you. You basically need to stand still, or your phone needs to be beside your skin to feel the vibration. I actually keep my phone in my pocket of the trousers, but I don't think everybody does. And these new 3G phones are quite big to keep in the pocket the trousers.
Title: Re: Rockbox for Java (mobile phones)?
Post by: mnhnhyouh on August 26, 2006, 09:44:06 AM
I also keep mine in my pocket. I can feel/hear it vibrate if it is a call, but will at times miss the sms messages which generate a shorter vibration.

I dont mind missing calls, and on the homeline often let the machine catch them.

If at work I wil generally hang up the mobile instead of answering. Those who know me enough for me to want to answer them, wont call me at work.....

I keep my phone on at work for those occasional important outgoing calls, or for my timekeeper.

But if my phone will give me 80Gb in the next 5 years, and have great music playback capabilities, including a days battery time for playback,  with drag and drop, I will lose my iPod.

h
Title: Re: Rockbox for Java (mobile phones)?
Post by: mlind on September 04, 2006, 07:25:57 AM
Back on track:

If there's a simulator for a computer, couldn't there be a java-simulator for other hardware?
Title: Re: Rockbox for Java (mobile phones)?
Post by: Llorean on September 04, 2006, 11:56:28 AM
I'm sure it would be a horribly painful task. I'm sure there are tool/programs that generate JAVA bytecode from C, and I'm sure that they'd require the jumping through horrible hoops to work.

And the concept of converting the simulator source code to similarly functioning JAVA code is a pretty time consuming process as well.
Title: Re: Rockbox for Java (mobile phones)?
Post by: saratoga on September 04, 2006, 06:04:00 PM

Back on track:

If there's a simulator for a computer, couldn't there be a java-simulator for other hardware?


Yes this could be done in principle.  The JVM is just another ISA from the compiler's standpoint, so provided you could find a way to get gcc to target your JVM, you could in fact build rockbox like any other port.  However:

1)  I have no idea if tools even exist to do this.
2)  I have no idea what the performance and driver situation would be like on a JVM.

For this to work you'd have to find someone who really knew the ins and outs of your platform and get them interested enough to look into the details and see if the software we'd need existed, and if the hardware was capable enough.
Title: Re: Rockbox for Java (mobile phones)?
Post by: mlind on September 05, 2006, 09:39:12 AM
Sorry, but could you please translate "JVM" and "ISA" for me?
Title: Re: Rockbox for Java (mobile phones)?
Post by: mnhnhyouh on September 05, 2006, 03:50:46 PM
ISA is I think Instrustion Set Architecture

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

and JVM is Java Virtual Machine.

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

Its amazing what 30 seconds on the wikipedia will do to help you unravel a TLA (Three Letter Acronym).

h
Title: Re: Rockbox for Java (mobile phones)?
Post by: dmd on September 06, 2006, 06:26:36 AM
Referring to the previous discussion, based on a survey of 3000 British consumers: 46% of people preferred to use a phone that also played media files; 21% would choose a music player, and more than a third would never want a mobile phone and music player combined.

http://business.guardian.co.uk/story/0,,1864031,00.html
Title: Re: Rockbox for Java (mobile phones)?
Post by: MU4L on September 06, 2006, 05:05:05 PM

Referring to the previous discussion, based on a survey of 3000 British consumers: 46% of people preferred to use a phone that also played media files; 21% would choose a music player, and more than a third would never want a mobile phone and music player combined.

http://business.guardian.co.uk/story/0,,1864031,00.html


Yep. I definitely fall into that last bracket  ;D .

I wonder where exactly they conducted that survey ... probably London knowing my luck!
Title: Re: Rockbox for Java (mobile phones)?
Post by: mlind on October 19, 2006, 09:31:03 AM
Can someone with knowledge look at this and tell me if it means anything for the possibility to get something Rockbox-ish going on a mobile?


Quote
Cibyl is a programming environment that allows compiled C programs to execute on J2ME-capable phones. Cibyl uses GCC to compile the C programs to MIPS binaries, and these are then recompiled into Java bytecode. The programs are not parsed during runtime, and Cibyl is therefore relatively well-performing. With Cibyl, games written in C can be ported to J2ME without switching language.


http://spel.bth.se/index.php/Cibyl
Title: Re: Rockbox for Java (mobile phones)?
Post by: saratoga on October 19, 2006, 12:12:46 PM

Can someone with knowledge look at this and tell me if it means anything for the possibility to get something Rockbox-ish going on a mobile?


Quote
Cibyl is a programming environment that allows compiled C programs to execute on J2ME-capable phones. Cibyl uses GCC to compile the C programs to MIPS binaries, and these are then recompiled into Java bytecode. The programs are not parsed during runtime, and Cibyl is therefore relatively well-performing. With Cibyl, games written in C can be ported to J2ME without switching language.


http://spel.bth.se/index.php/Cibyl


This is the tool I mentioned needing in my previous post.  Basically, it'll allow you to target a JVM with GCC.
Title: Re: Rockbox for Java (mobile phones)?
Post by: alsaf on January 03, 2007, 03:13:59 PM
I don't know anything about porting rockbox but would it not make sense just to write a  'mobile rockbox ' in J2ME from scratch?
Title: Re: Rockbox for Java (mobile phones)?
Post by: Llorean on January 03, 2007, 03:35:15 PM
I like the use of the word "Just" as if rewriting the entirety of Rockbox from scratch in JAVA were something on a relatively easy scale.
Title: Re: Rockbox for Java (mobile phones)?
Post by: alsaf on January 03, 2007, 06:25:44 PM
I don't have the experience to say for certain but I can't see even the audio player of rockbox implemented in it's full form. It will have to be a stripped down form hence my assertion that it would probably be easier to write from scratch.

As a matter of interest, I've done some digging and  there's a problem with compatibility of device spec's and API's with J2ME to take in account which would make maintaining a mobile rockbox a nightmare.  

From what I can gather the media player on my Nokia 6230 phone is built on J2ME. J2ME has multimedia API's so it's not impossible to create an audio player. Whether a basic audio player built on J2ME multimedia API's can be improved to resemble something that can be called rockbox is another thing.
Title: Re: Rockbox for Java (mobile phones)?
Post by: nimdae on January 04, 2007, 12:02:21 AM
While I believe the combination of your media with your communication is impractical, it's not going away. Whenever I shop for a phone, I look for one to suit my needs, which is basically to be a communication tool, and rarely do I find one that just suits my needs. I even looked for a non-camera phone at one time to comply with company policy at my last job.

While I feel adding these multimedia features to a communication device is impractical, I don't necessarily think it's absurd. What I do think is absurd is porting rockbox to jme. Why? Rockbox is developed as a DAP firmware, which means it manages the hardware of the device and provides functionality to the device. You can't and shouldn't do this kind of work through jme.

However, I'm not against the idea of creating a sort of a rockbox-like interface to a media player written in java. I just don't think it would really be rockbox at that point, however.
Title: Re: Rockbox for Java (mobile phones)?
Post by: rkostynu on January 08, 2007, 08:46:58 PM

What I do think is absurd is porting rockbox to jme. Why? Rockbox is developed as a DAP firmware, which means it manages the hardware of the device and provides functionality to the device. You can't and shouldn't do this kind of work through jme.



This is EXACTLY why Rockbox would be a nightmare to implement on Java....its firmware controlling hardware.....Java runs in a JVM ("Java Virtual Machine" for those who don't know)..its the JVM thats "talks" to the hardware via the operating system kernel ( and some direct/indirect hardware calls)

So the proper way would be to compile a JVM via the SDK Java source that is targetted for mobile devices...then write a Java program to run on top of the JVM inside the device.....a real nightmare and when you map out a strategy i doubt very little of the original rockbox source would be ported over, plus to the fact that Java is an object oriented language and not procedural in its design pattern, so you would probably use a different strategy anyways to save time, space, etc..

long story short, you will end up writing a JVM and player software in Java from scratch...which has value for Java and mobile Java devices.....but practically nothing in common with Rockbox
Title: Re: Rockbox for Java (mobile phones)?
Post by: saratoga on January 08, 2007, 09:06:14 PM


What I do think is absurd is porting rockbox to jme. Why? Rockbox is developed as a DAP firmware, which means it manages the hardware of the device and provides functionality to the device. You can't and shouldn't do this kind of work through jme.



This is EXACTLY why Rockbox would be a nightmare to implement on Java....its firmware controlling hardware.....Java runs in a JVM ("Java Virtual Machine" for those who don't know)..its the JVM thats "talks" to the hardware via the operating system kernel ( and some direct/indirect hardware calls)

So the proper way would be to compile a JVM via the SDK Java source that is targetted for mobile devices...then write a Java program to run on top of the JVM inside the device.....a real nightmare and when you map out a strategy i doubt very little of the original rockbox source would be ported over, plus to the fact that Java is an object oriented language and not procedural in its design pattern, so you would probably use a different strategy anyways to save time, space, etc..


You wouldn't need (or want) to java or OO at all.  You'd probably be targeting the JVM itself with a c compiler.  It could be done, but it'd be terribly annoying to setup, and I suspect you'd run into performance issues unless you had a very fast CPU to run the JVM, which makes this a pretty poor idea.
Title: Re: Rockbox for Java (mobile phones)?
Post by: alsaf on January 10, 2007, 01:51:25 PM
The biggest problem with a java mobile device is performance. No matter how you port it, there will always be a java layer between the the hardware and port. It would be just to damn slow to work as I know only too well with the media player I have on my Nokia 6230.

Sorry for going off-topic but what about the possibility of a future  standalone port of  smartphones/PDA's? Since they can run a version of linux (and other os's as well ie Symbian, Microsot CE, Palm Os? but not sure if they have the appropriate C compiler) it would be possible to port rockbox over to them?

I've found a link for linux smartphones currently on the market. I've checked the details of a few but doesn't give much details about the hardware specs

http://www.linuxdevices.com/articles/AT9423084269.html

These phones are far too expensive at the moment for mainstream use but in a few years it may be a different story.

Before I get flamed I think this would be a different project from rockbox which I think has done a wonderful job of breathing life into DAP's whose original firmware had put them into mediocrity.
Title: Re: Rockbox for Java (mobile phones)?
Post by: Llorean on January 10, 2007, 01:55:24 PM
Rockbox is a firmware. It interacts directly with the hardware, as an operating system.

There would be considerable hurdles to making it work as an application properly on those devices, even considering the already existent simulator, though for ones that have an SDL version they would be less than for others.