WIP Settings causing .vis addon to crash (Philips Hue lights)
#1
Hey guys, I actually have my lights reacting to beats and looking pretty. But now that hacking is over, I'm trying to work on user settings. I have the settings.xml and language file showing settings when the settings icon is clicked in Kodi, but when I add this
Code:
return ADDON_STATUS_NEED_SAVEDSETTINGS;
in ADDON_Create Kodi crashes or the display goes blank. Debug mode's not helping me, everything looks normal. Without that I can change the settings and they are saved in my userdata, but not applied to the .vis.

Any idea what I'm missing with adding settings to this addon? Or are there common pitfalls when adding settings?

I think this will get you to my code: https://github.com/hardyt/xbmc/tree/Heli...s/WaveForm

Thanks!
Reply
#2
it looks correct apart from the void* streamed into the stringstream for the ip setting. need a backtrace..
Reply
#3
I've commented out all the setsettings code and it still blanks the screen after choosing a song and hitting the home button. Kodi continues to run and nothing odd is shown in the debug log.

WinDbg is complaining about no symbol files even though I pointed to C:\xbmc\project\VS2010Express\objs\visWaveform\Release\;C:\xbmc\project\VS2010Express\XBMC\Release. Any hints there?

Thanks for taking a look!

Here's the backtrace right now.

