Page 2 of 7 FirstFirst 1234 ... LastLast
Results 11 to 20 of 63

Thread: Gens/GS r7_pre2 - Preview Release

  1. #11
    Join Date
    Jan 2007
    Beans
    2,052

    Re: Gens/GS r7_pre2 - Preview Release

    lots of really great updates in this one. i'll have to try it out.
    Linux User #440528
    openSUSE 12.1 x86_64/KDE 4.8.4

  2. #12
    Join Date
    Jun 2007
    Location
    Rio de Janeiro - Brasil
    Beans
    319
    Distro
    Kubuntu Development Release

    Re: Gens/GS r7_pre2 - Preview Release

    Quote Originally Posted by GerbilSoft View Post
    Can you try to get a backtrace with gdb? (You might have to recompile with debugging symbols enabled.)

    Also, try setting the internal color depth to 16-bit. I've noticed some issues with 32-bit OpenGL surfaces on my system in fullscreen. [Graphics, Bits per pixel, 16 (565)]
    Setting it to 16-bit worked, thank you very much! Also, I've discovered that I can get full screen filtering enabled when selecting them via the keyboard (F11/F12) and after that they work properly even if I restart gens.

  3. #13
    Join Date
    Oct 2008
    Beans
    75

    Re: Gens/GS r7_pre2 - Preview Release

    Quote Originally Posted by wingnux View Post
    Setting it to 16-bit worked, thank you very much! Also, I've discovered that I can get full screen filtering enabled when selecting them via the keyboard (F11/F12) and after that they work properly even if I restart gens.
    Ok, then this is because the nVidia driver doesn't provide 32-bit GLX visuals in fullscreen. I'm using an ATI FireGL V5200 (RV530) with the Mesa drivers, and it has the same issue.

    Well, either that, or Gens/GS isn't allocating it properly. I'll figure out what's going on later. Eventually, it'll "fall back" to lower color depth so it'll "just work" without crashing. (I already implemented this for backend switching; I need to implement it for fullscreen switching and fullscreen resolutions.)

    EDIT: I figured out the problem. Gens/GS was specifying 32-bit color depth for the GLX visual instead of 24-bit. This seemed to work in windowed mode, but failed horribly in fullscreen. Note that the color depth here only applies to the actual color components, and doesn't include the alpha channels. This has been fixed in commit dc1bf7d33073bae3b6be2f98bab6928b1d5edce5, but that commit depends on an earlier commit that cleaned up a part of the SDL+OpenGL backend. Here's a combined patch.

    Code:
    diff --git a/src/gens/video/vdraw_sdl_gl.c b/src/gens/video/vdraw_sdl_gl.c
    index 76f3b1f..3bb032f 100644
    --- a/src/gens/video/vdraw_sdl_gl.c
    +++ b/src/gens/video/vdraw_sdl_gl.c
    @@ -186,6 +186,30 @@ int vdraw_sdl_gl_init(void)
     
     
     /**
    + * vdraw_sdl_gl_set_visual(): Set OpenGL visual attributes.
    + * @param depth Color depth.
    + * @param r Red bits.
    + * @param g Green bits.
    + * @param b Blue bits.
    + * @param a Alpha bits.
    + * @param format Pixel format.
    + * @param type Data type.
    + */
    +static inline void vdraw_sdl_gl_set_visual(unsigned int depth,
    +					   unsigned int r, unsigned int g, unsigned int b, unsigned int a,
    +					   GLenum format, GLenum type)
    +{
    +	SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, depth);
    +	SDL_GL_SetAttribute(SDL_GL_RED_SIZE,   r);
    +	SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, g);
    +	SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE,  b);
    +	SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, a);
    +	m_pixelFormat = format;
    +	m_pixelType = type;
    +}
    +
    +
    +/**
      * vdraw_sdl_gl_init_opengl(): Initialize the OpenGL backend.
      * @param w Width.
      * @param h Height.
    @@ -196,42 +220,27 @@ static int vdraw_sdl_gl_init_opengl(const int w, const int h, const BOOL reinitS
     {
     	if (reinitSDL)
     	{
    -		// Enable double buffering.
    +		// Set various OpenGL attributes.
     		SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
     		
     		// Color depth values.
     		if (bppOut == 15)
     		{
     			// 15-bit color. (Mode 555)
    -			SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 15);
    -			SDL_GL_SetAttribute(SDL_GL_RED_SIZE,    5);
    -			SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE,  5);
    -			SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE,   5);
    -			SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE,  0);
    -			m_pixelType = GL_UNSIGNED_SHORT_1_5_5_5_REV;
    -			m_pixelFormat = GL_BGRA;
    +			vdraw_sdl_gl_set_visual(15, 5, 5, 5, 0, GL_BGRA,
    +						GL_UNSIGNED_SHORT_1_5_5_5_REV);
     		}
     		else if (bppOut == 16)
     		{
     			// 16-bit color. (Mode 565)
    -			SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
    -			SDL_GL_SetAttribute(SDL_GL_RED_SIZE,    5);
    -			SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE,  6);
    -			SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE,   5);
    -			SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE,  0);
    -			m_pixelType = GL_UNSIGNED_SHORT_5_6_5;
    -			m_pixelFormat = GL_RGB;
    +			vdraw_sdl_gl_set_visual(16, 5, 6, 5, 0, GL_RGB,
    +						GL_UNSIGNED_SHORT_5_6_5);
     		}
     		else //if (bppOut == 32)
     		{
     			// 32-bit color.
    -			SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 32);
    -			SDL_GL_SetAttribute(SDL_GL_RED_SIZE,    8);
    -			SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE,  8);
    -			SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE,   8);
    -			SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE,  0);
    -			m_pixelType = GL_UNSIGNED_BYTE;
    -			m_pixelFormat = GL_BGRA;
    +			vdraw_sdl_gl_set_visual(24, 8, 8, 8, 0, GL_BGRA,
    +						GL_UNSIGNED_BYTE);
     		}
     		
     		vdraw_sdl_gl_screen = SDL_SetVideoMode(w, h, 0, VDRAW_SDL_GL_FLAGS | (vdraw_get_fullscreen() ? SDL_FULLSCREEN : 0));
    @@ -239,9 +248,10 @@ static int vdraw_sdl_gl_init_opengl(const int w, const int h, const BOOL reinitS
     		{
     			// Error setting the SDL video mode.
     			const char *sErr = SDL_GetError();
    -			SDL_QuitSubSystem(SDL_INIT_VIDEO);
     			LOG_MSG(video, LOG_MSG_LEVEL_ERROR,
     				"SDL_SetVideoMode() failed: %s", sErr);
    +			
    +			SDL_QuitSubSystem(SDL_INIT_VIDEO);
     			return -1;
     		}
     	}
    Last edited by GerbilSoft; July 30th, 2009 at 02:16 AM. Reason: Fixed SDL+OpenGL 32-bit in fullscreen.

  4. #14
    Join Date
    Oct 2007
    Location
    Canuck Land
    Beans
    116
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Arrow Re: Gens/GS r7_pre2 - Preview Release

    Quote Originally Posted by GerbilSoft View Post
    I fixed the problem. If you're compiling from source, you can apply this patch:
    It took me a while to figure out how to patch this (I have very limited experience with compiling code), but I eventually did manage to get both patches to work ...

    Anyway, I built it from source and installed with checkinstall, and the custom resolution bug seems to be fixed now. Also, this version of GensGS doesn't crash anymore if I use my old .gens config folder (from release 6). I'm guessing that the custom resolution listed in the gens.cfg file was making it crash on start up.

    However, I also noticed another issue... while running in a custom resolution, Genesis games only seem to run at 30fps. But this only happens if I run in either 15 or 32 bits per pixel mode with "full stretch" turned on. Turning off full stretch will make games run at 60fps again. But, using full stretch in 16bpp mode has little to no effect to the framerate at all. This problem wasn't there for me in milestone 6.

    Edit

    OK, I should also add something else, that the frame rate issue seems to happen when I have VSync and "Full Stretch" on at the same time while running in either 15bpp or 32bpp with a custom resolution.
    Last edited by mister_k81; July 30th, 2009 at 04:09 AM.

  5. #15
    Join Date
    Oct 2008
    Beans
    75

    Re: Gens/GS r7_pre2 - Preview Release

    Quote Originally Posted by mister_k81 View Post
    However, I also noticed another issue... while running in a custom resolution, Genesis games only seem to run at 30fps. But this only happens if I run in either 15 or 32 bits per pixel mode with "full stretch" turned on. Turning off full stretch will make games run at 60fps again. But, using full stretch in 16bpp mode has little to no effect to the framerate at all. This problem wasn't there for me in milestone 6.

    Edit

    OK, I should also add something else, that the frame rate issue seems to happen when I have VSync and "Full Stretch" on at the same time while running in either 15bpp or 32bpp with a custom resolution.
    15-bit color (aka "555") seems to be horribly slow on all Linux video drivers, probably because no one uses it. I'd recommend using 16-bit color (aka "565") instead.

    32-bit color also seems to be slow in some cases (especially when using a renderer that scales to larger than 2x). I'd recommend using 16-bit color in this case. Remember, the Sega Genesis could only output 9-bit color, so even with 16-bit, you aren't losing any precision. (32X could output 15-bit color, but that's automatically converted to 16-bit in the rendering code.)

    Random note: 15-bit vs. 16-bit is mostly a Windows legacy issue. Some video drivers that advertised 16-bit color didn't really support 16-bit (565), and only supported 15-bit (555). OpenGL doesn't have this issue, but I left the color depth selection in for debugging purposes.
    Last edited by GerbilSoft; July 30th, 2009 at 04:38 AM. Reason: Added a random note.

  6. #16
    Join Date
    Oct 2007
    Location
    Canuck Land
    Beans
    116
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Smile Re: Gens/GS r7_pre2 - Preview Release

    Quote Originally Posted by GerbilSoft View Post
    15-bit color (aka "555") seems to be horribly slow on all Linux video drivers, probably because no one uses it. I'd recommend using 16-bit color (aka "565") instead.

    32-bit color also seems to be slow in some cases (especially when using a renderer that scales to larger than 2x). I'd recommend using 16-bit color in this case. Remember, the Sega Genesis could only output 9-bit color, so even with 16-bit, you aren't losing any precision. (32X could output 15-bit color, but that's automatically converted to 16-bit in the rendering code.)

    Random note: 15-bit vs. 16-bit is mostly a Windows legacy issue. Some video drivers that advertised 16-bit color didn't really support 16-bit (565), and only supported 15-bit (555). OpenGL doesn't have this issue, but I left the color depth selection in for debugging purposes.
    Ah, OK. I generally just stick with the 16bpp mode anyway, because as you've said, there is no real difference between 16 and 32 visually, and 16bpp does get better performance. It's not really a problem to me though, I only brought it up because it's something that I haven't noticed before in the previous builds. It just seemed like it could've been a potential bug.

  7. #17
    Join Date
    Jul 2007
    Beans
    2

    Re: Gens/GS r7_pre2 - Preview Release

    I have a couple issues.

    The Sega CD crashing issue has not been fixed. (That same crash I reported before still crashes the system.

    The emulator is not starting in full screen mode.

    For some reason mine ws giving me the error "Cannot find /usr/lib/mvp" The 32-bit plugins were installed in /usr/lib, SHOULD it be in /usr/lib/mvp?

    Also save states from older versions are crashing the emulator.

  8. #18
    Join Date
    Oct 2008
    Beans
    75

    Re: Gens/GS r7_pre2 - Preview Release

    I discussed this with you over IRC, but I'll reply here anyway for reference purposes.

    Also save states from older versions are crashing the emulator.
    The Sega CD crashing issue has not been fixed. (That same crash I reported before still crashes the system.
    These were both buffer overflow errors that glibc only caught in the release build, which I wasn't testing. Fixed in commits dc7837b8a83d938f919de7a4f3ced5148a386603 and badf3aa21d55d06b53e1fad713a6f4d4084acd97, respectively.

    The emulator is not starting in full screen mode.
    This was the incorrect GLX visuals for 32-bit color bug, fixed in commit dc1bf7d33073bae3b6be2f98bab6928b1d5edce5.

    For some reason mine ws giving me the error "Cannot find /usr/lib/mvp" The 32-bit plugins were installed in /usr/lib, SHOULD it be in /usr/lib/mvp?
    This is an odd bug with the autotools suite. I'll look into it.
    Last edited by GerbilSoft; August 1st, 2009 at 01:03 AM.

  9. #19
    Join Date
    Mar 2007
    Beans
    280
    Distro
    Kubuntu

    Re: Gens/GS r7_pre2 - Preview Release

    I don't get any sound. But I didn't get any sound in the last stable release either.

    I'm running karmic so that could well be the entire problem but it might be some audio config I've inadvertently brought through in my profile. Any ideas? Anyone on karmic with working sound in gens?

  10. #20
    Join Date
    Oct 2008
    Beans
    75

    Re: Gens/GS r7_pre2 - Preview Release

    Quote Originally Posted by OliW View Post
    I don't get any sound. But I didn't get any sound in the last stable release either.

    I'm running karmic so that could well be the entire problem but it might be some audio config I've inadvertently brought through in my profile. Any ideas? Anyone on karmic with working sound in gens?
    If you're using PulseAudio, try turning it off. SDL (and Gens in particular) has issues with PulseAudio.

Page 2 of 7 FirstFirst 1234 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •