Error with no sound card in Ren'Py 4.2

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
mikey
Lemma-Class Veteran
Posts: 3249
Joined: Sat Jan 10, 2004 6:03 am
itch: atpprojects
Contact:

#1 Post by mikey »

Oh well, there I am, finally having time to study the possibilities of RenPy (I am welcoming myself to the club :) and since I had the old version and tested things there, I wanted the current 4.2 The problem was quite similar to gunmpad's. Upon doubleclicking run_game.exe, I got the message:

File "run_game.py", line 28, in ?
File "renpy\main.pyc", line 141, in main
File "renpy\main.pyc", line 98, in run
File "renpy\display\core.pyc", line 503, in __init__
File "renpy\display\core.pyc", line 352, in __init__
File "renpy\sound.pyc", line 9, in init
error: DirectSoundCreate: Unknown DirectSound error: 0x80004005
The last script statement executed was on line 55 of game/script.rpy.


I checked it roughly and it seems to correspond with the line
$ renpy.music_start('sun-flower-slow-drag.mid')

I am using a PC w/o a sound card (don't ask) and running Win98SE Central European version. Is the sound card a requirement for RenPy? The game does not even start, just pops that text file, and it was unpacked and run, so I edited nothing since the download.

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#2 Post by PyTom »

It's actually a different problem, as you've managed to expose a bug in Ren'Py proper, rather than a bug in the script itself. It looks like I forgot to handle the case of a missing sound card in a few places in sound.py. I had assumed that pygame would handle it transparently... but it doesn't look like that is the case.

I'll probably try to cut a 4.2.1 release soon, which has this and a few other bugfixes, but not much in the way of new features.

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#3 Post by PyTom »

First of all, I split this off into its own topic, as a Ren'Py bug is a bit different than an invalid script.

Second, I realized that I'm not quite ready to release a new version of Ren'Py. So instead, I present the following monkeypatch to the internals of Ren'Py that should fix the problem you encountered, at the possible cost of a tiny bit of sound playback efficency.

Code: Select all

init -1000:
    python hide:
        import renpy.sound as sound

        def newinit():
            print "Monkeypatched!"

        sound.init = newinit
Just include this in a script, and it should fix the problem until I get a permanent fix into the Ren'Py 4.3 codebase. Please let me know if this works for you, and if there's anything else you need Ren'Py to do.

Update: Just to clarify, "monkeypatch" is a well known technical term. Well, at least to python folk. :D

User avatar
mikey
Lemma-Class Veteran
Posts: 3249
Joined: Sat Jan 10, 2004 6:03 am
itch: atpprojects
Contact:

#4 Post by mikey »

thanks, the missing s/c is on my test computer, so actually renpy works fine on my normal one. I put the line in the script (I tried various places, heh) and it always works, just the screen gets upside down at times, then it returns back to normal :? But don't sweat it, it's not like I critically need it or something. It's good that it works and I'll wait for 4.3, no problem.

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#5 Post by PyTom »

mikey wrote:thanks, the missing s/c is on my test computer, so actually renpy works fine on my normal one. I put the line in the script (I tried various places, heh) and it always works, just the screen gets upside down at times, then it returns back to normal :? But don't sweat it, it's not like I critically need it or something. It's good that it works and I'll wait for 4.3, no problem.

The screen gets upside down? Could you elaborate on this? I know of no circumstance, save perhaps for massive hardware failure, where this should happen. So if you could tell me when it happens, I would appreciate it.

User avatar
mikey
Lemma-Class Veteran
Posts: 3249
Joined: Sat Jan 10, 2004 6:03 am
itch: atpprojects
Contact:

#6 Post by mikey »

Well, sorry if I mixed up the terms, the contents of the PROGRAM WINDOW are upside down (the bitmaps inside), not the screen as such.

It happens ONLY during transitions ONLY when you choose the "why are we in WDC" option and its subsequent options. For a sec the program flashes an upside down eileen with everything else upside down.Then the game continues on normally. Also, the choice eileen-lucy is always upside down.

ALWAYS at every stage in every path when you click the "x" on the minimalize-maximalize-close bar, it will return you to an upside down menu and you have to click approximately where the "return to game" button was to get back. When you minimize this upside down menu, and restore it again, the menu will be fine, until you hover your mouse over the program window. Then the bitmap will jump upside down again.

Whew, I hope this helped. I will try to figure out the upside down menu thingy on my normal computer, i'll let you know.

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#7 Post by PyTom »

Is it only on the one computer that you're experiencing these problems? Since there's nothing in Ren'Py that could lead to flipping of images, it sounds like it may be some sort of driver problem, or perhaps a bug in SDL or Pygame. If this is the case, I may try cutting a release with the beta of Pygame.

It definitely isn't intentional, and you're the first person to report it.

Or perhaps it's some sort of curse. Spooky.

User avatar
mikey
Lemma-Class Veteran
Posts: 3249
Joined: Sat Jan 10, 2004 6:03 am
itch: atpprojects
Contact:

#8 Post by mikey »

Only on one computer. Works okay on my normal one. Don't waste your time over it :wink:

User avatar
mikey
Lemma-Class Veteran
Posts: 3249
Joined: Sat Jan 10, 2004 6:03 am
itch: atpprojects
Contact:

#9 Post by mikey »

Okie, since I wanted to test the 4.6 on this fantastic machine with no sound card, I d/loaded the 4.6 and inserted the monkeypatch line - just as I did with 4.2. The 4.2 runs fine, but the 4.6 returns this error despite the inserted line in script.rpy:

I'm sorry, but an exception occured while executing your Ren'Py
script.

error: mixer system not initialized

The last script statement executed was on line 232 of common/library.rpy.

-- Full Traceback ------------------------------------------------------------

File "run_game.py", line 60, in main
File "renpy\main.pyc", line 157, in main
File "renpy\main.pyc", line 121, in run
File "renpy\execution.pyc", line 68, in run
File "renpy\ast.pyc", line 223, in execute
File "renpy\python.pyc", line 642, in py_exec_bytecode
File "<none>", line 12, in <module>
File "renpy\ui.pyc", line 45, in interact
File "renpy\display\core.pyc", line 657, in interact
File "renpy\display\core.pyc", line 871, in interact_core
File "renpy\display\audio.pyc", line 197, in restore_music
File "renpy\display\audio.pyc", line 122, in set_music_volume
error: mixer system not initialized

The last script statement executed was on line 232 of common/library.rpy.

Ren'Py Version: Ren'Py 4.6.1


Just in case you have some spare time, a monkeypatch line would be just fine.

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#10 Post by PyTom »

I've automated the Ren'Py release process to the point where it's actually easier to do a proper release than a monkeypatch, at least for non-trivial changes like what was needed to fix this. (Well, it's about a 10 line change... but in two reasonably large functions.)

