mdeguzis / RetroRig

(discontinued) Repository for XBMC Retro gaming on x86_64 Linux systems
Other
74 stars 12 forks source link

XBMC hangs sometimes upon exit/start #45

Closed beaumanvienna closed 10 years ago

beaumanvienna commented 10 years ago

Last words from ~/.xbmc/temp/xbmc.log http://slexy.org/view/s20Yf2NDdL

at line 123: 13:27:15 T:139868193769408 NOTICE: unload skin and next line 13:27:15 T:139868193769408 WARNING: Cleanup: Having to cleanup texture colors/selected.png

Looks like it can't unload the skin.

mdeguzis commented 10 years ago

I noticed this sometimes, and it is terrible when it does it, leaving me with no choice but to use pkill or grep for xbmc.bin and kill it. We will have to look at this. It is not everytime that it does it. Wonder if it is a permissions issue on that file or something. I am curious why it is only sometimes too.

See tweet to skin dev: https://twitter.com/N3RD42/status/483224809740840960

mdeguzis commented 10 years ago

This is also on start sometimes as well. This should be the next thing that is fixed, as I know this will annoy some people.

beaumanvienna commented 10 years ago

I want to have a look at this next. It get a bit annoying...

mdeguzis commented 10 years ago

Same here, I am looking at logs, but I'm not quite sure what's causing it. The XBMC skin dev replied and said this happens sometimes too to him so he thinks its XBMC. Maybe we can make it if XBMC doesn't terminate in X amount of seconds after hitting exit on the main screen, it does a grep for xbmc.bin and kills it.

beaumanvienna commented 10 years ago

I did investigate a bit, but I'm just starting.

Somehow, it's waiting for a thread to terminate, which never happens. I haven't reached the bottom of this jungle though.. This is how it looks like: http://slexy.org/view/s2SqHtjA9B

You could test with my version, backup your current version and copy it to /usr/share/lib/xbmc/. Update rescan with 018787a789e6baeae786d45a6e595ed6d6910263. http://www.file-upload.net/download-9162940/xbmc.bin.html

mdeguzis commented 10 years ago

I'm taking a look at the failed hid-sony.ko kernel module that has regressed for USB support on Ubuntu 14.04 with 3.13.0-30-generic. It is known and I started an issue. bummer. I'll take a look at this a ton tomorrow while I do house chores.

beaumanvienna commented 10 years ago

I have made a debug version for XBMC that first of all doesn't hang upon exit anymore. I killed some uninitialization code, mostly in some destructors, quite brute force. It appears to be working just fine tough. I would need some beta testers for this. Please download it from here, there's a README file which tells you what do: http://en.file-upload.net/download-9169387/debuggingXBMC140705.tar.gz.html

This debug version also outputs a lot of debug messages, which could help us fix this issue.

DISCLAIMER: What this version does is just curing symptoms. It won't hang, when the sub-threads are messed up. I haven't found the root cause for that! During my tests the PLAY button on the front page was always defunct before the hanging occurred. Any feedback on this testing software is higly appreciated.

mdeguzis commented 10 years ago

JC, you rule. The play button only didn't work when the skin load would not work. It always seemed to be the same issue. This is the home.xml code section, so it is the only change that does anything with that button:

Location: RetroRig/XBMC-cfgs/addons/skin.maximinimalism/1080i
Contents:

                    <item>
                        <visible>!Skin.HasSetting(hideVideo)</visible>
                        <label>31000</label>
                        <label2></label2>
                        <thumb>-</thumb>
                        <onclick>RunAddon(script.games.rom.collection.browser)</onclick>
                    </item>

The skin dev said he was also working on integrating RCB better, so I will test his changes as well, he makes this call instead:

    <item>
<visible>!Skin.HasSetting(hideGames) + System.HasAddon(script.games.rom.collection.browser)</visible>
                        <label>31156</label>
                        <label2></label2>
                        <thumb>-</thumb>
                        <onclick>RunScript(script.games.rom.collection.browser)</onclick>
                    </item>

Let me go do the errands I need this morning, and tidying up the PS3 USB initial tests, and ill try this too. He uses RunScript vs. RunAddon, so maybe that will help and I can just make a few adjustments.

mdeguzis commented 10 years ago

Testing this now JC, it's actually /usr/lib/xbmc/ not /usr/share/lib/xbmc/

as in

cp ~/Downloads/xbmc.bin /usr/lib/xbmc/

The good news?
Feels quicker already!

Just on preliminary testing, I saw we put this in the beta (after a fresh rebuild). Update build-xbmc.sh and the SHA value, if different in rescan. I'm very impressed. If you wish to make this "cleaner", then ok. In my tests, the play button worked fine.

beaumanvienna commented 10 years ago

Where are you referring to? I checked to README.txt. It says /usr/lib/xbmc...

mdeguzis commented 10 years ago

I copied to the location I had xbmc.bin. You wrote:

You could test with my version, backup your current version and copy it to /usr/share/lib/xbmc/.

When I think you meant /usr/lib/xbmc , just as you said.

beaumanvienna commented 10 years ago

Ok, that's from Friday right? Yeah, I do confuse these folders sometimes... My bad.

mdeguzis commented 10 years ago

So far so good still with testing this. There are times when it takes about 8 seconds, but it still closes.

mdeguzis commented 10 years ago

I'm also thinking of pasting a version number to the home screen background so folks can see it. Good idea?

beaumanvienna commented 10 years ago

Yes, very good idea. If you have any observation for xbmc please paste the debug output. Or ~/.xbmc/temp/xbmc.log. Thanks!

mdeguzis commented 10 years ago

I just had a hang here is temp/xbmc.log: http://slexy.org/view/s25mfnt5A4

For the debug out (if it happens again), should I just run startXBMC.sh in a terminal session for your debug version?

mdeguzis commented 10 years ago

Updated the background with version number. I can always move it around if its hard to see with the black overlay that is one (which I am still trying to figure out how to turn off, just haven't looked lately).

mdeguzis commented 10 years ago

Did you use sha1sum to get the hash for the new xbmc.bin? I get:

test@test-pc:~$ sha1sum /usr/lib/xbmc/xbmc.bin 
4af49129311cdf5084cd22f41cdaf19af1816172  /usr/lib/xbmc/xbmc.bin

Maybe I have the wrong xbmc.bin? If I do this in the tar file directory, I get:

test@test-pc:~/debuggingXBMC140705$ ls
AddonManager.cpp.patch
Application.cpp.patch
AppParamParser.cpp.patch
compile.sh
createPatches.sh
LanguageInvokerThread.cpp.patch
main.cpp.patch
PythonInvoker.cpp.patch
README.txt
ScriptInvocationManager.cpp.patch
ScriptInvocationManager.h.patch
Service.cpp.patch
TextureManager.cpp.patch
Thread.cpp.patch
xbmc_Application.cpp_-13.1-Gotham-interrupt_handler_for_SIGUSR1.patch
xbmc_AppParamParser.cpp_-13.1-Gotham-version_disply_shows_RetroRig_patch.patch
xbmc.bin
test@test-pc:~/debuggingXBMC140705$ sha1sum xbmc.bin 
da61240fe6763ae1c41293c6788cdf31fe5a133b  xbmc.bin
beaumanvienna commented 10 years ago

Yep, it would have deadlocked completely w/o my debugging patches, you can see that in line 133.

Line 119 is also an indicator for that.

Did you notice anything else other then the 8s hanging? The Play button on the front screen was not broken? (It usually is when I get this bug)

This debugging versions looks better every day! What you just posted confirms that it's solving the hanging not only for me :-)

I suggest we will run this experiment for some more days, maybe until next Friday. Next weekend we can decide how patch level 3 should look like. My suggestion would be to remove the outputs to stdout, and place a CLog::Log(LOGWARNING,""); instead. Currently some debugging messages are printed to CLog::Log (that's the function writing to .xbmc/temp/xbmc.log), but not all.

To get the SHA1 refer to https://github.com/ProfessorKaos64/RetroRig/blob/master/scriptmodules/setup.shinc line 346. It should be mentioned in the README.txt as well

mdeguzis commented 10 years ago

Did you notice anything else other then the 8s hanging? The Play button on the front screen was not broken? (It usually is when I get this bug)

I got that sometimes.

I'll save my hangs to a folder on dropbox for ya so you can review at any time. I'll seperate them by xbmc's log and your debug info, with the date. I'll turn off terminal=false for startXBMC.sh for now.

beaumanvienna commented 10 years ago

Wait

mdeguzis commented 10 years ago

For the sha I get:

test@test-pc:~$ file /usr/lib/xbmc/xbmc.bin | cut -f 19 -d ' '| cut -f 2 -d '='|cut -f 1 -d ','
94de5b8b9b80cae1ca3b08480ef1b24417386d10

Which is different than the one you posted above:

I did investigate a bit, but I'm just starting. Somehow, it's waiting for a thread to terminate, which never happens. I haven't reached the bottom of this jungle though.. This is how it looks like: http://slexy.org/view/s2SqHtjA9B

You could test with my version, backup your current version and copy it to /usr/share/lib/xbmc/. Update rescan with '018787a789e6baeae786d45a6e595ed6d6910263.' http://www.file-upload.net/download-9162940/xbmc.bin.html

I copied the xbmc.bin out of the tar file you gave me.

beaumanvienna commented 10 years ago

This is the SHA1 stated in the README.txt.

Are you using ~/Dropbox/RetroRig/Testing/debuggingXBMC140705.tar.gz?

mdeguzis commented 10 years ago

I just downloaded the tar file, and extracted it. Then cd into that dir and did:

test@test-pc:~/debuggingXBMC140705$ file xbmc.bin | cut -f 19 -d ' '| cut -f 2 -d '='|cut -f 1 -d ','
94de5b8b9b80cae1ca3b08480ef1b24417386d10
test@test-pc:~/debuggingXBMC140705$ 
beaumanvienna commented 10 years ago

Again we have learned to make a lot of use of checksums. ;-) Good. I had posted an update yesterday, but now you got it right! The version from Friday actually may hang. Puhh, glad we found that.

mdeguzis commented 10 years ago

Ok, just let me know the Sha value and when you upload a new file and i'll update mine as well. Thanks JC! Wonder if we should make a forum so we avoid long threads, since github doesn't use pages.

beaumanvienna commented 10 years ago

Yeah, I think we manage all this stuff quite good already. We just did find a wrong checksum, didn't we? Let's test with this version for a while. This version contains actual changes to xbmc while the version from Friday was just printing debug messages. If you have a look at the readme.txt, I am messing around with the threads now. I tried to do this as carefully as possible. It is skipping the overlay I path completly, which only gets called if the threads are broken. And in some destructors I skip code only if the main(argv, argc) function has been left. At this point in time the window is already destroyed, so it shouldn't interfere with the regular operation.

Thanks for the testing. Like I said, we do need more beta testers. So it's cool, that you chimed in with my post at the mednafen forum! :-D

mdeguzis commented 10 years ago

Can I make that folder on dropbox to house debug logs for myself?

By the way: http://www.libregeek.org/forum/

:)

