Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Hardware & Software > Software players

Reply
 
Thread Tools Search this Thread Display Modes
Old 7th April 2015, 12:18   #28681  |  Link
huhn
Registered User
 
Join Date: Oct 2012
Posts: 6,059
no clue you leaving out a ton of information people can only guess.
huhn is offline   Reply With Quote
Old 7th April 2015, 16:27   #28682  |  Link
Olivier C.
Registered User
 
Join Date: Jan 2014
Location: France
Posts: 76
Hi,

I am developing a .NET application and i am trying to detect a new display.

When a new display is detected, i have to :
- detect all supported display modes
- populate madVR's settings, especially the line parameter "display modes"
- enable options "switch ..." and "restore..." in order to use the auto-switch feature

Question :
How can i use the madVR's API in .NET (C#) in order to ask to set these options ?

I have found a bad alternative (registry edit), but i prefer a cleaner and safer way to achieve this.

Thanks a lot in advance
Olivier
Olivier C. is offline   Reply With Quote
Old 7th April 2015, 17:19   #28683  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,137
Quote:
Originally Posted by Tom Keller View Post
Here are the two logs - the first one created with v0.87.14 and the other one with v0.87.17
Ok, I see the issue. Both the old and new madVR builds fail to detect the refresh rate properly. Even v0.87.14 complains in the log that there's something fishy going on. However, v0.87.14 at least uses a "best guess" to do the rendering while v0.87.17 doesn't make use of the best guess. I *think* that I fixed this problem in this test build, but I'm not 100% sure because I can't reproduce the problem on my PC:

http://madshi.net/madVR8717b.zip

Does it work for you?

Quote:
Originally Posted by dbezerra View Post
Unfortunately I found an issue that seems odd to me:

Issue: Some MKV videos have very dark pictures (wrong, missing colors) when I play them in Kodi using MadVR in either full screen exclusive or full screen overlay. As soon as I press CTRL+Enter to get out of Full screen mode, the picture corrects itself. but if I press CTRL+Enter again, the same problem comes back.

