It seems like you guys work out together well. I let you be alone at this point ^^
Please just make sure the code you do is very very clean and easy to use. If you need some FatFS related stuff inside the library, make sure you do #ifdef LCD_USE_FATFS or something. This would make sure that people without using this feature won't have any problems.
Keep hacking!
~ Tectu
picture rendering
Re: picture rendering
Hi Abhishek,
Yes you're right that SD is much faster then SPI however at the beginning my function with no circular buffer needed ~140 ms. The problem was somewhere inside f_read . I've made small test, reading 32k from SD directly using HAL and I had 10,6 MB/s. And then I only made a small change, I used 2 switching buffers instead of one and bum, from 140 ms I've got 27ms. After that I've just made correction to have only reads from one cluster and time went to 25 ms. I don't understand why this circular buffer helped so much, theoretically it should give so huge speed acceleration. I think that if we could skip f_read and use direct HAL function we might break 60 fps
By the way, is there any plans to support multi-language and unicode ? I've started developing my own GUI lib only because I could find any free software with this features. That is very important for commercial projects, like mine, but looks like no one wants to share code like this.
Yes you're right that SD is much faster then SPI however at the beginning my function with no circular buffer needed ~140 ms. The problem was somewhere inside f_read . I've made small test, reading 32k from SD directly using HAL and I had 10,6 MB/s. And then I only made a small change, I used 2 switching buffers instead of one and bum, from 140 ms I've got 27ms. After that I've just made correction to have only reads from one cluster and time went to 25 ms. I don't understand why this circular buffer helped so much, theoretically it should give so huge speed acceleration. I think that if we could skip f_read and use direct HAL function we might break 60 fps
By the way, is there any plans to support multi-language and unicode ? I've started developing my own GUI lib only because I could find any free software with this features. That is very important for commercial projects, like mine, but looks like no one wants to share code like this.
Re: picture rendering
Anubirux wrote:By the way, is there any plans to support multi-language and unicode ? I've started developing my own GUI lib only because I could find any free software with this features. That is very important for commercial projects, like mine, but looks like no one wants to share code like this.
There are no plans yet, feel free to bring anything up. I started to write an entire library because noone shared some useful stuff. Everything out there are just very basic "proof-of-concept" shares which are very very very very basic.
Make sure you are going the right way about licencing of your commercial thing. There is currently just a raw GPLv3 LICENCE file in there, I must think of how I am going with this within the next few days. I want to do it before there are 10k lines from other people.
At the moment, I just have to look at Badger and Abhishek.
Can I calculate with you as a new developer of this project? I guess it wouldn't make any sense for you to keep writing on your own library? Feel free to pull request any features of your lib which aren't included in this one. I take everything - just keep it easy, clean and tidy-up
~ Tectu
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: picture rendering
Hi,
Rather than accessing directly FatFs it would be advisable to access an externally defined BaseSequentialStream passed as parameter in order to access the data, that would make the function not dependent on any kind of media (it could wrap a file, a flash area, an USB stream etc it would not impact you).
Giovanni
Rather than accessing directly FatFs it would be advisable to access an externally defined BaseSequentialStream passed as parameter in order to access the data, that would make the function not dependent on any kind of media (it could wrap a file, a flash area, an USB stream etc it would not impact you).
Giovanni
Re: picture rendering
Thanks for your suggestion Sir. However I'll need to learn about the application of stream in ChibiOS. I'll read the documentation once again, and ask you my doubts.
Also, I had implemented a custom RAW sort-of-format which uses only a 8-byte header, just width, height and padding. Also data is stored in a more natural manner- from the top-left corner, first X increment then Y-inc till the bottom left corner. And since data is packed in 565 format, there is no conversion required from 24-bit format. I think apart from bitmap support, we could add suppott for this as the default format for storing icons in flash.
Also, I had implemented a custom RAW sort-of-format which uses only a 8-byte header, just width, height and padding. Also data is stored in a more natural manner- from the top-left corner, first X increment then Y-inc till the bottom left corner. And since data is packed in 565 format, there is no conversion required from 24-bit format. I think apart from bitmap support, we could add suppott for this as the default format for storing icons in flash.
Re: picture rendering
UPDATE: I found out that the latest development branch of ChibiOS 2.5.0 supports SDIO on F4 as well.
Will try out SDIO next week and report performance with my code.
Abhishek
Will try out SDIO next week and report performance with my code.
Abhishek
Re: picture rendering
Thanks mobyfab! I have this in mind (I suppose it has already come up in discussion on page 1) and will try it next weekend and post results. However I'll test SDIO first to get a fast file I/O first. You won't like to have an image appearing slowly.
Re: picture rendering
@ Tectu
I made a tour through current code and I have few comments on the library:
1. It looks very structured oriented but from nature graphic application, like this one, is objective.
2. It should be static as much as possible, maybe some really complex features would require it but normally it shouldn't be necessary.
3. Constant refreshing. IMHO its waste of MCU time, GUI should be asynchronous machine which responds for external or internal signals and only then change its own state.
Since I'm big enemy of criticism without presenting different idea of solving a problem here it's mine:
In the age of smartphones it is a perfect inspiration how modern GUI should looks like. Reasons ? I know just two but they are fairly convincing. Firstly, end users of application would be thankful if his new device will have similar user interface. Secondly, nowadays most cell phones have really good GUI which make them good examples. (I still can remember my HTC HD2 with Widows Mobile, comparing to my present Desire, I cant imagine how the hell I was able to work with the old one.)
So how to create such a hipper, uber, ultra, nice GUI like this one in picture below
:

