Errors while trying to capture HDR content with DXGI OutputDuplication - directx

I'm facing a strange error while trying to Duplicate Output on an HDR screen, particularly this is triggered when launching Doom Eternal.
I handle DXGI_ERROR_ACCESS_LOST error by resetting the OutputDuplication object, like so:
_session.Reset();
winrt::check_hresult(_item->DuplicateOutput1(_device.get(), // dxgi device
0, // reserved, must be zero
std::size(duplicationFormats), // number of supported formats
duplicationFormats, // pointer to array of supported formats
_session.GetAddressOf()));
_session is defined at class level, it's a WRL::ComPtr, duplicationFormats is an array with
DXGI_FORMAT_R16G16B16A16_FLOAT and DXGI_FORMAT_B8G8R8A8_UNORM (that, according to docs
should always be present).
With this setup, I can switch HDR modes at will on the display settings and desktop is always captured. However, when opening the game I got an E_INVALIDARG error, I activated DirectX debug Layer, and this message is printed when that happens (triggered by above check_hresult):
D3D11 ERROR: ID3D11Device::CreateTexture2D: Invalid format. The Format(0, UNKNOWN) is not supported as a D3D11_RESOURCE_MISC_SHARED_NTHANDLE format. [ STATE_CREATION ERROR #92: CREATETEXTURE2D_UNSUPPORTEDFORMAT]
D3D11 ERROR: ID3D11Device::CreateTexture2D: Returning E_INVALIDARG, meaning invalid parameters were passed. [ STATE_CREATION ERROR #104: CREATETEXTURE2D_INVALIDARG_RETURN]
I think it is rejecting the supported formats, even though I'm using a >10bpp format for HDR content, what surprises me is the mention of a (0, UNKNOWN) format, the texture is being created internally by DXGI implementation, as far as MS PDB can tell.

Related

cv::ogl::mapGLBuffer reports error CL_INVALID_CONTEXT

I would like to utilize OpenCV's integration of OpenGL/OpenCL to achieve fast distortion of images directly on the GPU while avoiding GPU/CPU image transfers. I can create a cv::ogl::Buffer from an OpenGL buffer object in Qt:
// m_pub is of type QOpenGLBuffer
cv::ogl::Buffer b(512, 512, CV_8UC4, m_pub.bufferId());
But the next line throws an exception:
cv::UMat m = cv::ogl::mapGLBuffer(b);
The error reported by OpenCV was originally:
OpenCV(4.5.5) Error: Unknown error code -220 (OpenCL:
clCreateFromGLBuffer failed) in cv::ogl::mapGLBuffer, file
D:\OpenCV\opencv-4.5.5\modules\core\src\opengl.cpp, line 1886
To get further information, I call cv::ocl::getOpenCLErrorString(status); in opengl.cpp, rebuild, and find that the error is CL_INVALID_CONTEXT.
I've checked cv::ocl::Context, cv::ocl::Device, cv::ocl::Platform, added cv::ocl::attachContext, all doesn't work. I'm stuck here, don't know how to go forward.
Any suggestions are really appreciated. Thanks.
It needs to call cv::ogl::ocl::initializeContextFromGL() in the initialization phase. My project is based on Qt, the window is inherited from QOpenGLWindow, so I call that function in initializeGL().
I guess that without this call, OpenCV would also create an OpenCL context automatically, but that's not the same as the one created from OpenGL, that's why the CL_INVALID_CONTEXT error occurred.
As a reminder, I used cv::remap to process a 512x512 image and found that processing on the GPU via OpenCL was not much faster than on the CPU. It still takes around 12ms on average. This is still too slow if the application requires a high frame rate and needs to leave time for other processing.

Driver error 11 in TransmitCANFrame XL_ERR_QUEUE_IS_FULL

I am using a CANCase VN1640A between 2 ECUs in order to falsify a CAN message. Below the bridge simulation setup:
In my CAPL Code, the received messages from channel 1 will be redirected to channel 3 and vice-versa. (So far I am not falsifying any message)
variables{
message can1. msgCAN1;
message can3. msgCAN3;
}
on message can1.{
msgCAN3=this;
if(this.dir == rx)
output(msgCAN3);
}
on message can3.{
msgCAN1 = this;
if(this.dir == rx)
output(msgCAN1);
}
But when I start CANoe I get this Error message:
This error means that CANoe tries to send more as it could. The transmit buffer is overflowed. I have changed the hardware configuration of Transmit Queue size to the max 32768 messages, also the Receive Latency to very fast but unfortunately the error occur again.
Does anyone have any hints that could help to solve this problem and thanks in advance.
The error message can mean, that CANoe tries to send more as it could. The transmit buffer is overflowed. This can have several causes:
the bus is full of high prior messages and therefore CAN hardware cannot send
You have a program which writes messages very quick to the buffer, so that the card canĀ“t send (while loops for).
Error frames occur when sending and thus the card cannot send.
Vector tool provides a loop test:
Send messages from CH1 to CH3. If this is working fine, it looks like the problem is caused by your CANoe configuration.
The necessary test programs are part of the Vector Driver Setup Files and located in the folder Common. You can download the Driver Setup File from www.vector.com/driver-setup.
CAN Highspeed Looptest: http://kb.vector.com/entry/589/
CAN Low-speed Looptest: http://kb.vector.com/entry/590/
If the loop test works fine, you can see the time, the busload etc. If not, you will get a failed message.
Note:
Reduce the number of channels used in CANoe/CANalyzer under:
Configuration | Options | Measurement | General | Channel usage.
Are there more selected channels in the CANoe configuration than assigned CANcabs in the Vector Hardware Config?
(Start | Control Panel | Hardware and Sound | Vector Hardware)
Please check the channel and application assignment in the Vector Hardware Config.
Kindly check the hardware mapping in CANoe. This error mostly arises when the mapping is not correct or disturbed.
Go to Hardware-> Network Hardware configuration -> Driver -> Select proper channel for the vector hardware
I hope this helps !
So this error does NOT mean that CANoe tries to send more as it could.
It means instead:
We have (many) error frames on the CAN bus. CANoe tries to send messages which does not work (for whatever reason) -> error frames are the result. The CAN controller will retry to send the frame which might again lead to an error frame. Now over time the Send Requests accumulate and lead to further error frames. At some point the buffer for the error frames does overflow which leads to the message you see in the write window.
Solution:
We have to check the Trace Window and check what kind of error frames we get there (and then take suitable measures to prevent them).

Scrubbing does not work on playing a network stream video vlcj

We are having the same issue that is descibed here https://trac.videolan.org/vlc/ticket/4888
When we try to scrubbing the video, it does not work, vlcj is buffering every time we scrubbing and we are getting the errors logs below
[163bdd44] core input error: ES_OUT_SET_(GROUP_)PCR is called too late (pts_delay increased to 101 ms)
[163bdd44] core input error: ES_OUT_RESET_PCR called
[2403dc04] core vout display error: Failed to set on top
[164a8284] http access error: error: HTTP/1.1 500 Object not found
[5:56]
[15c5f1d4] core input error: input control fifo overflow, trashing type=3
Does anyone know if using a convention of VLC Configuration we can fix it ?
Thanks
Francisco

ios - presentRenderbuffer triggers EXC_BAD_ACCESS

I've found that when I use textures above GL_TEXTURE18 on ios (tested on iOS 10), presentRenderbuffer triggers an EXC_BAD_ACCESS. Is there any reason for that? Can I not use textures up to GL_TEXTURE31
The GL_TEXTUREX are just some defined values, defined enumerations. In your case a GPU is the one that defines the actual number of supported textures and it is your responsibility to check what are these limitations.
You can get that by using glGet something like:
GLint max_combined_texture_image_units;
glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &max_combined_texture_image_units);
Try this thread.
Do note that these defines/enumerations are here just to help you, it does not mean they are actually valid or supported. The openGL API is mostly designed by passing integer values typedef uint32_t GLenum; so as far as the API goes you may replace GL_TEXTURE0 with 1200 or any other value but you do need to ensure that the value is actually valid.

Passing mono audio data to AVAudioEnvironmentNode

I am attempting to use an AVAudioEnvironmentNode to produce 3D spatialized sound for a game I'm working on. The AVAudioEnvironmentNode documentation states, "It is important to note that only inputs with a mono channel connection format to the environment node are spatialized. If the input is stereo, the audio is passed through without being spatialized. Currently inputs with connection formats of more than 2 channels are not supported." I have indeed found this to be the case. When I load audio buffers with two channels into an AudioPlayerNode and connect the node to an AVAudioEnvironmentNode, the output sound is not spatialize. My question is, how can I send mono data to the AVAudioEnvironmentNode?
I've tried creating a mono .wav file using Audacity as well as loading an AVAudioPCMBuffer with sine wave data programmatically. I find that either way, when I create a single channel audio buffer and attempt to load the buffer into an AudioPlayerNode, my program crashes with the following error:
2016-02-17 06:36:07.695 Test Scene[1577:751557] 06:36:07.694 ERROR:
[0x1a1691000] AVAudioPlayerNode.mm:423: ScheduleBuffer: required
condition is false: _outputFormat.channelCount ==
buffer.format.channelCount 2016-02-17 06:36:07.698 Test
Scene[1577:751557] *** Terminating app due to uncaught exception
'com.apple.coreaudio.avfaudio', reason: 'required condition is false:
_outputFormat.channelCount == buffer.format.channelCount'
Checking the AVAudioPlayerNode output bus does indeed reveal that it expects 2 channels. It's unclear to me how this can be changed, or even if it should be.
I stipulate that I have very little experience working with AVFoundation or audio data in general. Any help you can provide would be greatly appreciated.
I hope you have solved this already, but for anyone else:
When connecting your AVAudioPlayerNode to an AVAudioMixerNode or any other node that it can connect to, you need to specify the number of channels there:
audioEngine.connect(playerNode, to: audioEngine.mainMixerNode, format: AVAudioFormat.init(standardFormatWithSampleRate: 96000, channels: 1))
You can check if the sample rate is 96000 for your file in Audacity, or 'Get Info' in Finder.

Resources