beaumanvienna commented 10 years ago

Sure. Go ahead.

Nice! How cool is that?? :-D

beaumanvienna commented 10 years ago

IRC?

mdeguzis commented 10 years ago

JC, this is what I get when starting the Play button and it fails:

debug jc: CThread::CThread(const char* ThreadName) (Overlay I) for new thread 'LanguageInvoker'
debug jc: CThread::CThread(const char* ThreadName) (Overlay I) terminated
debug jc: CThread::Create() for 'LanguageInvoker'
debug jc: CThread::Create() terminated

Funny thing is I get the same thing when it works. lol

beaumanvienna commented 10 years ago

That's not the indicator. It's http://slexy.org/view/s25mfnt5A4 line 133. This is never called in normal operation.

mdeguzis commented 10 years ago

Ah I see. My mistake. Ok. Time to get back to sleep after waking up for a snack haha.

beaumanvienna commented 10 years ago

:-D

mdeguzis commented 10 years ago

after this week of testing JC, do you think that's enough time with the new xbmc binary we are currently using as the debug versions? The dotfile move to retrorig works, so I built that in with a variable, see latest 2 commits. If there are any mistakes, let me know as I didn't have time for a scratch install this morning.

beaumanvienna commented 10 years ago

The thing is, from the 14th on, I won't have time for RetroRig for about two or three weeks. We could change to patch level 3 before that. I would like to remove the output to stdout and improve the internal logging a bit. Maybe on Thursday or Friday? Then we have the weekend to check if the patch level three packages work fine. The broken xbmc icon could also be fixed in this release. I think this bug was introduced when we started installing xbmc_Gotham_V13.1_patched_for_RetroRig_patchlevel_2.deb. Cool that you started working on #31! I like that! Time for the big show now ;-)

mdeguzis commented 10 years ago

Aww, lucky you get to watch that live. Yea, if you are leaving, I'd like to work out the tougher things you just stated. I can handle things fine, just need help on that stuff. Logging yes, we need to improve that, but should be something easy to fix up. Sounds good! Let's put this thing into high gear :)

When I get home, I will have to figure out why RCB doesn't start unless you have any quick ideas. I must have copied something wrong, but i'll check when I get home.

On Mon, Jul 7, 2014 at 12:57 PM, Jens-Christian notifications@github.com wrote:

The thing is, from the 14th on, I won't have time for RetroRig for about two or three weeks. We could change to patch level 3 before that. I would like to remove the output to stdout and improve the internal logging a bit. Maybe on Thursday or Friday? Then we have the weekend to check the patch level three packages work fine. The broken xbmc icon could also be fixed in this release. I think this bug was introduced when we started installing xbmc_Gotham_V13.1_patched_for_RetroRig_patchlevel_2.deb. Cool, that you started working on #31 https://github.com/ProfessorKaos64/RetroRig/issues/31! I like that! Time for the big show now ;-)

— Reply to this email directly or view it on GitHub https://github.com/ProfessorKaos64/RetroRig/issues/45#issuecomment-48205904 .

Michael DeGuzis Email: mdeguzis@gmail.com Website: http://www.libregeek.org Linked In Resume/Profile http://www.linkedin.com/profile/view?id=124915388&trk=nav_responsive_tab_profile