I tested DSPlayer with EVR, MPC-HC with same MadVR / LavFilters and MediaBrowser Theater with LAV & MadVR but I couldn't repro this bug in any of the other environments. So I assume it's something to do with DSPlayer and MadVR integration.
Quote:
Originally Posted by dbezerra View Post
I managed to pin point the issue. I can only see this problem in the following scenario:
1. Only when using DSPlayer (Kodi) with MadVR as a renderer in either Full screen exclusive or Full screen overlay
2. Have luma doubling set (# of neurons doesn't seem to matter)
3. Have the downscaling done by any of the custom pixel shader options (I use Catmull-Rom)

As soon as I change the downscaling to DXVA2 the problem goes away. It repros with version 0.87.17.

Question - do you know what could be causing this behavior only on DSPlayer? Do I lose quality by using DXVA2 instead of Catmull-Rom (looks like DXVA2 equals Bilinear for my NVIDIA card)
Strange. Can you still reproduce the problem with the new test build (see above)? Have you tried resetting the kodi specific madVR settings and to reset madVR to default settings? Which settings do you need to change to make the problem appear then? A debug log might eventually help, although I'm not sure...

Quote:
Originally Posted by Nachbar View Post
I'd like to report a bug.

I'm not sure which program is at fault here but if you are playing a video with mpc-hc and then close it when you have amd gaming evolved (raptr) running then mpc-hc will get stuck running in the background and it will eat up one of your cpu cores until you close it via task manager.
Does it still occur with v0.87.17? If so, I'm not sure what it could be. You could try pressing Ctrl+Alt+Shift+Break. Then wait a few seconds. Do you then get a freeze report text file on your desktop? If so, post it somewhere for me to look it (not here in the forum) and post a link here.

Quote:
Originally Posted by sexus View Post
madshi got a big request for madvr , its been bugging me ever since the support for OSD elements by madvr and am suprised this issue hasnt been tackled earlier , so ive noticed madvr has always had issues with rendering OSD elements smoothly aka theres a noticeable delay between OSD elements this has been both noticed on potplayer and kodis latest dsplayer madvr build this can be easily reproduced by simply up and downing the volume in potplayer or kodi or backing into the kodi home navigation screen while a video is being rendered , mind you ive tried already by putting prerendered frames to 1 and deselecting wait for renderqueue is full for window and exclusive as well did i try it with cranked down upscaling ,yet as said all to no avail , id appreciate a fix alot
You should be able to reduce the lag a bit by reducing the size of the GPU queue, the number of "presented frames in advance", and/or maybe even by disabling the "present several frames in advance" options completely for both windowed and exclusive mode. In the end this is a lag that is "by design", though. Changing the options mentioned above should reduce the lag, but it will not totally get rid of it. The reason for that is that madVR tries to render many frames in advance, to make sure playback stays smooth even if the PC gets super busy for short periods of time during playback.

Maybe I can find a way to reduce the lag in a future madVR build, but for now I have different priorities.

Quote:
Originally Posted by Mangix View Post
Will Nvidia's new drivers speed up NNEDI3 in any way? New drivers support OpenCL 1.2 apparently. I see a lot of "#if __OPENCL_VERSION__ >= 110" in the code .
I doubt it, sadly.

Quote:
Originally Posted by nevcairiel View Post
FWIW, I don't understand why Kodi doesn't just render the video with madVR and any elements needed during playback, but keeps the main GUI on a separate 3D renderer, with no delay at all. But oh well, their design choice I guess.
The main reason for that is that doing what you suggest wouldn't work in fullscreen exclusive mode. The only way to render a GUI in FSE mode is to go through the madVR OSD interfaces - and that is what kodi does. And I'm glad that it does, otherwise we would have no kodi GUI in FSE mode.

Yeah, kodi could probably offer two different ways to render the GUI, one for FSE mode and one for windowed mode. But to be honest, I'm not sure if it's worth the effort. Yes, currently there's a lag, and it's not nice, but as long as you don't use the mouse, I don't consider it a show stopper (even if it might be somewhat annoying).

Quote:
Originally Posted by Kirk Lazarus View Post
I use my HTPC with a 4K TV but If I set MadVR to "enable automatic fullscreen exclusive mode" I see black screen immediatly after the muose arrow vanish.

If I disable it I've no problem.

I've an AMD card and I exit at 2160@23p RGB 4:4:4

If I set my HTPC to output in 1920x1080 I can use "enable automatic fullscreen exclusive mode" without any problem.
Is the display even able to sync to the display mode? Do you know that? My projector complains if it can't sync. Does yours? So this could be one potential cause. Another thing is, maybe madVR just fails rendering for some reason. I might be able to see something if you upload a (zipped) debug log somewhere (not here) and link to it here.

Quote:
Originally Posted by macycat View Post
I noticed something odd. When I drag a window with a playing (or paused) video from one monitor to a second monitor, madVR crashes. Sometimes I get the following error:

madVR Error:
- creating Direct3D device failed (80070005)

When I select "enable windowed overlay" in general settings, I can move the window with the playing video from one monitor to the other with no crash.

I am using MPC-HC with Windows 7 64 bit and a GTX 670 video card.
Does that still occur with v0.87.17? When that crash occurs, do you get a crash report box? Have you sent a crash report to me yet?

Quote:
Originally Posted by baii View Post
Wddm 2.0 AMD driver (windows 10) is pretty broke with madvr now. Not that you can't make to work by changing queue/frame in advance/exclusive mode(completely broke on my machine), just not worth the fiddling. Avoid, avoid, avoid.
Ouch.

Quote:
Originally Posted by XMonarchY View Post
Why does Exclusive Fullscreen usage results in dropped frames in almost every film I watch? If I turn it off, then there is no frame drop...
As huhn already said, you've not provided enough information for us to help. Try making a photo of the debug OSD (Ctrl+J) with your digicam, when those frame drops occur, and upload it somewhere (not here) for us to look at.

Quote:
Originally Posted by Olivier C. View Post
I am developing a .NET application and i am trying to detect a new display.

When a new display is detected, i have to :
- detect all supported display modes
- populate madVR's settings, especially the line parameter "display modes"
- enable options "switch ..." and "restore..." in order to use the auto-switch feature

Question :
How can i use the madVR's API in .NET (C#) in order to ask to set these options ?

I have found a bad alternative (registry edit), but i prefer a cleaner and safer way to achieve this.
One potential problem with this approach is that if you modify the settings from within your media player, you might overwrite settings the user has already painfully setup himself. Anyway, that's your decision, of course.

I've zero experience with C#, so I don't know if I can answer your questions. Basically you should create a madVR instance, just like a media player would, then use QueryInterface to turn the madVR instance into an IMadVRSettings interface, then you can use the methods of that interface. Hope that helps?
madshi is offline   Reply With Quote
Old 7th April 2015, 17:21   #28684  |  Link
noee
Registered User
 
Join Date: Jan 2007
Posts: 530
Pretty straight forward, you can just use COM-interop to instantiate a madVR and call the madVR apis. You can just use the WinAPI to get DisplayModes, etc:

"declare" madVR ...
Code:
using System;
using System.Runtime.InteropServices;
using System.Text;
using DirectShowLib;

namespace Filters.madVR
{
	#region madVR Calibration
//	public static class Calibration {
//		// Calibration apis
//		[DllImport("madhcnet32.dll", EntryPoint = "madVR_ConnectDialog")]
//		public static extern bool ConnectDialog(bool lan, IntPtr hwnd);
//		
//		[DllImport("madhcnet32.dll", EntryPoint = "madVR_BlindConnect")]
//		public static extern bool BlindConnect(bool lan, long timeout);
//		
//		[DllImport("madhcnet32.dll", EntryPoint = "madVR_ConnectToIp")]
//		public static extern bool ConnectToIp([MarshalAs(UnmanagedType.LPWStr)] string ip, long timeout);
//		
//		[DllImport("madhcnet32.dll", EntryPoint = "madVR_Disable3dlut")]
//		public static extern bool Disable3dlut();
//		
//		[DllImport("madhcnet32.dll", EntryPoint = "madVR_SetDeviceGammaRamp")]
//		public static extern bool SetDeviceGammaRamp(IntPtr ramp);
//		
//		[DllImport("madhcnet32.dll", EntryPoint = "madVR_SetOsdText")]
//		public static extern bool SetOsdText([MarshalAs(UnmanagedType.LPWStr)] string msg);
//		
//		[DllImport("madhcnet32.dll", EntryPoint = "madVR_Disconnect")]
//		public static extern bool Disconnect();
//		
//		[DllImport("madhcnet32.dll", EntryPoint = "madVR_ShowProgressBar")]
//		public static extern bool ShowProgressBar(int numMeasurements);
//		
//		[DllImport("madhcnet32.dll", EntryPoint = "madVR_ShowRGB")]
//		public static extern bool ShowRGB(double R, double G, double B);
//		
//		[DllImport("madhcnet32.dll", EntryPoint = "madVR_SetBackground")]
//		public static extern bool SetBackground(int areapct, int backgroundcolor);
//
//	}
	#endregion
	
    #region madVR COM Interfaces

    // madVR Filter COM InterOp)
    [ComImport, Guid("E1A8B82A-32CE-4B0D-BE0D-AA68C772E423")]
    public class madVideoRenderer {}
    
    [ComImport, System.Security.SuppressUnmanagedCodeSecurity,
    InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
    Guid("88A69329-3CD3-47D6-ADEF-89FA23AFC7F3")]
    interface IMadVRExclusiveModeControl
    {
        void DisableExclusiveMode(bool disable);
    }

    [ComImport, System.Security.SuppressUnmanagedCodeSecurity,
    InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
    Guid("ABA34FDA-DD22-4E00-9AB4-4ABF927D0B0C")]
    interface IMadVRTextOsd
    {
        void DisplayMessage([MarshalAs(UnmanagedType.LPWStr)] string msg, long duration);
        void ClearMessage();
    }

    [ComImport, System.Security.SuppressUnmanagedCodeSecurity,
    InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
    Guid("D2D3A520-7CFA-46EB-BA3B-6194A028781C")]
    interface IMadVRSeekBarControl
    {
        void DisableSeekBar(bool disable);
    }
.
.
.
.
.
    [ComImport, System.Security.SuppressUnmanagedCodeSecurity,
    InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
    Guid("6F8A566C-4E19-439E-8F07-20E46ED06DEE")]
    interface IMadVRSettings
    {
        //Revision
        [PreserveSig]
        bool SettingsGetRevision(
            [Out] out Int64 revision
        );

        //Settings file
        [PreserveSig]
        bool SettingsExport(
            [Out, MarshalAs(UnmanagedType.AsAny)] out string buf,
            [Out] out int size
        );
        [PreserveSig]
        bool SettingsImport(
            [In, MarshalAs(UnmanagedType.AsAny)] string buf,
            [In] int size
        );

        //Sets
        [PreserveSig]
        bool SettingsSetString(
            [MarshalAs(UnmanagedType.LPWStr)] string path, 
            [MarshalAs(UnmanagedType.LPWStr)] string value
        );
        [PreserveSig]
        bool SettingsSetInteger(
            [MarshalAs(UnmanagedType.LPWStr)] string path, 
            int value
        );
        [PreserveSig]
        bool SettingsSetBoolean(
            [MarshalAs(UnmanagedType.LPWStr)] string path,
            [MarshalAs(UnmanagedType.Bool)] bool value
        );

        //Gets
        [PreserveSig]
        bool SettingsGetString(
            [In, MarshalAs(UnmanagedType.LPWStr)] string path,
            [Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder value, 
            [Out] out int size
        );
        [PreserveSig]
        bool SettingsGetInteger(
            [In, MarshalAs(UnmanagedType.LPWStr)] string path,
            [Out] out int value
        );
        [PreserveSig]
        bool SettingsGetBoolean(
            [In, MarshalAs(UnmanagedType.LPWStr)] string path,
            [Out] out bool value
        );
        [PreserveSig]
        bool SettingsGetBinary(
        	[In, MarshalAs(UnmanagedType.LPWStr)] string path,
            IntPtr ptr,
            [Out] out int size
        );

    }
    
    [ComImport, System.Security.SuppressUnmanagedCodeSecurity,
    InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
    Guid("8FAB7F31-06EF-444C-A798-10314E185532")]
    interface IMadVRInfo
    {
        //Gets
        [PreserveSig]
        void GetBool(
            IntPtr fld,
            [Out, MarshalAs(UnmanagedType.Bool)] out bool value
        );
        [PreserveSig]
        void GetInt(
            IntPtr fld,
            [Out] out int value
        );
        // TODO: SIZE Struct
        [PreserveSig]
        void GetSize(
            IntPtr fld,
            IntPtr size
        );
        // TODO: RECT Struct
        [PreserveSig]
        void GetRect(
            IntPtr fld,
            IntPtr rect
        );
        [PreserveSig]
        void GetULong(
            IntPtr fld,
            [Out] out ulong value
        );
        [PreserveSig]
        void GetDouble(
            IntPtr fld,
            [Out] out double value
        );
        [PreserveSig]
        void GetString(
            IntPtr fld,  
            IntPtr str,
            [Out] out int size
        );

        [PreserveSig]
        void GetBinary(
            IntPtr fld,
            IntPtr str,
            [Out] out int size
        );

    }
declare Win32API stuff...
Code:
using System;
using System.Runtime.InteropServices;

namespace Noee.Win32Utils
{
	public static class NativeMethods
	{
    	#region Structs
        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
        public struct DEVMODE
        {
            // You can define the following constant
            // but OUTSIDE the structure because you know
            // that size and layout of the structure is very important
            // CCHDEVICENAME = 32 = 0x50
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
            public string dmDeviceName;
            // In addition you can define the last character array
            // as following:
            //[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
            //public Char[] dmDeviceName;

            // After the 32-bytes array
            [MarshalAs(UnmanagedType.U2)]
            public UInt16 dmSpecVersion;

            [MarshalAs(UnmanagedType.U2)]
            public UInt16 dmDriverVersion;

            [MarshalAs(UnmanagedType.U2)]
            public UInt16 dmSize;

            [MarshalAs(UnmanagedType.U2)]
            public UInt16 dmDriverExtra;

            [MarshalAs(UnmanagedType.U4)]
            public UInt32 dmFields;

            public POINTL dmPosition;

            [MarshalAs(UnmanagedType.U4)]
            public UInt32 dmDisplayOrientation;

            [MarshalAs(UnmanagedType.U4)]
            public UInt32 dmDisplayFixedOutput;

            [MarshalAs(UnmanagedType.I2)]
            public Int16 dmColor;

            [MarshalAs(UnmanagedType.I2)]
            public Int16 dmDuplex;

            [MarshalAs(UnmanagedType.I2)]
            public Int16 dmYResolution;

            [MarshalAs(UnmanagedType.I2)]
            public Int16 dmTTOption;

            [MarshalAs(UnmanagedType.I2)]
            public Int16 dmCollate;

            // CCHDEVICENAME = 32 = 0x50
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
            public string dmFormName;
            // Also can be defined as
            //[MarshalAs(UnmanagedType.ByValArray, 
            //    SizeConst = 32, ArraySubType = UnmanagedType.U1)]
            //public Byte[] dmFormName;

            [MarshalAs(UnmanagedType.U2)]
            public UInt16 dmLogPixels;

            [MarshalAs(UnmanagedType.U4)]
            public UInt32 dmBitsPerPel;

            [MarshalAs(UnmanagedType.U4)]
            public UInt32 dmPelsWidth;

            [MarshalAs(UnmanagedType.U4)]
            public UInt32 dmPelsHeight;

            [MarshalAs(UnmanagedType.U4)]
            public UInt32 dmDisplayFlags;

            [MarshalAs(UnmanagedType.U4)]
            public UInt32 dmDisplayFrequency;

            [MarshalAs(UnmanagedType.U4)]
            public UInt32 dmICMMethod;

            [MarshalAs(UnmanagedType.U4)]
            public UInt32 dmICMIntent;

            [MarshalAs(UnmanagedType.U4)]
            public UInt32 dmMediaType;

            [MarshalAs(UnmanagedType.U4)]
            public UInt32 dmDitherType;

            [MarshalAs(UnmanagedType.U4)]
            public UInt32 dmReserved1;

            [MarshalAs(UnmanagedType.U4)]
            public UInt32 dmReserved2;

            [MarshalAs(UnmanagedType.U4)]
            public UInt32 dmPanningWidth;

            [MarshalAs(UnmanagedType.U4)]
            public UInt32 dmPanningHeight;

            /// <summary>
            /// Initializes the structure variables.
            /// </summary>
            public void Initialize()
            {
                this.dmDeviceName = new string(new char[32]);
                this.dmFormName = new string(new char[32]);
                this.dmSize = (ushort)Marshal.SizeOf(this);
            }
        }

        // 8-bytes structure
        [StructLayout(LayoutKind.Sequential)]
        public struct POINTL
        {
            public Int32 x;
            public Int32 y;
        }
    	
        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
        public struct DISPLAY_DEVICE
        {
            [MarshalAs(UnmanagedType.U4)]
            public UInt32 cb;
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
            public string dmDeviceName;
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
            public string dmDeviceString;
            [MarshalAs(UnmanagedType.U4)]
            public UInt32 StateFlags;
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
            public string dmDeviceID;
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
            public string dmDeviceKey;
            
            /// <summary>
            /// Initializes the structure variables.
            /// </summary>
            public void Initialize()
            {
                this.dmDeviceName = new string(new char[32]);
                this.dmDeviceString = new string(new char[128]);
                this.dmDeviceID = new string(new char[128]);
                this.dmDeviceKey = new string(new char[128]);
                this.cb = (UInt32)Marshal.SizeOf(this);
            }


        }
    	#endregion
		
    	#region Windows calls
        [DllImport("oleaut32.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
        public static extern int OleCreatePropertyFrame(
            IntPtr hwndOwner,
            int x,
            int y,
            [MarshalAs(UnmanagedType.LPWStr)] string lpszCaption,
            int cObjects,
            [MarshalAs(UnmanagedType.Interface, ArraySubType = UnmanagedType.IUnknown)] 
            ref object ppUnk,
            int cPages,
            IntPtr lpPageClsID,
            int lcid,
            int dwReserved,
            IntPtr lpvReserved);

        [DllImport("User32.dll", SetLastError = true, BestFitMapping = false, ThrowOnUnmappableChar = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern Boolean EnumDisplaySettingsW(
            [param: MarshalAs(UnmanagedType.LPTStr)]
            String lpszDeviceName,  // display device
            [param: MarshalAs(UnmanagedType.U4)]
            Int32 iModeNum,         // graphics mode
            [In, Out]
            ref DEVMODE lpDevMode       // graphics mode settings
            );
    	
        [DllImport("User32.dll", SetLastError = true, BestFitMapping = false, ThrowOnUnmappableChar = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern Boolean EnumDisplayDevicesW(
            [param: MarshalAs(UnmanagedType.LPTStr)]
            String lpszDeviceName,  // display device
            [param: MarshalAs(UnmanagedType.U4)]
            Int32 iDevNum,      
            [In, Out]
            ref DISPLAY_DEVICE lpDD,       // device settings
            [param: MarshalAs(UnmanagedType.U4)]
            Int32 dwFlags      
            );

        [DllImport("User32.dll", SetLastError = true, BestFitMapping = false, ThrowOnUnmappableChar = true)]
        public static extern int ChangeDisplaySettingsExW(
            [param: MarshalAs(UnmanagedType.LPTStr)]
            String lpszDeviceName,  // display device
            [In, Out]
            ref DEVMODE lpDevMode,
            IntPtr hWnd,
            [param: MarshalAs(UnmanagedType.U4)]
            int dwflags,
            [param: MarshalAs(UnmanagedType.U4)]
            int lParam
            );
        
//        [System.Runtime.InteropServices.DllImport("kernel32.dll")]
//        private static extern int GetSystemDefaultLCID();

        [DllImportAttribute("powrprof.dll", EntryPoint = "PowerSetActiveScheme")]
        public static extern uint PowerSetActiveScheme(IntPtr UserPowerKey, ref Guid ActivePolicyGuid);

        [DllImportAttribute("powrprof.dll", EntryPoint = "PowerGetActiveScheme")]
        public static extern uint PowerGetActiveScheme(IntPtr UserPowerKey, out IntPtr ActivePolicyGuid);

        [DllImportAttribute("powrprof.dll", EntryPoint = "PowerReadFriendlyName")]
        public static extern uint PowerReadFriendlyName(IntPtr RootPowerKey, ref Guid SchemeGuid, IntPtr SubGroupOfPowerSettingsGuid, IntPtr PowerSettingGuid, IntPtr Buffer, ref uint BufferSize);
        #endregion
        
        #region MyUtils
		[DllImport("utils.dll")]
		public static extern int SetDefaultAudioPlaybackDevice([MarshalAs(UnmanagedType.LPWStr)] string Parameter);
        #endregion
        
	}
	
}
Then, you can instantiante and use....
.
.
.
Code:
        /// LAV Video Instance
        /// </summary>
        public static LAVVideoSettings LAVVideo {
        	get 
        	{
        		if (m_cLAVVideoSettings == null)
        			m_cLAVVideoSettings = new LAVVideoSettings();
        		return m_cLAVVideoSettings;
        	}
        }
        /// <summary>
		/// The madVR instance
		/// </summary>
        public static madVRSettings madVR {
        	get 
        	{
        		if (mVR == null)
        			mVR = new madVRSettings();
				return mVR;
        	}
        }
.
.
.
.
__________________
Win7Ult || RX560/4G || Ryzen 5
noee is offline   Reply With Quote
Old 7th April 2015, 18:50   #28685  |  Link
Tom Keller
Registered User
 
Tom Keller's Avatar
 
Join Date: Jan 2005
Posts: 77
Quote:
Originally Posted by madshi View Post
Does it work for you?
It does indeed :



Thanks a lot!
Tom Keller is offline   Reply With Quote
Old 7th April 2015, 19:02   #28686  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,137
The OSD is only one part, though. Does it also really play fluidly again now?
madshi is offline   Reply With Quote
Old 7th April 2015, 21:05   #28687  |  Link
Tom Keller
Registered User
 
Tom Keller's Avatar
 
Join Date: Jan 2005
Posts: 77
Yes. I did use some videos with long camera pans for testing. With your test build they show no signs of stuttering and play as smooth as they did with v0.87.14 in the past.
Tom Keller is offline   Reply With Quote
Old 7th April 2015, 21:22   #28688  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,137
Great - good to hear!
madshi is offline   Reply With Quote
Old 8th April 2015, 01:32   #28689  |  Link
sexus
Registered User
 
sexus's Avatar
 
Join Date: May 2011
Posts: 187
Quote:
Originally Posted by madshi View Post


You should be able to reduce the lag a bit by reducing the size of the GPU queue, the number of "presented frames in advance", and/or maybe even by disabling the "present several frames in advance" options completely for both windowed and exclusive mode. In the end this is a lag that is "by design", though. Changing the options mentioned above should reduce the lag, but it will not totally get rid of it. The reason for that is that madVR tries to render many frames in advance, to make sure playback stays smooth even if the PC gets super busy for short periods of time during playback.

Maybe I can find a way to reduce the lag in a future madVR build, but for now I have different priorities.

disabling the "present several frames in advance" options completely for both windowed and exclusive mode has never been enabled from the getgo on my setup so thats a none issue, about the gpu queue / cpu queue and the number of presented frames in advance , what settings do you suggest? ive currenlty got gpu queue at 24 and cpu queue at 48 and prerendered frames at 8 and yes id really appreciate if you could fix this issue with a future madvr build indeed , i understand youve got more pressing issues at hand as of currently , ill gladly wait for this annoying issue to be fixed madshi thanks for your time as always
sexus is offline   Reply With Quote
Old 8th April 2015, 01:53   #28690  |  Link
ryrynz
Registered User
 
ryrynz's Avatar
 
Join Date: Mar 2009
Posts: 3,247
Quote:
Originally Posted by sexus View Post
what settings do you suggest? ive currenlty got gpu queue at 24 and cpu queue at 48 and prerendered frames at 8 and yes id really appreciate if you could fix this issue with a future madvr build indeed , i understand youve got more pressing issues at hand as of currently , ill gladly wait for this annoying issue to be fixed madshi thanks for your time as always
Just drop them by half for starters and keep lowering them to see what effect they have on the lag if any, personally I think your queues are higher than they likely need to be.
ryrynz is offline   Reply With Quote
Old 8th April 2015, 04:05   #28691  |  Link
dbezerra
Registered User
 
Join Date: May 2009
Posts: 13
From Madshi:

"Strange. Can you still reproduce the problem with the new test build (see above)? Have you tried resetting the kodi specific madVR settings and to reset madVR to default settings? Which settings do you need to change to make the problem appear then? A debug log might eventually help, although I'm not sure..."


After I reported this issue here I found out that the problem only happens when:
a. NNEDI is enabled (even if no downscale is necessary)
b. I have both Kodi and MadVR set to adjust the framerate.

By disabling the adjust framerate on Kodi this problem went away, although I also lost the ability to set the proper frame rate when not using DSPlayer/MadVR. (streaming for example).

I will check your beta build just in case. But now this is a low priority issue for me.
dbezerra is offline   Reply With Quote
Old 8th April 2015, 09:06   #28692  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,137
Quote:
Originally Posted by sexus View Post
disabling the "present several frames in advance" options completely for both windowed and exclusive mode has never been enabled from the getgo on my setup so thats a none issue, about the gpu queue / cpu queue and the number of presented frames in advance , what settings do you suggest? ive currenlty got gpu queue at 24 and cpu queue at 48 and prerendered frames at 8 and yes id really appreciate if you could fix this issue with a future madvr build indeed , i understand youve got more pressing issues at hand as of currently , ill gladly wait for this annoying issue to be fixed madshi thanks for your time as always
The default is a GPU queue size of 8, IIRC. I'm not sure if that's what I'd recommend. Depends on whether you're using smooth motion FRC, which can always use a few frames more. In any case, as ryrynz suggested, just play with the queue sizes and with the "number of backbuffers". E.g. just try a GPU queue size of 4, and also set the "number of backbuffers" to 3. Does that reduce the lag? If so, check if you still get perfectly smooth playback. If not, increase the queue sizes a bit again. But first check if reducing these options has any effect on the lag at all.

BTW, I think the CPU queue size should have no effect on the issue, so you can keep that high.

Quote:
Originally Posted by dbezerra View Post
After I reported this issue here I found out that the problem only happens when:
a. NNEDI is enabled (even if no downscale is necessary)
b. I have both Kodi and MadVR set to adjust the framerate.

By disabling the adjust framerate on Kodi this problem went away, although I also lost the ability to set the proper frame rate when not using DSPlayer/MadVR. (streaming for example).

I will check your beta build just in case. But now this is a low priority issue for me.
Interesting. I'm not sure what's happening there, to be honest. But it's not good to have 2 different pieces of software fight over which frame rate and display mode should be used. If you use DSPlayer sometimes with and sometimes without madVR then maybe you could ask for a setting in kodi which enables framerate adjustments only when *not* using madVR?
madshi is offline   Reply With Quote
Old 8th April 2015, 11:16   #28693  |  Link
sexus
Registered User
 
sexus's Avatar
 
Join Date: May 2011
Posts: 187
oh hey , sup ryrynz , anyhow ok madshi so ive set gpu queue to 4 even thou huhn recommended against it due to it most likely breaking deinterlacing and introducing dropped frames as well did i reduce prebuffered frames to 3, ok , the OSD lag is noticeably less since aka you now have effectively 4 frames of OSD lag instead of 24 according to huhn , not sure what setting prebuffered frames would do for the OSD lag thou but i set them to 3 as recommended by you anyhow , ill now check for dropped frames , not sure how to check for broken deinterlacing thou ?
sexus is offline   Reply With Quote
Old 8th April 2015, 11:20   #28694  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,137
As long as you don't get any dropped frames, you'll probably be fine. The good news is that reducing the lag through the settings works for you. Now you just need to find the lowest queue size that plays smoothly for you.
madshi is offline   Reply With Quote
Old 8th April 2015, 11:37   #28695  |  Link
sexus
Registered User
 
sexus's Avatar
 
Join Date: May 2011
Posts: 187
well anything above 4 gpu queue size is noticable in OSD lag so , not sure what exactly to tweak then , say if i now have broken deinterlacing , which i still have no idea how to even notice or have dropped frames , and raising the queue further would fix this logically , but would introduce OSD lag that is noticeable aka anything above 4 frames of lag is noticeable on the OSD, ive tried,the best way to test this is as said, is to quickly go up and down with the volume and the OSD lag becomes very apparent, you can literally see the delay, you must already know this since youve tried

Last edited by sexus; 8th April 2015 at 11:42.
sexus is offline   Reply With Quote
Old 8th April 2015, 11:51   #28696  |  Link
ryrynz
Registered User
 
ryrynz's Avatar
 
Join Date: Mar 2009
Posts: 3,247
Quote:
Originally Posted by sexus View Post
oh hey , sup ryrynz , anyhow ok madshi so ive set gpu queue to 4 even thou huhn recommended against it due to it most likely breaking deinterlacing, ill now check for dropped frames , not sure how to check for broken deinterlacing thou ?
Hey there, been awhile.. Anyway, deinterlacing isn't something that's used by many people these days as most media is generally progressive content so unless your watching TV broadcasting or DVDs it's unlikely you
will need deinterlacing.

I've only ever used it a few times since madVR came out, so if you're in the same boat it isn't a deal breaker setting the GPU queue to 4.
ryrynz is offline   Reply With Quote
Old 8th April 2015, 11:53   #28697  |  Link
huhn
Registered User
 
Join Date: Oct 2012
Posts: 6,059
Quote:
Originally Posted by sexus View Post
oh hey , sup ryrynz , anyhow ok madshi so ive set gpu queue to 4 even thou huhn recommended against it due to it most likely breaking deinterlacing and introducing dropped frames as well did i reduce prebuffered frames to 3, ok , the OSD lag is noticeably less since aka you now have effectively 4 frames of OSD lag instead of 24 according to huhn , not sure what setting prebuffered frames would do for the OSD lag thou but i set them to 3 as recommended by you anyhow , ill now check for dropped frames , not sure how to check for broken deinterlacing thou ?
just play a deinterlaced file at best a broadcast file or interlaced BD.

in my experience a GPU queue of 4 can result in issue with IVTC/decimation or deinterlacing. usually 8 doesn't create any problems at least in my experience.

you can use alt + control +shift + d to force deinterlacing on any file the GPU deinterlace has a very easy job with deinteralcing progressive frames but still better than no tests.
here an example where it doesn't work with a 4 GPU queue and 2 present 2 frames in advanced:
http://abload.de/img/worksbiuph.png

at 5 GPU queue it was stable. i added SM always on top and it was still stable.

i'm not sure about present or buffered frames in advance. but the GPU queue has clearly an effect on KODI and the OSD from madVR in other players like mpc-hc. 8 or 24 GPU queue is day night. but i don't see a reason where you clearly need more than 8 GPU queue but of course not all system are the same.
huhn is offline   Reply With Quote
Old 8th April 2015, 12:03   #28698  |  Link
ryrynz
Registered User
 
ryrynz's Avatar
 
Join Date: Mar 2009
Posts: 3,247
Quote:
Originally Posted by huhn View Post
but i don't see a reason where you clearly need more than 8 GPU queue but of course not all system are the same.
Personally I think many people don't have good reason to go beyond the defaults, if there was the defaults would be higher.
ryrynz is offline   Reply With Quote
Old 8th April 2015, 13:18   #28699  |  Link
sexus
Registered User
 
sexus's Avatar
 
Join Date: May 2011
Posts: 187
i see thanks for the elaborate explanation and showing the deinterlacing issue, it appears that i have just about 0 high demanding deinterlaced files , maybe someone could upload one for me to test this, so we can further narrow down what gpu queue and backbuffers amount is needed to get 0 delayed and 0 dropped frames

btw my flush settings are set for both window and exclusive to

flush
flush and wait(sleep)
dont flush
flush

i recon these are correct

Last edited by sexus; 8th April 2015 at 13:40.
sexus is offline   Reply With Quote
Old 8th April 2015, 13:34   #28700  |  Link
ryrynz
Registered User
 
ryrynz's Avatar
 
Join Date: Mar 2009
Posts: 3,247
Quote:
Originally Posted by sexus View Post

btw my flush settings are set for both window and exclusive to

flush
flush and wait(sleep)
dont flush
flush

i recon these are correct
Default is 'don't flush' after D3D presentation.
ryrynz is offline   Reply With Quote
Reply

Tags
direct compute, dithering, error diffusion, madvr, ngu, nnedi3, quality, renderer, scaling, uhd upscaling, upsampling

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 19:58.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.