Play media in dot net WPF app with MediaElement

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
noenjeru
Newbie
Newbie
Posts: 4
Joined: Tue Sep 20, 2022 8:30 am

Play media in dot net WPF app with MediaElement

Post by noenjeru »

Hi,

I try to launch a wpf application under WineHQ which plays a video with the dot net MediaElement component, but it crashes (the application does not launch).

Same with SharpDX lib instead of MediaElement.

Is there a way to do it (which packages to install...) or is there a dot net media library that would work with WineHQ on linux to play media ?

Thanks.
madewokherd
Level 4
Level 4
Posts: 143
Joined: Mon Jun 02, 2008 5:03 pm

Re: Play media in dot net WPF app with MediaElement

Post by madewokherd »

Hi, can you post the console output from your program? I'm just curious what's causing it to crash.

Installing .NET Framework might help.
noenjeru
Newbie
Newbie
Posts: 4
Joined: Tue Sep 20, 2022 8:30 am

Re: Play media in dot net WPF app with MediaElement

Post by noenjeru »

Hi,

Here is the console error message :

0118:err:winediag:MIDIMAP_drvOpen No software synthesizer midi port found, Midi sound output probably won't work.
0118:err:quartz:VMR9FilterConfig_SetRenderingMode Failed to create default presenter, hr 0x80040273.

=================================================================
Native Crash Reporting
=================================================================
Got a UNKNOWN while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
madewokherd
Level 4
Level 4
Posts: 143
Joined: Mon Jun 02, 2008 5:03 pm

Re: Play media in dot net WPF app with MediaElement

Post by madewokherd »

I looked up 0x80040273 and it's VFW_E_DDRAW_CAPS_NOT_SUITABLE. I think this may be an issue with your graphics drivers.
noenjeru
Newbie
Newbie
Posts: 4
Joined: Tue Sep 20, 2022 8:30 am

Re: Play media in dot net WPF app with MediaElement

Post by noenjeru »

Thanks for these informations. I runned the application with a virtual machine.

Now i use a real computer but i have another error.

Here is my wine installation script :
sudo apt update
sudo apt upgrade

sudo dpkg --add-architecture i386

wget -nc https://dl.winehq.org/wine-builds/winehq.key
sudo mv winehq.key /usr/share/keyrings/winehq-archive.key
sudo apt install --install-recommends winehq-devel
sudo apt update
sudo apt upgrade
wine winecfg

sudo apt install winetricks
winetricks -q dotnet472

# wget https://raw.githubusercontent.com/Winet ... winetricks
# chmod +x winetricks
# sudo mv winetricks /usr/local/bin
# sudo winetricks --self-update

sudo apt install gstreamer1.0-libav:i386 gstreamer1.0-plugins-good:i386 gstreamer1.0-plugins-ugly:i386

sudo apt update
sudo apt upgrade
Here is the app (used to open a video) :

https://drive.google.com/file/d/1NiykRD ... sp=sharing

Here is the error :
0024:fixme:nls:GetFileMUIPath stub: 0x10, L"C:\\windows\\system32\\tzres.dll", (null), 0050C8E8, 0064AE58, 0050C8EC, 0050C8E0
0024:fixme:nls:GetFileMUIPath stub: 0x10, L"C:\\windows\\system32\\tzres.dll", (null), 0050C8E8, 0064AE58, 0050C8EC, 0050C8E0
0120:fixme:wmp:OleObject_QueryInterface (07664730)->({6d6cf803-1ec0-4c8d-b3ca-f18e27282074} 09A6FA4C)
0120:fixme:wmp:WMPSettings_put_enableErrorDialogs (07664730)->(0)
0120:fixme:wmp:WMPSettings_put_invokeURLs (07664730)->(0)
0024:fixme:wtsapi:WTSQuerySessionInformationW Unimplemented class 8
0024:fixme:win:RegisterPowerSettingNotification (0001006E,{02731015-4510-4526-99e6-e5a17ebd1aea},0): stub
0024:fixme:wtsapi:WTSRegisterSessionNotification Stub 00010068 0x00000000
0024:fixme:msg:ChangeWindowMessageFilterEx 00010068 c032 1 0050E95C
0024:fixme:msg:ChangeWindowMessageFilterEx 00010068 111 1 0050E95C
0118:fixme:d3d:wined3d_check_device_format_conversion output 00650188, device_type WINED3D_DEVICE_TYPE_HAL, src_format WINED3DFMT_B8G8R8X8_UNORM, dst_format WINED3DFMT_B8G8R8X8_UNORM stub!
0118:fixme:seh:WerRegisterMemoryBlock (0807D934 6144) stub
0118:fixme:seh:WerRegisterMemoryBlock (0807B340 4) stub
0024:fixme:dwrite:dwritetextanalyzer_AnalyzeNumberSubstitution (07699408 0 21 07767928): stub
0024:fixme:imm:ImeSetActiveContext (0003003E, 1): stub
0024:fixme:imm:ImmReleaseContext (00010068, 0003003E): stub
006c:fixme:imm:ImeSetActiveContext (0000000000010026, 0): stub
006c:fixme:imm:ImmReleaseContext (0000000000010020, 0000000000010026): stub
0024:fixme:urlmon:SecManagerImpl_MapUrlToZone not supported flags: 00000001

