FRV crashes most times after starting Windows 7 from hibernation

Forums: 

I'm using FastRawViewer on Windows 7 (64 bit). I often keep it open, when I hibernate my computer. When I start it again, the first thing I see is a message box telling me that FastRawViewer has stopped working. I have enabled error logging already and this is the output so far. Please let me know if I should set the log level to "log all". Can you spot the root cause of the problem in these log messages?
WARN: [21-09 08:38:44.792] QOpenGLShader::compile(Fragment): ERROR: 0:? : 'pre-mature EOF' : syntax error syntax error
 
 
WARN: [21-09 08:38:44.792] *** Problematic Fragment shader source code ***
WARN: [21-09 08:38:44.792] #extension GL_EXT_gpu_shader4 : enable
 
#define lowp
#define mediump
#define highp
#define USE_SHADER4
 
#ifdef USE_SHADER4
#define tex2Dfetch(tex,coord) texture2DGrad(tex,coord,vec2(0.0,0.0),vec2(0.0,0.0))
#else
#ifdef USE_TEXTURE_LOD
#define tex2Dfetch(tex,coord) texture2DGradARB(tex,coord,vec2(0.0,0.0),vec2(0.0,0.0))
#else
#define tex2Dfetch(tex,coord) texture2D(tex,(coord))
#endif
#endif
 
#ifdef GL_ES
precision highp float;
#endif
 
//Pixel Shader
 
uniform vec4 WB;
/** (w,h,1/w,1/h) */
uniform vec4            sourceSize;
uniform vec2            firstRed;
#ifndef OEUE_GENERATE
uniform mat4 colormatrix;
#endif
 
/** Monochrome RGBA or GL_LUMINANCE Bayer encoded texture.*/
uniform sampler2D       texture;
uniform sampler2D       tonecurve;
varying vec4            center;
varying vec4            yCoord; // -2, -1, 1, 2
varying vec4            xCoord; // -2, -1, 1, 2
 
float fetch(float x, float y)
{
  vec2 abscoord = sourceSize.xy * vec2(x,y);
  vec2 czw = abscoord + firstRed;// - vec2(0.5,0.5);
  vec2 alt = mod(czw, 2.0);
  float wbc = (alt.y < 1.0) ?
        ((alt.x < 1.0) ?
            WB.r : WB.g ) :
        ((alt.x < 1.0) ? WB.g : WB.b);
  return tex2Dfetch(texture, vec2(x, y)).r * wbc;
}
 
float fracFunct(float x)
{
    return x - floor(x);
}
 
float gradefunc(float val)
{
    vec2 lookup = vec2(fracFunct(val/256.0)+1.0/512.0,(floor(val/256.0)+0.5)/256.0);
    return tex2Dfetch(tonecurve, lookup).r;
}
vec3 gradeRGB(vec3 P)
{
    return vec3(gradefunc(P.r),gradefunc(P.g),gradefunc(P.b));
}
 