Anyway, you can grab the new release from:

http://www.bishoujo.us/renpy/dl/4.6.2/renpy-4.6.2.zip

Let me know if that works for you.

I'll write up a formal release announcement when I'm feeling a bit better, and can test it a bit longer. (Those are always the hardest parts of a release.) I'm suffering from some combination of a cold, a lack of sleep, and the low likelihood that a girl will give me chocolate on valentines day. :(

User avatar
mikey
Lemma-Class Veteran
Posts: 3249
Joined: Sat Jan 10, 2004 6:03 am
itch: atpprojects
Contact:

#11 Post by mikey »

Unfortunately, it's an illegal operation error, it says memory page fault. It won't even start. :(

I've tested it on the other computers and it works just fine though. Seems it's only this machine once again. When I have time, I'm going to install one old sound card anyway, so in case you want to resolve this, you can keep working, but it's not really necessary if that were too much effort. But if you want to keep working, I'll leave the sound card be as long as you want, just tell me what info you need or give the code another go... whichever is better.

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#12 Post by PyTom »

Was there any sort of traceback with the illegal operation error, or was it just a massive crash and a window popping up?

Update: I actually just tried it on my vmware virtual computer with the soundcard disconnected, and it seemed to work for me. What I might do is try to program the sound code even more defensively, and if that doesn't work, I'll just give up on that computer and note somewhere that Ren'Py requires a sound card to work.

But leave the computer as is, so you can test the next release.

User avatar
mikey
Lemma-Class Veteran
Posts: 3249
Joined: Sat Jan 10, 2004 6:03 am
itch: atpprojects
Contact:

#13 Post by mikey »

Sorry, it was the massive crash thing. The error message is in Slovak, but it's the same as the English (it's Win98SE)

RUN_GAME spôsobil chybu stránkovania pamäte
v module <neznámy> na 0000:b011b81f.
Registre:
EAX=83d96f10 CS=017f EIP=b011b81f EFLGS=00010206
EBX=1000c200 SS=0187 ESP=0063e190 EBP=00000000
ECX=83d16f58 DS=0187 ESI=d0e6b000 FS=5307
EDX=d03a8000 ES=0187 EDI=d0e6af40 GS=0000
Bajty na CS:EIP:
89 79 18 8b 0a 8b 79 16 03 7a 10 8b 51 0e 89 78
Výpis zásobníka:
fff7ffff 00000000 83d96e38 00000000 83d96e38 00001000 00000004 00000004 00000001 00000300 00000400 00000008 00000000 00300000 00000000 b011c1c9

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot]