Hooray!!! Rockchip SDK!
1Likes

 |
|

10th Jul 2009, 12:40 pm
|
 |
Senior Member
Valued Member
|
|
Join Date: May 2007
Posts: 1,285
|
|
I did a bit more on the custom mp3 player:-
Created a space for album art, need to figure out how to read a .jpg or .bmp from the flash and display it, pity, I'm not very good at C, anyone any ideas?
Would like to convert this at some point into a .rkp to give RK2608 owners a chance to try it out :-)
__________________
-----------------------------------------------------------------------------------------------------------
|

11th Jul 2009, 4:10 am
|
|
Member
I love my MPx player
|
|
Join Date: Jun 2009
Posts: 174
|
|
You need to use FileOpen to get handle of the file. Then you use FileRead to get data, next you convert it to 16bit bitmap raw data. And use one of the functions to display that data.
It is quite easy to get it work if you are editing the firmware. But if you are trying to do this inside RKP file it is more complicated.
Currently I am trying to link FileOpen to the RKP platform, so I would have access to the external files, while RKP platform provides functions only for processing data from the RKP resources.
Have anyone idea how to introduce FileOpen to the platform for RKP? As far as I know we need to make the correct link script file for this, but its a black magic for me.
Maybe someone has already got access to the files stored in flash using some other way? If that so, please share it with us.
|

26th Jul 2009, 8:58 am
|
 |
