scottrice / Ice

Application to automatically add ROMs to Steam
http://scottrice.github.io/Ice/
MIT License
835 stars 96 forks source link

Make exported roms "streaming ready" #288

Open fran122157 opened 9 years ago

fran122157 commented 9 years ago

I can't figure out how to use ICE and steam in home streaming together. Apparently if the directory or the name of the rom contains any space (Pokemon Emerald Version.gba) the rom itself wont work thorugh steam streaming service.

currently there is an alternative to ice called tritium that manages to solve this by modifying the name of the rom, eg: Pokemon_Tritium_Emerald_Tritium_Version. Sadly tritium cant download grid images currently and it seems that the developers have abandoned the project.

It would be a very nice feature to add to ice (obviously this should be done after a UI is added)

Please excuse my lame english!

scottrice commented 9 years ago

Yeah, I would love to improve the streaming experience. I dont have a great setup to test that with though. What exactly isn't working for you? I was able to stream a game from my desktop in the other room without much issue, and the game had a space in the name (Donkey Kong 64). I wasnt able to //control// the game, but I have a feeling its because I have the emulator on the host PC set to use a controller.

Is the game failing to load for you, or something else? Is it all games that are having problems, or just a couple?

fran122157 commented 9 years ago

Actually I think I explained wrong the situation as I'm not using Steam in home streaming.

I'm currently trying to stream from my pc to my phone using limelight (an app that imitates nvidia's game stream function that is only available on nvidia shield devices)

I dont know the source of the problem but if i try to stream any emulated game from any emulator (im using, Nestopia, DeSmuMe, Dolphin, ePSXe, Fusion, PCSX2, PPSSPP, Project64, VBA, ZSNES) only the roms that have no spaces in their name (eg: Patapon.iso) are succefully emulated, I'm saying emulated because if it has any space on the name the emulator wont even start

scottrice commented 9 years ago

Is that something that Ice should handle though? Ice's job is to get ROMs in Steam - it doesn't modify the users filesystem at all (at least, not any of the ROM files). I think it should stay that way tbh, I don't want to move user's files around automatically.

The fact that Limelight doesn't handle paths with spaces in the name definitely sounds like a bug, just not an Ice bug. It seems that that project is open source as well, have you tried posting an issue on one of their trackers as well? https://github.com/moonlight-stream

tjhrulz commented 9 years ago

I can provide input here I hacked a version of ice a while back to support Nvidia's gamestream. For whatever reason the way the roms are launched when steaming the " gets escaped and thus won't run if the path contains spaces. Tried a million ways to prevent it from escaping it and couldn't find any easy ones so my workaround was to symlink the rom directory to the root directory write a script that replaces all spaces in my rom directory with underscores and make ice ignore underscores when naming the rom and looking up icons. Also I should not its only spaces in the rom path that have issues not the emulator path.

Worked fine until I think a recent steam update or something to do with windows 10 borked ice from working on my system.

fran122157 commented 9 years ago

That's wonderful, it's the kind of thing that tritium does, replaces the spaces with tritium can you upload this version to see if it is functional for me?

Thank you so much!

tjhrulz commented 9 years ago

Sure I will see if I can do that later today. Also note my version I just synced with the current version and I also made one other change where I implemented the TODO stub so that that way it will load all the config files from the setup.py directory (One above the working directory) instead of from the folder it makes in your appdata (I like mine to be 100% portable)

tjhrulz commented 9 years ago

Here is a link to my modified version: https://drive.google.com/folderview?id=0B9REw3RFcAtgTGxhY1U2M1RNVWM&usp=sharing. I included my config files for reference and you may want to symlink your rom directory to somewhere where the path will not contain spaces (I keep mine in my Google Drive folder and thus the normal path always contains spaces so it is symlinked to the root of my C: drive)

As for a breakdown of what all is changed in case scott wants to implement any as all my changes help any users that like to use underscores instead of spaces and will have no impact on users that use spaces:

Line 46 in rom.py is changed to appname = str(self.prefixedname()).replace("", " ") so that the name displayed in steam is devoid of any underscores

