Am 18.08.2010 15:02, schrieb pulkomandy:
Hello, Some days ago I introduced a new resampler that uses interpolation in the media kit. I'm still not happy with it, so I'm going to write another resampler, this time using a Lanczos filter, which should give much better results.
I would guess something is wrong with your filter, but some months ago (years?) I also wrote an uncommited resampling version and was also wondering why it didn't seem to have any affect on the quality. I did not trust my implementation though, just curious that you also seem to be unhappy with your resampling. In theory, it should already have enough quality.
However, the current API feels a bit unhandy for that purpose. For the filter to be efficient, I'd need to know some things when constructing my resampler object. With the current API, I can only know the format of the input and output, I'd also need the sample rate at that point to pre-calculate some tables of coefficients. Is it ok to make change to this API, or is it something that would create ABI problems ? It doesn't look like it's public anywhere. The code is in Resampler.cpp and MixerCore.cpp, in src/add-ons/media/media-add-ons/mixer/ .
Most likely no ABI implications then.
Another thing I'd like to know about the resampling is if the calls to Resample are done in order or if the buffers may get there in random order. This is important because I have to store data (a delay line) accross calls to this function, and it is important that the data is used in the right order.
I would be surprised if they are processed out of order, but why not find out with a little debugging?
One last thing : for debugging I'd like to add some printf() to the class I'm going to write. I think they will be printed on the console media_server is attached to. Is there a way to grab the input of the media_server started at boot ? Reattaching its stdout in some way ? Or should I kill the media server and restart it from terminal ?
Just "hey quit" it and launch it from the Terminal. Killing is no good, since it will leave the media_addon_server around.
Best regards, -Stephan