Ok, here it is. The first kernel with a built in sinewave generator.

READ and UNDERSTAND the IMPORTANT notes below


The sinewave generator has the ability to generate sine waves of any arbitary integer frequency in the range 20Hz <= f <=17000Hz, at arbitrary ( 0 - full scale) volumes. This could potentially damage amps and speakers if abused. Before you even consider using this, you should have confidence that your system is correctly set up; especially with regards to crossover setttings, and amp gain settings.

I TAKE NO RESPONSIBILITY FOR ANY DAMAGE RESULTING FROM THE USE OF THIS FEATURE.

That being said, I have made it default to a relatively safe volume level, 50% of full scale. But there are no artificial limits on the frequency or volume that can be selected. If you know that your speakers aren't protected against strong sub bass signals, then pumping a full scale 20Hz sine wave into them may have an undesirable effect. Play nicely.

The sine wave generator output goes through your EQ and (hence bass/treble) stage. This will allow you to determine what effect an EQ is having on your overall response.
Assuming that you are looking to test/tweak your car's EQ, you probably want to turn your bass and treble settings off whilst doing this. It's probably a good idea to start from a sane EQ too.
The sine will also be scaled by the main volume control. I'd strongly suggest that you don't have your player on full volume the first time you play with the sinewave generator.

The generator defaults to a 5 second duration. This can be over-ridden in config.ini. You do not have to wait for the duration of a sine before starting another sine, but it is advisable to do so. The generator uses an attack and decay filter to try and avoid transient glitches. If you do not wait for the duration, the decay filter doesn't get utilised - so you will probably hear glitches. Same caveat applies to using the Cancel/* buttons (or top button) to exit the generator early.

Play nicely with low frequencies. I'm still endeavouring to eliminate glitches completely, but you may experience some minor start glitching at frequencies < 80Hz.

You will see a warning when you first use the sine generator. It will recommend reading the Hijack FAQ. There is currently nothing relevant in the FAQ - for the moment it really means reading this post and the warnings/caveats within. When this gets accepted into Mark's hijack tree, I'll ask Loren to update the FAQ. This warning can be permanently disabled via config.ini.

Only use this when the player is in MP3 mode. All of the frequency, duration and attack/release DSP coefficients are based on the sampling rate, and are only coded for 44100Hz. The tuner uses a 38KHz sampling rate (at least for FM, not sure about AM..), and that will result in incorrect sine frequencies and durations. (It won't do anything nasty, but the values will be wrong).
I currently don't have any plans to make it work for 38KHz too. I'll probably make it autoswitch to player mode (unless adding 38KHz support is just as easy, or lots of people shout at me to do it.).

Anyway - config.ini options:

[hijack]
sine_volume=x ( 0 <= x <= 100, default 50)
sine_duration=y ( 100 <= y(ms) <= 11888, default 5000)
sine_warning=0 Disables warning.

Setting sine_duration=11889 will cause the sine generator to play a continuous sine wave. Only starting another sine wave or cancelling it manually will stop it. You may notice some glitches at the start and end of this, since there is no attack or decay filter in effect in this mode. (Limitation of DSP)

Please do not post about the sine_warning option anywhere. I don't want people to be able to disable the on-screen warning without having read the long warning. Reference this thread (or the eventual FAQ entry) by all means.


Controls - Remote needed. Numeric keys to enter frequency. Menu (CD on Kenwood remotes) starts the sine. Cancel (* on KW) will clear the current entry line. If the line is already empty, it will quit back to the hijack menu.

Anyway, enough talk. Kernel is v320.hijack+sinewave.mk2.zImage

Only Mk2/Mk2a at the moment. AFAIK, it should compile and work for Mk1 too, but as I don't have a Mk1 so I haven't bothered yet.

This kernel also supports generating sine waves from userland applications too. I have a few command line utilities that I've been using for testing - I need to clean them up and comment them before I release them.

Now hopefully I haven't scared everyone away. Have fun, and give me some feedback.
_________________________
Mk2a 60GB Blue. Serial 030102962 sig.mp3: File Format not Valid.