=================================================================
Native Crash Reporting
=================================================================
Got a UNKNOWN while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
wine: Unhandled page fault on read access to 00000000 at address 6DA0BFBA (thread 0120), starting debugger...
0138:fixme:imm:ImeSetActiveContext (00010090, 1): stub
0138:fixme:imm:ImmReleaseContext (0001009A, 00010090): stub
Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x6
da0bfba).
Register dump:
CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b
EIP:6da0bfba ESP:09a6f9d0 EBP:09a6fa38 EFLAGS:00010246( R- -- I Z- -P- )
EAX:00000000 EBX:07664754 ECX:09a6f7cc EDX:ffffffff
ESI:09a6fa00 EDI:00000000
Stack dump:
0x09a6f9d0: 07664690 000013ed 09a6fa10 07b16eb5
0x09a6f9e0: 0064b078 09a6fa00 09a6fa38 6da0a73e
0x09a6f9f0: 09a6fa00 07b17696 07664730 09a6fa10
0x09a6fa00: 07660013 07b16e30 00000009 09a6fa2c
0x09a6fa10: 09a6fa00 00000000 00000001 00000000
0x09a6fa20: 0064b684 0064b684 09a6fa48 0064b078
Backtrace:
=>0 0x6da0bfba IMediaControl_Run(This=<internal error>) [Z:\usr\src\packages\BUI
LD\include\control.h:283] in wmp (0x09a6fa38)
0138:fixme:dbghelp_dwarf:compute_call_frame_cfa Too complex expression for frame_CFA resolution (RULE_VAL_EXPRESSION)
0138:fixme:dbghelp_dwarf:compute_call_frame_cfa Too complex expression for frame_CFA resolution (RULE_VAL_EXPRESSION)
0138:fixme:dbghelp_dwarf:compute_call_frame_cfa Too complex expression for frame_CFA resolution (RULE_VAL_EXPRESSION)
1 0x6da0bfba WMPControls_play+0x8a(iface=<internal error>) [Z:\usr\src\package
s\BUILD\dlls\wmp\player.c:45] in wmp (0x09a6fa38)
madewokherd
Level 4
Level 4
Posts: 143
Joined: Mon Jun 02, 2008 5:03 pm

Re: Play media in dot net WPF app with MediaElement

Post by madewokherd »

This is probably a bug in wmp. If you file a report on Bugzilla, maybe someone will be able to fix it.

There are probably alternatives that work, but I don't know any specific ones.
noenjeru
Newbie
Newbie
Posts: 4
Joined: Tue Sep 20, 2022 8:30 am

Re: Play media in dot net WPF app with MediaElement

Post by noenjeru »

I managed to make my application work with the installation script below, but however a quicktime window is open to display the video, it is not integrated into my window.

Is there a way to display the video in my window?

Code: Select all

# Wine installation script on mint 21
sudo apt update
sudo apt upgrade

sudo dpkg --add-architecture i386

wget -nc https://dl.winehq.org/wine-builds/winehq.key
sudo mv winehq.key /usr/share/keyrings/winehq-archive.key

sudo apt install wine

wine winecfg

msiexec /i wine-mono-7.3.0-x86.msi

sudo apt install winetricks
winetricks -q dotnet472

sudo apt install gstreamer1.0-libav:i386 gstreamer1.0-plugins-good:i386 gstreamer1.0-plugins-ugly:i386
Locked