void main(void) {
    float C = fetch(center.x,center.y);
    const vec4 kC = vec4( 4.0,  6.0,  5.0,  5.0) / 8.0;
 
    // Determine which of four types of pixels we are on.
   vec4 Dvec = vec4( // 00=> all blue, 11=>all red, 10=>all green
        fetch(xCoord[1], yCoord[1]),  // (-1,-1)
        fetch(xCoord[1], yCoord[2]),  // (-1, 1)
        fetch(xCoord[2], yCoord[1]),  // ( 1,-1)
        fetch(xCoord[2], yCoord[2])) // ( 1, 1)
    ;
   vec4 value = vec4(
        fetch(center.x, yCoord[0]),   // ( 0,-2) // 00=> Red, 11=>Blue, 10=>G 01=>G
        fetch(center.x, yCoord[1]),   // ( 0,-1) // 00 => G, 11=>Green, 10=>B 01=>R
        fetch(xCoord[0], center.y),   // (-1, 0) // 00 => G  11=>G      10=>R 01=>B 
        fetch(xCoord[1], center.y))  // (-2, 0) // 00 => Red, 11=B     10=>G 01=>G
    ;
 
   vec4 temp = vec4(
        fetch(center.x, yCoord[3]),   // ( 0, 2) // 00=>Red, 11=>b      10=>G 01=>G
        fetch(center.x, yCoord[2]),   // ( 0, 1) // 00=>Green, 11=>G    10=>B 01=>R
        fetch(xCoord[3], center.y),   // ( 2, 0) // 00=>Red   11=>b     10=>G 01=>G
        fetch(xCoord[2], center.y))  // ( 1, 0) // 00=>Green 11=>g     10=>R 01=>B
    ;
 
    vec4 PATTERN = kC * C; //  (kC.xyz * C).xyzz; // ��� 4 �������� -> �������� ���� � ������ 4, 6, 5, 5
 
    // Can also be a dot product with (1,1,1,1) on hardware where that is
    // specially optimized.
    // Equivalent to: D = Dvec[0] + Dvec[1] + Dvec[2] + Dvec[3];
    Dvec.xy += Dvec.zw;
    Dvec.x  += Dvec.y;  // Dvec.x - diagonal values
 
    // Even the simplest compilers should be able to constant-fold these to
    // avoid the division.
    // Note that on scalar processors these constants force computation of some
    // identical products twice.
    const vec4 kA = vec4(-1.0, -1.5,  0.5, -1.0) / 8.0;
    const vec4 kB = vec4( 2.0,  0.0,  0.0,  4.0) / 8.0;
    const vec4 kD = vec4( 0.0,  2.0, -1.0, -1.0) / 8.0;
 
    // Conserve constant registers and take advantage of free swizzle on load
#define kE (kA.xywz)
#define kF (kB.xywz)
 
    value += temp;
 
    // There are five filter patterns (identity, cross, checker,
    // theta, phi).  Precompute the terms from all of them and then
    // use swizzles to assign to color channels.
    //
    // Channel   Matches
    //   x       cross   (e.g., EE G)
    //   y       checker (e.g., EE B)
    //   z       theta   (e.g., EO R)
    //   w       phi     (e.g., EO R)
    //  ��� 
 
#define A (value[0])
#define B (value[1])
#define D (Dvec.x)
#define E (value[2])
#define F (value[3])
 
    // Avoid zero elements. On a scalar processor this saves two MADDs
    // and it has no effect on a vector processor.
    PATTERN.yzw += (kD.yz * D).xyy; // 
 
    PATTERN += (kA.xyz * A).xyzx + (kE.xyw * E).xyxz;
    PATTERN.xw  += kB.xw * B;
    PATTERN.xz  += kF.xz * F;
 
    vec2 alternate = mod(center.zw, 2.0); 
 
    vec4 ungraded; 
ungraded.rgb = (alternate.y < 1.0) ?
        ((alternate.x < 1.0) ?
            vec3(C, PATTERN.xy) :  // Red point
            vec3(PATTERN.z, C, PATTERN.w)) :   // green at red row?? Check it by 
        ((alternate.x < 1.0) ?
            vec3(PATTERN.w, C, PATTERN.z) :
            vec3(PATTERN.yx, C));   // Blue: red is y-pattern (checker)
#ifndef OEUE_GENERATE
    ungraded.a = 0.0;
    vec4 limited = min(ungraded,vec4(65535.0,65535.0,65535.0,65535.0));
 
    vec3 graded = gradeRGB((limited*colormatrix).rgb);
    vec3 a1 = max(graded,vec3(0.0,0.0,0.0));
    gl_FragColor.rgb = min(a1,vec3(65535.0,65535.0,65535.0));
    gl_FragColor.a = 1.0;
#else
    ungraded.a = 0.0;
    // Return back white balance (also, we need to have it limited)
    ungraded /= WB;
    vec4 limited = min(ungraded,vec4(65535.0,65535.0,65535.0,65535.0));
    vec3 graded = gradeRGB(limited.rgb);
    gl_FragColor.rgb = max(graded,vec3(0.0,0.0,0.0));
    gl_FragColor.a = gl_FragColor.g;
#endif
}
 
WARN: [21-09 08:38:44.792] ***
WARN: [21-09 08:38:44.792]  FRV_RawProcessingShader: Fragment shader compile error: "ERROR: 0:? : 'pre-mature EOF' : syntax error syntax error
 
"

Dear Sir:

FastRawViewer de-initializes all graphic resources used when going to sleep/hibernate, then re-initializes it again on awake (the same way as on program startup). For some(unknown) reason, this re-initialization fails in your case. It may be caused because graphics hardware is not properly initialized just after awake (for example, software DirectX renderer is active before full graphics card awake).

Ways to solve:

 -use setting: Preferences - GPU Processing - Exit program on OS Sleep/Suspend

  this will close FRV just before sleep/hibernate event.

 - we may try to implement some GPU initialization delay after awake. To do that, please create full debug log for FRV start - image display - hibernate - awake - failure message and send it to us (support@fastrawviewer.com).

  To enable log use:

     Preferences - Other - Debug log messages - All

     Preferences - Other - Save debug log to file: Yes, remove on quit

  And use Menu - Help - Show debug log in Explorer to get the log file

 

--

Alex Tutubalin/FastRawViewer team

Add new comment