Solved XBMC 12 Beta 1 + iMon LCD (spectrumanalyzer)
#1
Hi all,

I was just trying to apply the old imon patch against the new Beta, but with no success.

Does anybody know if there is a current version of this patch:
http://trac.xbmc.org/ticket/8981

floating somewhere?
Reply
#2
Hi all,

I managed to get the patch compiling. Spectrum analyzer does not work, there is a code change which I have no idea how to adapt.
One variable was a short and is now a float.

What does work are the small icons and the spinning disc, so everything but the spectrum analyzer. Spectrum Analyzer leads to a segfault.

Patch for current xbmc-nightly ubuntu ppa (git201211252059~23d85ee) can be found here:
http://files.coolinger.net/imon.patch


Perhaps someone can have a look at the code and fix it...
The problem should be this part:
xbmc/linux/XLCDproc.cpp:
Code:
void XLCDproc::SetSpectrumAnalyzerAudioData(const float* psAudioData,
    int piAudioDataLength, float *pfFreqData, int piFreqDataLength)
{
  unsigned int i = 0;
  int c = 0, y = 0;
  float val;
  int* xscale;

  // scaling for the spectrum analyzer
  if (m_iColumns == 16)
  {
    // for 16 char-displays
    int scales[] =
    { 0, 1, 2, 3, 5, 7, 10, 14, 20, 28, 40, 54, 74, 101, 137, 187, 255 };
    xscale = scales;
  }
  else //if (m_iColumns == 20)
  {
    // for 20 char-displays
    int scales[] =
    { 0, 1, 3, 5, 9, 13, 19, 26, 34, 43, 53, 64, 76, 89, 105, 120, 140, 160,
        187, 220, 255 };
    xscale = scales;
  }

  //  CLog::Log(LOGINFO, "XLCDproc::%s", __FUNCTION__);

  for (i = 0; i < m_iColumns; i++)
  {
    for (c = xscale[i], y = 0; c < xscale[i + 1]; c++)
    {
      if (c < piAudioDataLength)
      {
        if(psAudioData[c] * 255.0 > y)
          y = (int) (psAudioData[c] * 255.0);
      }
      else
        continue;
    }
    y >>= 7;
    if (y > 0)
      val = (logf(y) * scale);
    else
      val = 0;
    if (audioDataBeforeDisplaying == 1)
      heights[i] = val;
    else
      heights[i] += val;

    //    CLog::Log(LOGINFO, "XLCDproc::%s y=%d f%f, i=%d", __FUNCTION__, y, heights[i], i);
  }
  audioDataBeforeDisplaying++;
}
I had to change psAudioData from short to float, and did only that.

Greetings Coolinger
Reply
#3
Have you tried the new python lcd addon?
It's based on those patches and works quite fine with the imon lcd (and supports also the icons):
https://github.com/herrnst/script.xbmc.lcd/wiki

However I'm not sure if it has support for spectrum analyzer yet, but it's for sure a good idea to ask in the addons support thread here:
http://forum.xbmc.org/showthread.php?tid=143912
Reply
#4
Thank you very much for pointing me to this.
That is exactly what I was hoping for.
No more compiling the whole thing on the atom processor of my htpc Smile

Just out of curiosity, where can I find gems like that?
Reply
#5
(2012-11-30, 17:06)cfetzer Wrote: Have you tried the new python lcd addon?
It's based on those patches and works quite fine with the imon lcd (and supports also the icons):
https://github.com/herrnst/script.xbmc.lcd/wiki

However I'm not sure if it has support for spectrum analyzer yet, but it's for sure a good idea to ask in the addons support thread here:
http://forum.xbmc.org/showthread.php?tid=143912

Thank you for your advice. It's great. Does it support russian cyrillic font cp1251? If it doesn't, How can I get it? Should I change LCDd.conf or make patch?
Reply
#6
Hi all,

Spectrum analyzer would - display-wise - be relatively easy to implement in the python addon. However, it currently seems to be impossible to access the audio/FFT-data in XBMC's core, so there's no data available to display Smile

For those of you who still like to use the core LCD implementation (deprecated and not recommended at all anymore!) and have the iMON/mdm166a functionality from #8981 (also no SpAn functionality though, I guess this would also need major adaptions since the AE merge), you can compile from my imonlcd branch (vanilla XBMC from master + iMON patch) which is kept in sync with master.

But be WARNED: I will stop maintaining that branch/the core patch the day Frodo final is tagged! You should really upgrade to the python addon as it runs much more stable, correctly, and provides many more features.

Regards,
nst

script.xbmc.lcdproc!
Leia+VAAPI+HD-Audio+LCDproc addon,TVHeadend-master/DVB-C/T2+pvr.tvh addon on Ubuntu 18.04 (amd64)
Reply
#7
Hello herrnst,
at the beginning I would like to thank you for the great work.

I have installed https://github.com/herrnst/script.xbmc.lcd but script returns error, from what i see LCDd work fine. I can connects using telnet to LCDd i send command.
unfortunately when i use xbmc lcd LCDd returns "LCDd: sock_send: socket write error", can ask for helh my setup:
- Debian SID
- lcdproc 0.5.5-2
- xbmc frodo rc2
- script.xbmc.lcd git master branch

Reply
#8
Hi,

(2012-12-24, 02:30)m_o_d Wrote: I have installed https://github.com/herrnst/script.xbmc.lcd but script returns error, from what i see LCDd work fine. I can connects using telnet to LCDd i send command.

Sounds like a bug hiding somewhere in the script. Can you set the loglevel to debug (e.g. "loglevel=1" in advancedsettings.xml), then reproduce the script error and send me the relevant lines of your xbmc.log?

(2012-12-24, 02:30)m_o_d Wrote: unfortunately when i use xbmc lcd LCDd returns "LCDd: sock_send: socket write error", can ask for helh my setup:

At least you should get "something" on the display. When both variants fail, maybe there's a generic configuration problem with your LCDd. To get a better experience, we should concentrate to get the addon working for you. As said above, xbmc.log with debug level would be very helpful Wink

Happy Xmas,
nst
script.xbmc.lcdproc!
Leia+VAAPI+HD-Audio+LCDproc addon,TVHeadend-master/DVB-C/T2+pvr.tvh addon on Ubuntu 18.04 (amd64)
Reply
#9
Thanks for reply
here is the log http://pastebin.com/kPCAzaS9
Reply
#10
(2012-12-26, 14:17)m_o_d Wrote: Thanks for reply
here is the log http://pastebin.com/kPCAzaS9

Uh, good catch on a potential problem with the script Wink Thanks for the report!

First, you don't have a valid LCD.xml describing what to display on your LCD in your $HOME/.xbmc/userdata/ or in /usr/share/xbmc/userdata/ (actually, it exists but is empty for some reason). For advice on how it should look like, please see the example in the addon wiki page - this should get you going.

Second, to avoid the script crash in the future, please update to latest GIT master. LCD.xml faults are now caught Wink

Edit: 88d4c3b further improves on this.

Best regards,
nst
Reply
#11
thanks working fine
Reply

Logout Mark Read Team Forum Stats Members Help
XBMC 12 Beta 1 + iMon LCD (spectrumanalyzer)0