Picture Visualization Development - Help needed
#16
If I understood correctly what I've googled and you just told me, this is the reason why I get the segfaults and gpu hangs.
However, I have no idea on how I'd fix that (mainly because I lake the understanding of that stuff ^^).

I started porting the pure SOIL part over to kodi and I finally see an image!! Wuhuuu!! (however the SOIL_FLAG_INVERT_Y doesn't seem to work meaning the picture is upside down right now. within my glut-project thing it does work.. very strange :/)

but one could call that progress Big Grin

Edit:
So using glut, while drawing the area/texture, I can just do this:
Code:
glBegin(GL_QUADS);
    glTexCoord2f(0.0f, 0.0f); glVertex2f(-1.0f, -1.0f);
    glTexCoord2f(1.0f, 0.0f); glVertex2f(1.0f, -1.0f);
    glTexCoord2f(1.0f, 1.0f); glVertex2f(1.0f, 1.0f);
    glTexCoord2f(0.0f, 1.0f); glVertex2f(-1.0f, 1.0f);
glEnd();
Note the glVertex2f with its values.
This will result in the image scaling/resizing pending on the window size. I can however also specify a real resolution.

Doing same thing on kodi just doesn't work. With Kodi I do have to specify the width and height in pixel (which I obviously don't want).

Does anyone know why that is? Or am I doing something wrong?
Reply
#17
So...
...why the freaking hell does kodi completely reinitialize the visualization when:
- toggeling fullscreen
- navigation within kodi
- resizing/moving the kodi-window

everything gets reset and I've now way of maintaining ANY state of the visualisation.
This means, every time the user decided to do "something" with kodi while playing music (and using this visualization) I have
to reinitialize the whole file structure and all the other crap.

This is driving me real made right now.
This is so pointless and stupid *sigh*

Sorry for this rant, but I seriously don't understand this.
Reply
#18
indeed it is a big stupid. it worked and was the simplest. the reason is that a visualization instance is tied to a gui control, and that gui control goes away if you resize or go to another window.

state needs to be serialized as-is.
Reply
#19
hm.. that's quite interesting.
I've been trying to write everything relevant to the visualization straight into a file to than read it back in.
Didn't work out to well and is kinda hacky anyway so I think I'll just accept it and hope for kodi to reconsider
the way the visualization instance works.
I mean.. Videos for example don't start over again, so why should a visualization ^^

oh one more question.
How can I get a translated version of a "special://" (e.g. "special://home") path in a c/c++ project?
For python addons there are methodes provided to translate and use them...
I did read the source of other c/c++ addons (within the kodi source-tree) but couldn't make any sense of it :/
Reply
#20
sadly i believe this is still missing in mainline.

in my fork you can use the GetSetting callback with the setting name '__addonpath__' to obtain it. i don't think upstream has picked that one.
Reply
#21
damn.. would have loved to display a default image when firing up the visualization the first time without a path configured :/
well.. looks like that's a "no no" as well than ^^

at least I figured out that the "FreqData" passed to the AudioData methode is actually fft-ed stuff. This should make my life sooooo much easier Smile
I THINK I understood how FFT is related to audio data and as far as I understood this should be the stuff I should use for visualizing the bars.
I've been so confused all the time that e.g. OpenGL-Spectrum, WaveForm, etc. don't use this value at all and only visualize the pure audiodata meaning it does animate, but has "nothing" to do with the music playing (where "nothing" means it doesn't really visualize bass etc.)
Using the FFT frequency values SHOULD (in theory) allow me to make the visualization look more like the pre-processed ones you find on youtube (So I hope at least)

Can't wait to get home and get that tested Smile

oh and ironic_monkey, thanks for taking the time to help me out with my questions.
I really do appreciate that Smile
Reply
#22
(2015-08-21, 12:02)ironic_monkey Wrote: sadly i believe this is still missing in mainline.

in my fork you can use the GetSetting callback with the setting name '__addonpath__' to obtain it. i don't think upstream has picked that one.

It's part of PR5329 see https://github.com/xbmc/xbmc/pull/5329/commits but it hasn't made it into master yet.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#23
I've bumped the PR on github if thats any help.
Reply
#24
zag: hope you didn't do that just because of me. I'd feel really bad about it ^^
Reply
#25
I could be wrong here (and I hope I am) but...

"Start" get's called with int iChannels, int iSamplesPerSec, int iBitsPerSample, const char* szSongName
where "iSamplesPerSec" would be the value I need to calculate the individual frequencies with the FFT'ed informations right? http://stackoverflow.com/a/4371627

So the problem, the "Start" method does ONLY get called when the visualization initializes but never "on track change".
As of the the kodi-source comments this should happen though
Line 118 -> https://github.com/xbmc/xbmc/blob/master...n.cpp#L118

Did I miss something super obvious or....?
Reply
#26
(2015-08-10, 12:58)Tadly Wrote: ...
Okay, signal processing is super complicated (at least for me) and that's why I give in. I read a lot (like a looooooot) and just don't get it.
...
If you have questions about signal processing don't hesitate to pm me.

If you can read German I have a very good link for you to learn signal processing stuff.

Tadly Wrote:"Start" get's called with int iChannels, int iSamplesPerSec, int iBitsPerSample, const char* szSongName
where "iSamplesPerSec" would be the value I need to calculate the individual frequencies with the FFT'ed informations right? http://stackoverflow.com/a/4371627
Sorry I'm not familiar with our Vis API. For me it looks like the sample rate and AudioData(const float* pAudioData, int iAudioDataLength, float *pFreqData, int iFreqDataLength) is to receive the data you need.
Maybe the information is wrong, but I think a good way to start is to read the source code of our existing visualizations. For example ProjectM
Latest news about AudioDSP and my libraries is available on Twitter.

Developers can follow me on Github.
Reply
#27
(2015-08-21, 20:29)Montellese Wrote:
(2015-08-21, 12:02)ironic_monkey Wrote: sadly i believe this is still missing in mainline.

in my fork you can use the GetSetting callback with the setting name '__addonpath__' to obtain it. i don't think upstream has picked that one.

It's part of PR5329 see https://github.com/xbmc/xbmc/pull/5329/commits but it hasn't made it into master yet.

this just got merged
Reply
#28
(2015-09-04, 19:53)wsnipex Wrote: this just got merged

Awesome, nice to hear and thanks for the update Smile
Reply

Logout Mark Read Team Forum Stats Members Help
Picture Visualization Development - Help needed0