At a glance, only displaying pictures and text is required. Cool so it will be so easy ! Of course it is not, but this two objects are main resources with building GUI. The third is broadly defined widget. But what exactly is widget ? Everything present on screen which is not a resource, like button, slider, icon,window, menu with buttons... Hmm, did I wrote menu with buttons inside ? Yes, it is nothing strange that object contains other objects, I would say that is just normal. Hah, so now, finally, with pictures texts (resources) and widgets I'm ready to create GUI. Do I ? Almost. Lets take a look on few screens below:

"Hmm, hmm, pictures like pictures, I can do same like this ones from my own cell."
"Yes of course, but please look closer. Do you see small bastard on top of each screen ?"
"Yes I do, but so what ?"
"It is on all pictures, unchanged, stable, present. It is status bar and it is standalone graphic application."
So finally application object have been "discovered". So with applications, widgets and resources instances you can do whatever you want to do. Only one more thing have to be done, how this objects will behave and interact each other. Of course it is very tough piece of work however creating solid core saves a lot of work later.
All what I've wrote above it is just draft of my idea of GUI abstraction. Ha, even not mine because idea of objective application development it is older then me and similar implementations exist in many GUI libraries, maybe even in all.
Please write what do you think about it. I write only a solution for my first pointed problem but answers for rest lies inside more specific draft of implemenation. If you like it I can describe all case more precisely. Please make comments and I'm waiting for any constructive criticism.
I made a tour through current code and I have few comments on the library:
1. It looks very structured oriented but from nature graphic application, like this one, is objective.
2. It should be static as much as possible, maybe some really complex features would require it but normally it shouldn't be necessary.
3. Constant refreshing. IMHO its waste of MCU time, GUI should be asynchronous machine which responds for external or internal signals and only then change its own state.
Since I'm big enemy of criticism without presenting different idea of solving a problem here it's mine:
In the age of smartphones it is a perfect inspiration how modern GUI should looks like. Reasons ? I know just two but they are fairly convincing. Firstly, end users of application would be thankful if his new device will have similar user interface. Secondly, nowadays most cell phones have really good GUI which make them good examples. (I still can remember my HTC HD2 with Widows Mobile, comparing to my present Desire, I cant imagine how the hell I was able to work with the old one.)
So how to create such a hipper, uber, ultra, nice GUI like this one in picture below

At a glance, only displaying pictures and text is required. Cool so it will be so easy ! Of course it is not, but this two objects are main resources with building GUI. The third is broadly defined widget. But what exactly is widget ? Everything present on screen which is not a resource, like button, slider, icon,window, menu with buttons... Hmm, did I wrote menu with buttons inside ? Yes, it is nothing strange that object contains other objects, I would say that is just normal. Hah, so now, finally, with pictures texts (resources) and widgets I'm ready to create GUI. Do I ? Almost. Lets take a look on few screens below:

"Hmm, hmm, pictures like pictures, I can do same like this ones from my own cell."
"Yes of course, but please look closer. Do you see small bastard on top of each screen ?"
"Yes I do, but so what ?"
"It is on all pictures, unchanged, stable, present. It is status bar and it is standalone graphic application."
So finally application object have been "discovered". So with applications, widgets and resources instances you can do whatever you want to do. Only one more thing have to be done, how this objects will behave and interact each other. Of course it is very tough piece of work however creating solid core saves a lot of work later.
All what I've wrote above it is just draft of my idea of GUI abstraction. Ha, even not mine because idea of objective application development it is older then me and similar implementations exist in many GUI libraries, maybe even in all.
Please write what do you think about it. I write only a solution for my first pointed problem but answers for rest lies inside more specific draft of implemenation. If you like it I can describe all case more precisely. Please make comments and I'm waiting for any constructive criticism.