After line 42 in localprovider.py filename = rom.name.replace('', ' ') + extension path = os.path.join(img_dir, filename) if os.path.isfile(path): return path So that the search for local images is run both with and without underscores incase people went back and forth about using underscores. This change could be made to the console grid provider but is unnecessary since their search algorithm already accounts for this.

Lastly I implemented a TODO I found so that the data directory is the same place as the setup.py (One above the working directory) so that that way your config files do not have to be in that location in your app data. Line 36 in configuration.py is changed to path = os.getcwd() path, src = path.rsplit('\', 1) path = str(path) return path

Any questions feel free to ask.

As a bonus I built to script that will change all spaces for underscores for you recursively down in whatever directory you give this as a command line argument for this .bat file which can be found here: https://drive.google.com/file/d/0B9REw3RFcAtgUk1OeDVRRHZlRlE/view?usp=sharing

And if the word recursive did not scare you (If it did then dont worry about this section) as a warning careful how you run it. I keep mine in my rom directory and as a precaution it will not just run you will have to run it from command line and give it the argument of the path that you want it to run in (ROM directory). I would never run it in admin mode and of course it can not be undone (Well it could undo most of it but would then get rid of any underscores if you ran it again in reverse). Do not hold me accountable if you screw something up with that because you stumbled upon this in a google search and do not know what you are doing

fran122157 commented 9 years ago

That was fast!

Nevertheless I can't download anything from that drive, maybe it's still uploading or I don't have the permissions to do it. Anyhow, Thank you so much, I will try to download it later

tjhrulz commented 9 years ago

Oops my bad I forgot to turn back on drive sync after I got back from vacation should be uploaded now.

fran122157 commented 9 years ago

Thanks again! one question only. Do i have to run the script to modify the names of the rom or your version of ice does this job too?

fran122157 commented 9 years ago

Well I might be in a bigger problem as I thought that running the source code would it be much easier than this. -.-

It's normal that i'm missing an exectuble from the modified version of ice you uploaded right?

tjhrulz commented 9 years ago

You will need to run the script to rename it first. I agreed with scott when I changed it that that was outside of ice's scope to edit peoples files for them. Then it should be as simple as running the ice.py file.

What is happening when you try to run it?

fran122157 commented 9 years ago

Thats the problem. I'm not finding ice.py

tjhrulz commented 9 years ago

Alright my Google Drive seems to be having issues with it here is a zip file of all the files in my dropbox. Sorry about that. https://dl.dropboxusercontent.com/u/17532185/Ice-master-new.zip

fran122157 commented 9 years ago

hahahaha, no luck so far. Can't find ice.py in that zip either :P

fran122157 commented 9 years ago

Bump. Any news about that modified version? I can´t find ice.py in your google drive nor in your dropbox upload

OneCricketeer commented 8 years ago

I have stumbled across this problem, and while removing spaces may fix it, I am curious why the program executable doesn't error when there are spaces in it's path?

kiakanpa commented 8 years ago

looking at the thread at https://forums.geforce.com/default/topic/651587/shield-portable/bug-nvidiasteamlauncher-does-not-pass-quotes-in-arguments-or-working-path/ the problem is steam not passing the quotes for all the arguments, apparently it can be fixed by wrapping the arguments in triple quotes...

OneCricketeer commented 8 years ago

@kiakanpa Nice find!

For PCSX2, this option worked in emulators.txt for a file with spaces.

[PCSX2]
location=C:\Program Files (x86)\PCSX2 1.4.0\pcsx2.exe
command=%l --nogui ""%r""

I assume this will be the workaround until #402 is accepted.

kiakanpa commented 8 years ago

unfortunately that wont work, because of the way the command string is normalised. you can either wait to see if the fix is accepted or checkout from the repo at https://github.com/kiakanpa/Ice (or just edit your emulators.py file manually)

OneCricketeer commented 8 years ago

@kiakanpa

I tried it, it did work. The raw path argument for %r added a pair of quotes on its own, so I added two more around it.

kiakanpa commented 8 years ago

@cricket007 ok, fair enough - looking at the code i'd have thought it stripped them, but i must have misread it...