Rockbox Development > Starting Development and Compiling

Easy way to output some text in a codec?

(1/1)

dryrock:
I have been banging my head on my desk here...

In order to do some simple troubleshooting in some codec changes I just want to display some text on the screen when certain conditions are met (might happen once per song, we're not talking copious output here). Something like the splash() function you can use in a plugin would be ideal.

How can I do something like this in a codec though?

I also tried logging text with LOGF (configured my build with logf enabled) but I am not getting anything showing up in the log (debug menu) so I'm not sure if I am missing something else there. I'd prefer to see it in realtime though.


saratoga:

--- Quote from: dryrock on January 13, 2011, 10:23:31 AM ---In order to do some simple troubleshooting in some codec changes I just want to display some text on the screen when certain conditions are met (might happen once per song, we're not talking copious output here). Something like the splash() function you can use in a plugin would be ideal.

--- End quote ---

Unless you're writing assembly, its easiest to work in the sim and use DEBUGF.


--- Quote from: dryrock on January 13, 2011, 10:23:31 AM ---I also tried logging text with LOGF (configured my build with logf enabled) but I am not getting anything showing up in the log (debug menu) so I'm not sure if I am missing something else there. I'd prefer to see it in realtime though.

--- End quote ---

Additionally theres a define you have to add to each file where logf should be enabled, otherwise you'd get swamped with a thousand irrelevent logf messages from all over rockbox.  IIRC its pretty clear if you look at logf.h

That said doing codec work on device is absolutely terrible.  Almost all the codec stuff I've done was written for the sim first. 

dryrock:

--- Quote from: saratoga on January 13, 2011, 11:38:46 AM ---
Unless you're writing assembly, its easiest to work in the sim and use DEBUGF.


--- End quote ---

I figured (it's also 100 times quicker to test changes), but when I try to build for the simulator I get an error:

/home/user/rockbox/sim-fuzev2/apps/codecs/libcodec.a(fixedpoint.o)(.text.fp_sqrt+0x24): In function `isqrt':
/home/user/rockbox/apps/fixedpoint.c:112: undefined reference to `__builtin_clzl'

Looks like I can fake out make to get past the plugins and codecs that won't compile (they're not relevant to this test).


--- Quote from: dryrock on January 13, 2011, 10:23:31 AM ---I also tried logging text with LOGF (configured my build with logf enabled) but I am not getting anything showing up in the log (debug menu) so I'm not sure if I am missing something else there. I'd prefer to see it in realtime though.

--- End quote ---

Additionally theres a define you have to add to each file where logf should be enabled, otherwise you'd get swamped with a thousand irrelevent logf messages from all over rockbox.  IIRC its pretty clear if you look at logf.h

[/quote]

Yeah, I #defined LOGF_ENABLE in my source file. Perhaps it doesn't work properly on the fuze v2. I'll concentrate on getting the sim working for now.

gevaerts:

--- Quote from: dryrock on January 13, 2011, 01:10:03 PM ---Yeah, I #defined LOGF_ENABLE in my source file. Perhaps it doesn't work properly on the fuze v2. I'll concentrate on getting the sim working for now.

--- End quote ---

Did you define it before the #include "logf.h"?

dryrock:

--- Quote from: gevaerts on January 13, 2011, 01:55:43 PM ---
--- Quote from: dryrock on January 13, 2011, 01:10:03 PM ---Yeah, I #defined LOGF_ENABLE in my source file. Perhaps it doesn't work properly on the fuze v2. I'll concentrate on getting the sim working for now.

--- End quote ---

Did you define it before the #include "logf.h"?

--- End quote ---

Well, there's no #include "logf.h" but I defined it first. And I also tried using ci->logf() directly and it makes no difference.

But the good news is that after updating my build environment from the old debian based vmware VM to the newer Ubuntu-based xvm vm, I can build and run the simulator without problem and see the DEBUGF output. So that will suit my needs just fine.

And as it turns out, once I did a clean build in the new environment, LOGF output is coming out as well. Woohoo!

Navigation

[0] Message Index

Go to full version