Code:
WARNING: Path element is empty
*** wait with pending attach
WARNING: Path element is empty
Symbol search path is: C:\xbmc\project\VS2010Express\objs\visWaveform\Release\;;C:\xbmc\project\VS2010Express\XBMC\Release
Executable search path is:
ModLoad: 00000000`01390000 00000000`0276f000   C:\Program Files (x86)\Kodi\Kodi.exe
ModLoad: 00000000`776e0000 00000000`77889000   C:\Windows\SYSTEM32\ntdll.dll
ModLoad: 00000000`778c0000 00000000`77a40000   ntdll.dll
ModLoad: 00000000`74a00000 00000000`74a3f000   C:\Windows\SYSTEM32\wow64.dll
ModLoad: 00000000`749a0000 00000000`749fc000   C:\Windows\SYSTEM32\wow64win.dll
ModLoad: 00000000`74990000 00000000`74998000   C:\Windows\SYSTEM32\wow64cpu.dll
ModLoad: 00000000`77380000 00000000`77490000   KERNEL32.dll
ModLoad: 00000000`76490000 00000000`764d7000   KERNELBASE.dll
ModLoad: 00000000`587c0000 00000000`589bf000   d3dx9_43.dll
ModLoad: 00000000`76b90000 00000000`76c3c000   msvcrt.dll
ModLoad: 00000000`76fc0000 00000000`77050000   GDI32.dll
ModLoad: 00000000`765c0000 00000000`766c0000   USER32.dll
ModLoad: 00000000`76830000 00000000`768d0000   ADVAPI32.dll
ModLoad: 00000000`76c60000 00000000`76c79000   SECHOST.dll
ModLoad: 00000000`763a0000 00000000`76490000   RPCRT4.dll
ModLoad: 00000000`75260000 00000000`752c0000   SspiCli.dll
ModLoad: 00000000`75250000 00000000`7525c000   CRYPTBASE.dll
ModLoad: 00000000`75f60000 00000000`75f6a000   LPK.dll
ModLoad: 00000000`76ec0000 00000000`76f5d000   USP10.dll
ModLoad: 00000000`6c860000 00000000`6c890000   DINPUT8.dll
ModLoad: 00000000`6bb00000 00000000`6bb72000   DSOUND.dll
ModLoad: 00000000`76a20000 00000000`76b7c000   ole32.dll
ModLoad: 00000000`71700000 00000000`71732000   WINMM.dll
ModLoad: 00000000`707a0000 00000000`707c5000   POWRPROF.dll
ModLoad: 00000000`761e0000 00000000`7637d000   SETUPAPI.dll
ModLoad: 00000000`77490000 00000000`774b7000   CFGMGR32.dll
ModLoad: 00000000`764e0000 00000000`7656f000   OLEAUT32.dll
ModLoad: 00000000`771f0000 00000000`77202000   DEVOBJ.dll
ModLoad: 00000000`6f4b0000 00000000`6f4c2000   MPR.dll
ModLoad: 00000000`71ab0000 00000000`71acc000   IPHLPAPI.DLL
ModLoad: 00000000`76820000 00000000`76826000   NSI.dll
ModLoad: 00000000`71aa0000 00000000`71aa7000   WINNSI.DLL
ModLoad: 00000000`75300000 00000000`75f4a000   SHELL32.dll
ModLoad: 00000000`77210000 00000000`77267000   SHLWAPI.dll
ModLoad: 00000000`6c8a0000 00000000`6c8b1000   NETAPI32.dll
ModLoad: 00000000`6c6e0000 00000000`6c6e9000   netutils.dll
ModLoad: 00000000`59110000 00000000`59129000   srvcli.dll
ModLoad: 00000000`6cc00000 00000000`6cc0f000   wkscli.dll
ModLoad: 00000000`1e000000 00000000`1e263000   python27.dll
ModLoad: 00000000`6ada0000 00000000`6ae43000   MSVCR90.dll
ModLoad: 00000000`6bbe0000 00000000`6bbf6000   Wlanapi.dll
ModLoad: 00000000`703a0000 00000000`703a6000   wlanutil.dll
ModLoad: 00000000`61bc0000 00000000`61c74000   libcdio-13.dll
ModLoad: 00000000`66000000 00000000`66102000   libiconv-2.dll
ModLoad: 00000000`10000000 00000000`100f5000   libxml2.dll
ModLoad: 00000000`6c0b0000 00000000`6c0b7000   WSOCK32.dll
ModLoad: 00000000`752c0000 00000000`752f5000   WS2_32.dll
ModLoad: 00000000`001d0000 00000000`002a9000   iconv.dll
ModLoad: 00000000`5a4c0000 00000000`5a4d3000   zlib1.dll
ModLoad: 00000000`6bba0000 00000000`6bbdc000   pdh.dll
ModLoad: 00000000`6b890000 00000000`6ba53000   d3d9.dll
ModLoad: 00000000`6fec0000 00000000`6fec9000   VERSION.dll
ModLoad: 00000000`6f3d0000 00000000`6f3d6000   d3d8thk.dll
ModLoad: 00000000`6f490000 00000000`6f4a3000   dwmapi.dll
ModLoad: 00000000`6f5d0000 00000000`6f5d8000   Secur32.dll
ModLoad: 00000000`77150000 00000000`771b0000   IMM32.dll
ModLoad: 00000000`77050000 00000000`7711c000   MSCTF.dll
ModLoad: 00000000`6fe80000 00000000`6fea1000   NTMARTA.dll
ModLoad: 00000000`76570000 00000000`765b5000   WLDAP32.dll
ModLoad: 00000000`71bb0000 00000000`71bbb000   pcwum.dll
ModLoad: 00000000`6c890000 00000000`6c899000   PerfOS.dll
ModLoad: 00000000`6d440000 00000000`6d452000   dhcpcsvc.DLL
ModLoad: 00000000`76380000 00000000`7638b000   profapi.dll
ModLoad: 00000000`6ac30000 00000000`6ac40000   nlaapi.dll
ModLoad: 00000000`6ac20000 00000000`6ac30000   NAPINSP.dll
ModLoad: 00000000`6ac00000 00000000`6ac12000   PNRPNSP.dll
ModLoad: 00000000`71b70000 00000000`71bac000   MSWSOCK.dll
ModLoad: 00000000`71b00000 00000000`71b44000   DNSAPI.dll
ModLoad: 00000000`6abf0000 00000000`6abf8000   WINRNR.dll
ModLoad: 00000000`71ad0000 00000000`71af7000   WLIDNSP.dll
ModLoad: 00000000`76c50000 00000000`76c55000   PSAPI.DLL
ModLoad: 00000000`6abe0000 00000000`6abed000   wshbth.dll
ModLoad: 00000000`04a30000 00000000`059ff000   avcodec-56.dll
ModLoad: 00000000`6ba70000 00000000`6baf7000   avutil-54.dll
ModLoad: 00000000`58a40000 00000000`58a6a000   swresample-1.dll
ModLoad: 00000000`62f70000 00000000`63150000   avformat-56.dll
ModLoad: 00000000`6acc0000 00000000`6ad52000   libgmp-10.dll
ModLoad: 00000000`66d80000 00000000`66ece000   libgnutls-28.dll
ModLoad: 00000000`05a00000 00000000`05e1e000   libhogweed-2-5.dll
ModLoad: 00000000`05e20000 00000000`0614f000   libnettle-4-7.dll
ModLoad: 00000000`68ec0000 00000000`68f36000   libp11-kit-0.dll
ModLoad: 00000000`766f0000 00000000`76810000   CRYPT32.dll
ModLoad: 00000000`771b0000 00000000`771bc000   MSASN1.dll
ModLoad: 00000000`06150000 00000000`06283000   avfilter-5.dll
ModLoad: 00000000`58a00000 00000000`58a3f000   postproc-53.dll
ModLoad: 00000000`58720000 00000000`587b6000   swscale-3.dll
ModLoad: 00000000`77270000 00000000`772f3000   CLBCatQ.DLL
ModLoad: 00000000`6bf30000 00000000`6bf69000   MMDevAPI.DLL
ModLoad: 00000000`6d850000 00000000`6d945000   PROPSYS.dll
ModLoad: 00000000`6bd60000 00000000`6bd96000   AudioSes.DLL
ModLoad: 00000000`6fed0000 00000000`6ff50000   UxTheme.dll
ModLoad: 00000000`0f0e0000 00000000`0f190000   sqlite3.dll
ModLoad: 00000000`6f9d0000 00000000`6fabe000   MSVCR120.dll
ModLoad: 00000000`6bb80000 00000000`6bb93000   cpluff.dll
ModLoad: 00000000`68f40000 00000000`68f63000   libexpat-1.dll
ModLoad: 00000000`704c0000 00000000`704c7000   AVRT.dll
ModLoad: 00000000`71b60000 00000000`71b65000   WSHTCPIP.dll
ModLoad: 00000000`71b50000 00000000`71b56000   WSHIP6.dll
ModLoad: 00000000`71a90000 00000000`71a96000   rasadhlp.dll
ModLoad: 00000000`71a50000 00000000`71a88000   fwpuclnt.dll
ModLoad: 00000000`586a0000 00000000`586dc000   libcec.dll
ModLoad: 00000000`06eb0000 00000000`06f19000   MSVCP100.dll
ModLoad: 00000000`78000000 00000000`780bf000   MSVCR100.dll
ModLoad: 00000000`77120000 00000000`7714e000   WINTRUST.dll
ModLoad: 00000000`70200000 00000000`7039e000   COMCTL32.dll
ModLoad: 00000000`63ff0000 00000000`64106000   aticfx32.dll
ModLoad: 00000000`6b770000 00000000`6b78b000   atiu9pag.exe
ModLoad: 00000000`63430000 00000000`63aea000   atiudx.exe
ModLoad: 00000000`626f0000 00000000`62e2e000   atiumdva.dll
ModLoad: 00000000`0a8c0000 00000000`0b35d000   igdumd32.dll
ModLoad: 00000000`0fda0000 00000000`0feb9000   ImageLib.dll
ModLoad: 00000000`6f410000 00000000`6f481000   MSVCP120.dll
ModLoad: 00000000`6b240000 00000000`6b2d6000   libcurl.dll
ModLoad: 00000000`69540000 00000000`69585000   libidn-11.dll
ModLoad: 00000000`61d80000 00000000`61ea9000   libeay32.dll
ModLoad: 00000000`6b080000 00000000`6b0c3000   libssl32.dll
ModLoad: 00000000`5f850000 00000000`5f859000   HID.DLL
(27e8.2bbc): Break instruction exception - code 80000003 (first chance)
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\Windows\SYSTEM32\ntdll.dll -
ntdll!DbgBreakPoint:
00000000`77730590 cc              int     3
0:024> g
ModLoad: 010b0000 010c0000   C:\Program Files (x86)\Kodi\addons\visualization.waveform\Waveform_win32.vis
ModLoad: 6f410000 6f481000   C:\Windows\SysWOW64\MSVCP120.dll
(27e8.2dd0): Stack overflow - code c00000fd (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
*** WARNING: Unable to verify checksum for C:\Program Files (x86)\Kodi\Kodi.exe
*** ERROR: Module load completed but symbols could not be loaded for C:\Program Files (x86)\Kodi\Kodi.exe
Kodi+0x961087:
01cf1087 8500            test    dword ptr [eax],eax  ds:002b:00322000=00000000
0:000:x86> !analyze -v
*******************************************************************************
*                                                                             *
*                        Exception Analysis                                   *
*                                                                             *
*******************************************************************************

***** OS symbols are WRONG. Please fix symbols to do analysis.

*************************************************************************
***                                                                   ***
***                                                                   ***
***    Your debugger is not using the correct symbols                 ***
***                                                                   ***
***    In order for this command to work properly, your symbol path   ***
***    must point to .pdb files that have full type information.      ***
***                                                                   ***
***    Certain .pdb files (such as the public OS symbols) do not      ***
***    contain the required information.  Contact the group that      ***
***    provided you with these symbols if you need this command to    ***
***    work.                                                          ***
***                                                                   ***
***    Type referenced: ntdll!_PEB                                    ***
***                                                                   ***
*************************************************************************
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for KERNEL32.dll -
*************************************************************************
***                                                                   ***
***                                                                   ***
***    Your debugger is not using the correct symbols                 ***
***                                                                   ***
***    In order for this command to work properly, your symbol path   ***
***    must point to .pdb files that have full type information.      ***
***                                                                   ***
***    Certain .pdb files (such as the public OS symbols) do not      ***
***    contain the required information.  Contact the group that      ***
***    provided you with these symbols if you need this command to    ***
***    work.                                                          ***
***                                                                   ***
***    Type referenced: nt!IMAGE_NT_HEADERS32                         ***
***                                                                   ***
*************************************************************************
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for ole32.dll -
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for ntdll.dll -
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for KERNELBASE.dll -
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for DSOUND.dll -
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for USER32.dll -
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for MMDevAPI.DLL -
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for MSWSOCK.dll -
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for WS2_32.dll -
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for atiudx.exe -
GetPageUrlData failed, server returned HTTP status 404
URL requested: http://watson.microsoft.com/StageOne/Kodi_exe/14_0_0_0/54990369/Kodi_exe/14_0_0_0/54990369/c00000fd/00961087.htm?Retriage=1

FAULTING_IP:
Kodi+961087
01cf1087 8500            test    dword ptr [eax],eax

EXCEPTION_RECORD:  ffffffffffffffff -- (.exr 0xffffffffffffffff)
ExceptionAddress: 0000000001cf1087 (Kodi+0x0000000000961087)
   ExceptionCode: c00000fd (Stack overflow)
  ExceptionFlags: 00000000
NumberParameters: 2
   Parameter[0]: 0000000000000000
   Parameter[1]: 0000000000322000

FAULTING_THREAD:  0000000000002dd0

DEFAULT_BUCKET_ID:  STACK_OVERFLOW

PROCESS_NAME:  Kodi.exe

ADDITIONAL_DEBUG_TEXT:  
Use '!findthebuild' command to search for the target build information.
If the build information is available, run '!findthebuild -s ; .reload' to set symbol path and load symbols.

MODULE_NAME: Kodi

FAULTING_MODULE: 00000000776e0000 ntdll

DEBUG_FLR_IMAGE_TIMESTAMP:  54990369

ERROR_CODE: (NTSTATUS) 0xc00000fd - A new guard page for the stack cannot be created.

EXCEPTION_CODE: (NTSTATUS) 0xc00000fd - A new guard page for the stack cannot be created.

EXCEPTION_PARAMETER1:  0000000000000000

EXCEPTION_PARAMETER2:  0000000000322000

MOD_LIST: <ANALYSIS/>

PRIMARY_PROBLEM_CLASS:  STACK_OVERFLOW

BUGCHECK_STR:  APPLICATION_FAULT_STACK_OVERFLOW_WRONG_SYMBOLS_ZEROED_STACK

LAST_CONTROL_TRANSFER:  from 0000000001529def to 0000000001cf1087

STACK_TEXT:  
WARNING: Stack unwind information not available. Following frames may be wrong.
00324170 01529def 00325020 01da553a ffffffff Kodi+0x961087
00324180 0151b285 00324224 11236db8 00008d04 Kodi+0x199def
00324184 00324224 11236db8 00008d04 00000000 Kodi+0x18b285
00324188 11236db8 00008d04 00000000 00000100 0x324224
003242a0 01455767 00000005 11236e38 1117b410 0x11236db8
00000000 00000000 00000000 00000000 00000000 Kodi+0xc5767


FOLLOWUP_IP:
Kodi+961087
01cf1087 8500            test    dword ptr [eax],eax

SYMBOL_STACK_INDEX:  0

SYMBOL_NAME:  Kodi+961087

FOLLOWUP_NAME:  MachineOwner

STACK_COMMAND:  ~0s ; kb

BUCKET_ID:  WRONG_SYMBOLS

IMAGE_NAME:  C:\Program Files (x86)\Kodi\Kodi.exe

FAILURE_BUCKET_ID:  STACK_OVERFLOW_c00000fd_C:_Program_Files_(x86)_Kodi_Kodi.exe!Unknown

WATSON_STAGEONE_URL:  http://watson.microsoft.com/StageOne/Kodi_exe/14_0_0_0/54990369/Kodi_exe/14_0_0_0/54990369/c00000fd/00961087.htm?Retriage=1

Followup: MachineOwner
---------
Reply
#4
a release build does not have symbols. you have to use a debug build.

i'll see if i find the the time to compile this stuff up on linux so i can debug it. no windows here..
Reply
#5
How do I compile just the .vis? There's no Makefile in the directory. I can compile the whole Kodi, but Kodi can't load the .vis, giving me the error: undefined symbol: _ZN3FFTD1Ev

I had to change some vortex .vis code and use

Code:
#include <cmath>
#include <time.h>

How do I modify ... to include the -lrt, -lcurl, and -lm flags for the time, curl, and math libraries? Since that's what I guess I'm missing.

Thanks! Almost "there" minus user options.

Resolution: added "fft.cpp -lcurl" to Makefile.in where the compile commands are at the bottom.
Reply
#6
it's not pretty in mainline to put it blunt ;>

you have to configure on top level, this will generate the Makefile from Makefile.in xbmc/visualizations/WaveForm
you can then make in that directory, and it will output the vis to toplevel/addons/visualization.waveform/waveform.vis

to change the libs linked libs you change the LDFLAGS in the else branch on line 27.

i suspect a linkage thing though. could it be that that function needs C linkage (i.e. extern "C" around the include prototyping it) ?
Reply
#7
Thanks for the lead. I'll give it another shot this afternoon.
Reply
#8
Just so you all don't think I'm crazy, this is what it looks like: http://youtu.be/l1MjcmX8j_A

I'll update the repository with the code that should compile in windows and linux and then I'm going to take a break for a couple weeks before I get the settings problem sorted. Until then you'll have to hardcode IPs and the light names.
Reply
#9
Ok, repository updated: https://github.com/hardyt/xbmc/tree/Heli...s/WaveForm
Reply
#10
A small update. My settings.xml used type "number". Type "number" returns crazy values. I had to use type "slider" with option="int". I also had to set the IsLocked function to return true. Now I'm on a role with the settings.
Reply
#11
If you want to build this grab the addon resources folder and the source from here: https://github.com/hardyt/xbmc/tree/Helix
I have it working now with settings on Windows, Ubuntu, and OpenELEC on a CuBox. To register with the lights, press the bridge button before you play a song.
Reply
#12
\o/

if you pinched source from milkdrop you better include the bsd license it is under.
Reply
#13
Then Vortex.cpp has the wrong license attached to it, too. The "pinched" comment was copied and pasted from that source. I'll put the license in there or take out the code if I can discern it. Thanks for the help along the way.

I'll get this packaged up as a real addon in the next couple weeks.

Edit: I reviewed the Milkdrop code and can't find anything recognizable. I think the reference was for the fft.cpp, which I included and does contain the Nullsoft license.
Reply
#14
Lightbulb 
Hardyt have you been able to package the addon for this? I have tried the hue addon at GitHub and can't get it to work for me. Also tried boblight but get error message "need binary". I am running kodi 14 on a g box q. Really want to get theses lights working with kodi, but I am not a programmer at all, sadly. Smile
Reply
#15
Sungolfer: I'm not sure what a g box q is, but the .vis addon works on Windows, Ubuntu, and OpenELEC on an imx6 CuBox: http://forum.kodi.tv/showthread.php?tid=...hilips+hue
Reply

Logout Mark Read Team Forum Stats Members Help
Settings causing .vis addon to crash (Philips Hue lights)0