Page 1 of 1

JVLC(extension) - adding equalizer-control to JVLC

Posted: 26 Feb 2009 21:28
by n1kolaus
Hello m8s!

First of all, I wanna say the project going on here is really great and success of VLC-Player confirms the great work people are doing here! Thanks to all involved people for the effort and time spent on this issue so far!

As you might suspect from topic, my intention is to make the VLC-equalizer accessable via JVLC.


First of all, I'll show you the steps I've done so far...afterwards there will be some questions regarding further proceeding.

1.)Setting up development environment for compiling vlc-player on my own.
I've been using cygwin under windows xp for that. After lots of hours chasing, googling and eliminating error messages, I've been able to set this up successfully. As a result, I have a self-compiled running vlc application.
2.)Getting JVLC running in eclipse and building an example application.
This issue also took a lots of hours but I got it finally run now. The result of this is an application that is able to control the basic features of my self-compiled vlc player.

Well, now regarding further proceeding, I'll show you my approach to extend JVLC with the desired functionality.
I plead all people reading this, and especially vlc-coding-experienced developers, to tell me if my attempt is going the right way or not.

Since i found most of the JVLC functions in "vlc\src\control\audio.cpp", I decided to add my extension-functions (eq_enable(), eq_disable(), eq_set() etc...) in ths cpp file.

Is it possible, to get access to the equalizer from this source?? Any hint, constructive and deconstructive is very appreciated!

Thanks for your answers!
Greetings

Re: JVLC(extension) - adding equalizer-control to JVLC

Posted: 26 Feb 2009 21:53
by Jean-Baptiste Kempf
Can you document 1) and 2) ?

What access do you have to VLC internals? Can you load a module or a filter? Can you change any core variable?

Re: JVLC(extension) - adding equalizer-control to JVLC

Posted: 01 Mar 2009 22:47
by n1kolaus
Hello j-b

Thanks for your reply so far!
Well, being honest I don't know what you mean with "documenting 1) and 2)"?

Last day I was playing around a bit:
extending basic libvlc functions to my jvlc-environment in eclipse and adding the mentiones functions eq_enable().. in the file audio.c.
Iorientated on how the eq is being controlled by looking in the file "modules\gui\qt4\components\extended_panels.cpp", which is the implementation of the eq-gui.
So here's the code which i put in my enablement-function:

Code: Select all

/***************************************************************************** * libvlc_eqEnable : Enable Equalizer *****************************************************************************/ void libvlc_eqEnable( libvlc_instance_t *p_instance, char bands, libvlc_exception_t *p_e ) { //aout_instance_t *p_aout= (aout_instance_t *)vlc_object_find(p_intf, VLC_OBJECT_AOUT, FIND_ANYWHERE); aout_instance_t *p_aout = GetAOut( p_instance, p_e ); aout_EnableFilter( p_aout, "equalizer", true ); var_SetString( p_aout, "equalizer-bands", "0 0 0 0 0 5 5 5 5 5");
After successfully compiling and making a self-contained package, I tried to start this function via the JVLC-function is my eclipse-project.
As a result there came out the following debug log:

[0x7e10cd8] main audio output debug: removing module "converter_float"
[0x5f8c9c0] main audio filter debug: removing module "scaletempo"
[0x7cf9b10] main audio output debug: removing module "bandlimited_resampler"
[0x7d07e70] main audio output debug: input 's16l' 22050 Hz Stereo frame=1 samples/4 bytes
[0x7cf9b10] main audio filter debug: looking for audio filter module: 1 candidate
[0x7cf9b10] scaletempo audio filter warning: bad input or output format
[0x7cf9b10] main audio filter warning: no audio filter module matching "scaletempo" could be loaded
[0x7cf9b10] main audio filter debug: TIMER module_need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms)
[0x7cf9b10] main audio filter debug: looking for audio filter module: 1 candidate
[0x7cf9b10] scaletempo audio filter debug: format: 22050 rate, 2 nch, 4 bps, fl32
[0x7cf9b10] scaletempo audio filter debug: params: 30 stride, 0.200 overlap, 14 search
[0x7cf9b10] scaletempo audio filter debug: 1.000 scale, 661.000 stride_in, 661 stride_out, 529 standing, 132 overlap, 308 search, 1101 queue, fl32 mode
[0x7cf9b10] main audio filter debug: using audio filter module "scaletempo"
[0x7cf9b10] main audio filter debug: TIMER module_need() : 1.000 ms - Total 1.000 ms / 1 intvls (Avg 1.000 ms)
[0x7d07e70] main audio output debug: filter(s) 's16l'->'fl32' 22050 Hz->22050 Hz Stereo->Stereo
[0x5f8c9c0] main audio output debug: looking for audio filter module: 24 candidates
[0x5f8c9c0] main audio output debug: using audio filter module "converter_float"
[0x5f8c9c0] main audio output debug: TIMER module_need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms)
[0x7d07e70] main audio output debug: found a filter for the whole conversion
[0x7e10cd8] main audio filter debug: looking for audio filter module: 1 candidate
[0x7e10cd8] equalizer audio filter error: rate not supported
[0x7e10cd8] main audio filter warning: no audio filter module matching "equalizer" could be loaded
[0x7e10cd8] main audio filter debug: TIMER module_need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms)
[0x7e10cd8] main audio filter debug: looking for visualization module: 0 candidates
[0x7e10cd8] main audio filter error: no visualization module matched "equalizer"
[0x7e10cd8] main audio filter debug: TIMER module_need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms)
[0x7d07e70] main audio output error: cannot add user filter equalizer (skipped)


So for me it seems that the function call worked, but the equalizer could not be loaded and started.
Is there an need of adding the equalizer module in my eclipse-environment? any startup parameters needed?
Or is the problem because I pass a p_aout instance with the first parameter of the aout_EnableFilter function? In the eq gui there is passed a p_intf as first parameter.

Any other issues??


@j-b:
I think I have access on Variables, since it seems to me that vlc tries to load the module.
Don't know what you mean with "access to vlc internals" though.. :-(