Senior Member
Valued Member
|
|
Join Date: May 2007
Posts: 1,285
|
|
There is some code in Platform.c which would launch rkp games from this RK2606 firmware.
Tried to use the code which extracts a .bmp icon from the rkp file to load album art, but it crashed!
This code is not included in the build but is there as an option to build in a rkp loader.
PlatformProtect(1);
LoadPicFromFlash(BMP_BROWSER_BK, &BrowserBKPic, BMP_BROWSER_BK_XSIZE, BMP_BROWSER_BK_YSIZE);
LoadPicFromFlash(BMP_BROWSER_SELECT, &SelectBKPIC, BMP_BROWSER_SELECT_XSIZE, BMP_BROWSER_SELECT_YSIZE);
for(i=0;i<7;i++)
LoadPicFromFlash(BMP_FILEDEFAULT, &IconPIC[i], BMP_FILEDEFAULT_XSIZE, BMP_FILEDEFAULT_YSIZE);
LoadPicFromFlash(BMP_FOLDER, &IconPIC[7], BMP_FOLDER_XSIZE, BMP_FOLDER_YSIZE);
PlatformMsgArray[0]=BROWSE_INIT;
Fun2MsgArray[1]=PLATFORM_FUN_WINDOW;
CurrentDrawPicBase=SDRAM_LOGICSCREEN_BASE;
PlatformPicType=0;
WindOutCnt=0;
}
/************************************************** ****************
*º¯ÊýÃû :GameExit
*¹¦ÄÜÃèÊö :Í˳öÓÎÏ·
*²ÎÊý²ÎÊý :ÎÞ
*Êä³ö²ÎÊý :ÎÞ
*°æ±¾ËµÃ÷ :×÷Õß Ê±¼ä ±¸×¢
* ÂÞÄþ 11/11/2006 Ô*°æ
************************************************** ****************/
PLATFORM_CODE
void GameExit(){
int i;
Fun2MsgArray[1]=PLATFORM_FUN_WINDOW;
PlatformMsgArray[0]=BROWSE_DISP;
WindowSet[0]=0;
WindowSet[1]=0;
WindowSet[2]=219;
WindowSet[3]=175;
PlatformProtect(1);
Platform_MusicOff();
FileClose(ProgramFile);
FileClose(MusicHandle);
ScreenWide=SYS_XSIZE;
ScreenHigh=SYS_YSIZE;
PicLoad_SdramAdd=SDRAM_RESOURCE_BASE;
LoadPicFromFlash(BMP_BROWSER_BK, &BrowserBKPic, BMP_BROWSER_BK_XSIZE, BMP_BROWSER_BK_YSIZE);
LoadPicFromFlash(BMP_BROWSER_SELECT, &SelectBKPIC, BMP_BROWSER_SELECT_XSIZE, BMP_BROWSER_SELECT_YSIZE);
for(i=0;i<7;i++)
LoadPicFromFlash(BMP_FILEDEFAULT, &IconPIC[i], BMP_FILEDEFAULT_XSIZE, BMP_FILEDEFAULT_YSIZE);
LoadPicFromFlash(BMP_FOLDER, &IconPIC[7], BMP_FOLDER_XSIZE, BMP_FOLDER_YSIZE);
Platform_Browse_FileInit();
while(DmaStateFlag&0x0002);
PlatformPicType=0;
DMA_LcdJpegInitX();
}
/************************************************** ****************
*º¯ÊýÃû :PlatformVolDown
*¹¦ÄÜÃèÊö :ÒôÁ¿¼õСһ¸ö¿Ì¶È
*²ÎÊý²ÎÊý :ÎÞ
*Êä³ö²ÎÊý :ÎÞ
*°æ±¾ËµÃ÷ :×÷Õß Ê±¼ä ±¸×¢
* ÂÞÄþ 11/11/2006 Ô*°æ
************************************************** ****************/
PLATFORM_CODE
void PlatformVolDown(){
if(GameVolValue<0x1f){
GameVolValue++;
Platform_VolumeSet(GameVolValue);
}
}
/************************************************** ****************
*º¯ÊýÃû :PlatformVolUp
*¹¦ÄÜÃèÊö :ÒôÁ¿Ôö´óÒ»¸ö¿Ì¶È
*²ÎÊý²ÎÊý :ÎÞ
*Êä³ö²ÎÊý :ÎÞ
*°æ±¾ËµÃ÷ :×÷Õß Ê±¼ä ±¸×¢
* ÂÞÄþ 11/11/2006 Ô*°æ
************************************************** ****************/
PLATFORM_CODE
void PlatformVolUp(){
if(GameVolValue>0){
GameVolValue--;
Platform_VolumeSet(GameVolValue);
}
}
/************************************************** ****************
*º¯ÊýÃû :Platform_Browse_SysInit
*¹¦ÄÜÃèÊö :ä¯ÀÀÆ÷³õʼ»¯º¯Êý
*²ÎÊý²ÎÊý :ÎÞ
*Êä³ö²ÎÊý :ÎÞ
*°æ±¾ËµÃ÷ :×÷Õß Ê±¼ä ±¸×¢
* ÂÞÄþ 11/11/2006 Ô*°æ
************************************************** ****************/
PLATFORM_CODE
void Platform_Browse_SysInit(){
int i;
PlatformBrowseInfo.DirDeep=0;
PlatformBrowseInfo.PathBuff[0]='\\';
PlatformBrowseInfo.PathBuff[1]='\0';
PlatformBrowseInfo.CurPickFileType[0]='R';
PlatformBrowseInfo.CurPickFileType[1]='K';
PlatformBrowseInfo.CurPickFileType[2]='P';
PlatformBrowseInfo.CurPickFileType[3]='\0';
}
__________________
-----------------------------------------------------------------------------------------------------------
|

26th Jul 2009, 10:30 am
|
|
Member
I love my MPx player
|
|
Join Date: Jun 2009
Posts: 174
|
|
First of all, try to display res file as album art. It is a format which doesn't have to be converted before displaying so it is the best solution for testing.
To do this, use this:
Code:
AlbumArt = FileOpen(filepath, "R");
DisplayPicFromFile(position x, position y, AlbumArt, 0, width, height, Normal, 220);
FileClose(AlbumArt);
prepare bitmap by using tool ImageConvert (from FWTOOLS) so you will get raw 16bit data of the image.
If you manage to display it, you may try to use other filetypes with convertion. But this is something you have to do at first.
BTW. I am working on improving game platform, and today I managed to increase the Sample Rate of the Audio resource (default is 11025hz which is awful).
To make it 22050hz use the following code:
at the beginning of the source code file:
Code:
#define write_mem(address, value) (*((unsigned int volatile*)(address)) = (value))
#define P_ADD_CCR (0x0006)
#define DW_APB_I2C_BASE 0x1e800
#define IC_DATA_CMD ((DW_APB_I2C_BASE + 0x10)/2)
and this code after the standard Music Platform Function:
Code:
write_mem(IC_DATA_CMD,P_ADD_CCR);
write_mem(IC_DATA_CMD,0x0033);
This will allow to use even 44100hz audiofiles, which is huge improvement to the standard of the game platform.
|