beaumanvienna commented 10 years ago

I still this issue with RCB that the import doesn't work, but I had that with .xbmc in ~/ as well.

This how far I get: http://imgur.com/y4FHvs0

mdeguzis commented 10 years ago

You can paste me the config.XML file and what ROM filename and folder you put it in. Prior to my changes this morning, I had no issue importing my ROMs

On July 7, 2014 2:03:12 PM EDT, Jens-Christian notifications@github.com wrote:

I still this issue with RCB that the import doesn't work, but I had that with .xbmc in ~/ as well.

This how far I get: http://imgur.com/y4FHvs0


Reply to this email directly or view it on GitHub: https://github.com/ProfessorKaos64/RetroRig/issues/45#issuecomment-48215563

Sent from my Android device with K-9 Mail. Please excuse my brevity.

beaumanvienna commented 10 years ago

Home.xml: http://slexy.org/view/s206IElmfP

Here's how xbmc.log looks like after running on ~/.retrorig/.xbmc: http://slexy.org/view/s2wSOBWNxX

There are lots of ".xbmc" occurrences in this file. You could copy it to an editor, replace all occurrences of "/home/yo/.retrorig/.xbmc" with something else (that are the ones that do work correctly after the remapping) and search for the remaining ".xbmc" matches. Looks good to me.

Line 323 shows that RCB has started correctly. In line 434 RCB starts to output its own debugging messages. All pretty normal.

Just like I posted this morning on https://github.com/ProfessorKaos64/RetroRig/issues/31#issuecomment-48142157.

Ahh, by the way, the find in files command I usually use is

find folder -type f -exec grep -H "serach text" {} \; or find folder -name "*.cpp" -type f -exec grep -H "serach text" {} \; if I want just to search in cpp files.

beaumanvienna commented 10 years ago

Ok, this is a bit off-topic. This is how xbmc.log looks like when I try to import Sonic: http://slexy.org/view/s2113034Ne

If you search for sonic in this file, you'll find two matches in line 1026 and 1034. A bit further down some warnings show up (1049, 1052,...) Does that say anything to you?

mdeguzis commented 10 years ago

Did you look at the file formats I have set on the wiki? :) You are importing a .bin file, which I don't have set (yet), I'll fix that when I get home. For now, you can open the context menu and add *.bin, seperated by a comma to the import options of that ROM collection.

beaumanvienna commented 10 years ago

This file always used to work with RCB and RetroRig, strange...

mdeguzis commented 10 years ago

I may have messed it up, I'll take a look at it when I get home soon

On Mon, Jul 7, 2014 at 3:20 PM, Jens-Christian notifications@github.com wrote:

This file always used to work with RCB and RetroRig, strange...

— Reply to this email directly or view it on GitHub https://github.com/ProfessorKaos64/RetroRig/issues/45#issuecomment-48227907 .

Michael DeGuzis Email: mdeguzis@gmail.com Website: http://www.libregeek.org Linked In Resume/Profile http://www.linkedin.com/profile/view?id=124915388&trk=nav_responsive_tab_profile

mdeguzis commented 10 years ago

Ok, this is a bit off-topic. This is how xbmc.log looks like when I try to import Sonic: http://slexy.org/view/s2113034Ne

@beaumanvienna , JC I just tested Sonic from the Dropbox link. Works fine for me (since I added .bin support in RCB). The file you have is the Genesis game anyway, not the Sega Master System version. I typically confirm this via the terminal window, or just by attempting a gamepad configuration with ALT+SHIFT+1. You'll notice if you do that (you'll have to configure the gamepad again, so you don't have to), it brings up "6 button gamepad, which is for the Genesis".

mdeguzis commented 10 years ago

Found info on how to fix the broken xbmc icon: http://www.compholio.com/elfres/

That pkg does not work for me right now, but what we need is an ELF editor to replace the icon in xbmc.bin.

see: https://wiki.ubuntu.com/ELFIconSpec

Convenience is fine, but is this really the right approach? Aren't we supposed to use launcher .desktop files to set icons and environments for executables? Note that this topic also applies to executable scripts like .py and .jar, and also to .exe files run in Wine.

I think it's also possible we can hunt down the icon once the deb pkg is extracted.

beaumanvienna commented 10 years ago

Doesn't work for me either. It's not up-to-date. I tried compiling from source, that didn't work either. It was missing libr-dev.

mdeguzis commented 10 years ago

I sent a msg to the dev. But who knows. At least I know what to look for now. I'm back to sleep haha. See ya later.

beaumanvienna commented 10 years ago

There must be an easier way. After the build environment for xbmc is installed, we do have tools like "strip" that work on ELF files. I could imagine that there's such a tool included.

mdeguzis commented 10 years ago

How has starting via the play icon been for you lately?