Rockbox Technical Forums

Rockbox Development => Starting Development and Compiling => Topic started by: zaphee on December 22, 2010, 04:45:42 PM

Title: A custom Rockbox build
Post by: zaphee on December 22, 2010, 04:45:42 PM
Dear Rockbox developers,
I would like to build my own custom copy of rockbox from source. More precisely, I want to disable the database (I never use it anyway), disable the equalizer (bass/treble settings are sufficient for me), enable USB support (since my main machine I throw music on my Clip+ from runs Linux, I don't think I'll have much trouble using that), and I also want the "backlight on volume change" option to be enabled. To do so, I need your help. I have very little coding experience and knowledge in C (yet still I'm learning), so step-by-step instructions would be highly appreciated.
Thank you.
Title: Re: A custom Rockbox build
Post by: saratoga on December 22, 2010, 07:15:44 PM
Check the "contribute" link on the front page.  Once you setup the build tools and build a normal build, you can edit the config file for your target in firmware/export/config to disable things. 
Title: Re: A custom Rockbox build
Post by: zaphee on December 23, 2010, 04:54:26 PM
Check the "contribute" link on the front page.  Once you setup the build tools and build a normal build, you can edit the config file for your target in firmware/export/config to disable things. 
OK, I managed to make a normal build without problems (got the .zip).
I've uncommented this :
Code: [Select]
//#define USE_ROCKBOX_USBand commented this :
Code: [Select]
#define USB_HANDLED_BY_OFin /rockbox/firmware/export/config/sansaclipplus.h

Now, I imagine that I have to build a bootloader that takes these settings  in account too. Then, I will have to modify the OF file with it manually (because rbutil won't modify it with the right bootloader, if I understand correctly) and reflash my player. How can I do ?
And where can I enable/disable features like database, equalizer etc. ?

Oh, and what does "#define HAVE_TUNER_PWR_CTRL" mean in sansaclipplus.h ? Can I uncomment it ?
Title: Re: A custom Rockbox build
Post by: saratoga on December 23, 2010, 06:24:52 PM
Now, I imagine that I have to build a bootloader that takes these settings  in account too.

No I don't think that really matters.

Oh, and what does "#define HAVE_TUNER_PWR_CTRL" mean in sansaclipplus.h ? Can I uncomment it ?

No idea, try grep and see where its used. 

And where can I enable/disable features like database, equalizer etc. ?

If theres no define for them, you'll have to dig into the code and figure out where they're called from.  Again, grep is your friend. 
Title: Re: A custom Rockbox build
Post by: zaphee on December 28, 2010, 06:58:12 AM
So I've built r28891 from source. Here are the changes I made in sansaclipplus.h (most of them were made "just to see what happens", yes, I know it's risky) :

Code: [Select]
127c127
< //#define HAVE_TUNER_PWR_CTRL
---
> #define HAVE_TUNER_PWR_CTRL
172c172
< #define CPU_FREQ      240000000
---
> #define CPU_FREQ      200000000
182,183c182,183
< #define USB_HANDLED_BY_OF
< //#define USE_ROCKBOX_USB
---
> //#define USB_HANDLED_BY_OF
> #define USE_ROCKBOX_USB
192c192
< //#define HAVE_ADJUSTABLE_CPU_FREQ
---
> #define HAVE_ADJUSTABLE_CPU_FREQ

The code compiled without errors, I managed to build the bootloader (and patch the clip+ firmware with it using mkamsboot that I built from svn) and the main firmware. So here's the feedback :

Knowing that the USB stack is supposed to be enabled (and stable) now, I connected my player to my Linux machine... and it froze with the flash activity indicator icon stuck on the screen ! I tried to connect it several times, but it never worked. Do I still have to apply some patch to make it work as expected ?
Now I have frequency scaling, which works only once in a while (shows 24 MHz most of the time and sometimes briefly jumps to 240 MHz when boosted, and not 200 MHz as I defined in sansaclipplus.h). The player got noticeably slower, but in the end it doesn't matter that much since it does save battery life, doesn't it ?
Also, I can't change the volume in this build. It just remains the same as it was last set in the previous build that was installed. The volume indicator, however, does change. Why is that ? I didn't touch sound-related #defines...
Title: Re: A custom Rockbox build
Post by: saratoga on December 28, 2010, 08:28:36 AM
Knowing that the USB stack is supposed to be enabled (and stable) now,

No its not.  It'll be enabled when its stable.

Now I have frequency scaling, which works only once in a while (shows 24 MHz most of the time and sometimes briefly jumps to 240 MHz when boosted, and not 200 MHz as I defined in sansaclipplus.h).

You can't just punch in random clock speed settings.  You'll also have to add code to the driver to actually generate that clock speed from various oscillators built into the player.