20th Aug 2009, 11:35 am
|
 |
Senior Member
Valued Member
|
|
Join Date: May 2007
Posts: 1,285
|
|
Had another go at displaying the pic in the music player screen
using this:-
FILE *ArtFile;
ArtFile = FileOpen("U:\\", "FOLDER.RES","R");
DisplayPicFromFile(1,20,ArtFile, 0, vinyl_XSIZE,vinyl_YSIZE, NULL, Normal, 220);//actual album art
The player just crashed, dunno whats wrong, this should work.
__________________
-----------------------------------------------------------------------------------------------------------
|

20th Aug 2009, 2:17 pm
|
|
Member
I love my MPx player
|
|
Join Date: Jun 2009
Posts: 174
|
|
You re making mistake with this function.
At first, FileOpen supports handle data type (you can use char too coz its the same), not as array (like this *file).
Secondable, the second parameter of the FileOpen suppose to be the path to the folder, just without the filename.
Use these lines instead:
PHP Code:
HANDLE ArtFile; ArtFile = FileOpen("U:\\SOME_FOLDER\\RES_FILE.RES", "U\\SOME_FOLDER","R"); DisplayPicFromFile(1,20,ArtFile, 0, vinyl_XSIZE,vinyl_YSIZE, NULL, Normal, 220);//actual album art // FileClose(ArtFile);
if that won't work, try to predefine parameters of the FileOpen like this:
char Filepath[12];
char Dirpath[12];
Filepath[0] = 'U';
Filepath[1] = ':'
Filepath[2] = '\'
... and so on so on.
Filepath[9?] = '\0' - remember to set the last array with this value, it defines ending of the string.
and then call FileOpen(Filepath, Dirpath, "R");
I would test it out but I cant compile working firmware for my player. I have Rockchip 2606A 320x240 and the screen is not supported so far
Last edited by flasher86; 20th Aug 2009 at 2:22 pm.
|

20th Aug 2009, 2:56 pm
|
 |
Senior Member
Valued Member
|
|
Join Date: May 2007
Posts: 1,285
|
|
Got this now:-
HANDLE ArtFile;
ArtFile = FileOpen("U:\\FOLDER.RES","U:\\","R");
DisplayPicFromFile(1,20,ArtFile, 0, vinyl_XSIZE,vinyl_YSIZE, NULL, Normal, 220);//actual album art
FileClose(ArtFile);
and I got FOLDER.RES in the root, it still crashes just the same as before :-(
Strange they use "U" as the drive in Rk26xx, Rk2706 uses "D" but I have tried "C" and "D" and the crash is just the same.
I'll have a go at using a char string next to store the file params.
__________________
-----------------------------------------------------------------------------------------------------------
|

20th Aug 2009, 3:05 pm
|
|
Member
I love my MPx player
|
|
Join Date: Jun 2009
Posts: 174
|
|
Its hard to give you advice while I didn't tried such things by myself. My only next clue would be that we cant open more than 2 files at a time(or use more than two handles). The whole fimware has only two Vars hMainFile and hSlaveFile. Maybe you can try to use this:
hSlaveFile = FileOpen...
without predefining hSlaveFile as it is already defined.
|

20th Aug 2009, 3:58 pm
|
|
Member
I love my MPx player
|
|
Join Date: Jun 2009
Posts: 174
|
|
hey knob, I will try to manipulate the sdk for my 320x240 screen but I have problems with compiling 2606A, it gets a lot of errors in FWTools 2.6.1.0 and I cant compile it.
How do you compile your 2608 firmware?
|

21st Aug 2009, 12:36 am
|
 |
Senior Member
Valued Member
|
|
Join Date: May 2007
Posts: 1,285
|
|
Here is a download to my build:-
Send big files the easy way. Files too large for email attachments? No problem!
there is a high chance it would make your player dead, so you would need to do a hard reset and
have a working backup.
you need to use firmware tools v3.0.29.02 and load in RK2606_MLC_Player.ini and hit build.
I had already stripped out a lot of the other functions like video, game and FM radio, it's just a music player to keep the build small. all the bmps are 220x176 of course.
I had to play around in "LCD_NEW_M_205.c" a lot to make the screen work.
__________________
-----------------------------------------------------------------------------------------------------------
|
|