Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Black screen with audio on Mint 20 #1

Open
mvaranda opened this issue Apr 15, 2022 · 7 comments
Open

Black screen with audio on Mint 20 #1

mvaranda opened this issue Apr 15, 2022 · 7 comments

Comments

@mvaranda
Copy link

Thanks a lot for this project. Works on Windows. Found that overlay shows up even when another windows is on foreground and cursor moves to the player control area.

On Mint, I get black screen with audio fine.

Logs:

user@user-linux:~/AvaVLCControl/AvaVLCControl/AvaVLCControl$ dotnet run 2>log.txt 
user@user-linux:~/AvaVLCControl/AvaVLCControl/AvaVLCControl$ head -n200 log.txt 
[0000556aba3bd1c0] main libvlc debug: VLC media player - 3.0.9.2 Vetinari
[0000556aba3bd1c0] main libvlc debug: Copyright © 1996-2020 the VideoLAN team
[0000556aba3bd1c0] main libvlc debug: revision 3.0.9.2-0-gd4c1aefe4d
[0000556aba3bd1c0] main libvlc debug: configured with ./configure  '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-silent-rules' '--libdir=${prefix}/lib/x86_64-linux-gnu' '--runstatedir=/run' '--disable-maintainer-mode' '--disable-dependency-tracking' '--disable-debug' '--config-cache' '--disable-update-check' '--enable-fast-install' '--docdir=/usr/share/doc/vlc' '--with-binary-version=3.0.9.2-1' '--enable-a52' '--enable-aa' '--enable-aom' '--enable-aribsub' '--enable-avahi' '--enable-bluray' '--enable-caca' '--enable-chromaprint' '--enable-chromecast' '--enable-dbus' '--enable-dca' '--enable-dvbpsi' '--enable-dvdnav' '--enable-faad' '--enable-flac' '--enable-fluidsynth' '--enable-freetype' '--enable-fribidi' '--enable-gles2' '--enable-gnutls' '--enable-harfbuzz' '--enable-jack' '--enable-kate' '--enable-libass' '--enable-libmpeg2' '--enable-libxml2' '--enable-lirc' '--enable-live555' '--enable-mad' '--enable-matroska' '--enable-mod' '--enable-mpc' '--enable-mpg123' '--enable-mtp' '--enable-ncurses' '--enable-notify' '--enable-ogg' '--enable-opus' '--enable-pulse' '--enable-qt' '--enable-realrtsp' '--enable-samplerate' '--enable-sdl-image' '--enable-sftp' '--enable-shine' '--enable-shout' '--enable-skins2' '--enable-sndio' '--enable-soxr' '--enable-spatialaudio' '--enable-speex' '--enable-srt' '--enable-svg' '--enable-svgdec' '--enable-taglib' '--enable-theora' '--enable-twolame' '--enable-upnp' '--enable-vdpau' '--enable-vnc' '--enable-vorbis' '--enable-x264' '--enable-x265' '--enable-zvbi' '--with-kde-solid=/usr/share/solid/actions/' '--disable-crystalhd' '--disable-d3d11va' '--disable-decklink' '--disable-directx' '--disable-dsm' '--disable-dxva2' '--disable-fdkaac' '--disable-fluidlite' '--disable-freerdp' '--disable-goom' '--disable-gst-decode' '--disable-libtar' '--disable-macosx' '--disable-macosx-avfoundation' '--disable-macosx-qtkit' '--disable-microdns' '--disable-mfx' '--disable-opencv' '--disable-projectm' '--disable-schroedinger' '--disable-sparkle' '--disable-telx' '--disable-vpx' '--disable-vsxu' '--disable-wasapi' '--enable-alsa' '--enable-dc1394' '--enable-dv1394' '--enable-libplacebo' '--enable-linsys' '--enable-nfs' '--enable-omxil' '--enable-udev' '--enable-v4l2' '--enable-wayland' '--enable-libva' '--enable-vcd' '--enable-smbclient' '--disable-oss' '--enable-mmx' '--enable-sse' '--disable-neon' '--disable-altivec' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/vlc-sUx6OI/vlc-3.0.9.2=. -fstack-protector-strong -Wformat -Werror=format-security ' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fdebug-prefix-map=/build/vlc-sUx6OI/vlc-3.0.9.2=. -fstack-protector-strong -Wformat -Werror=format-security ' 'OBJCFLAGS=-g -O2 -fdebug-prefix-map=/build/vlc-sUx6OI/vlc-3.0.9.2=. -fstack-protector-strong -Wformat -Werror=format-security'
[0000556aba3bd1c0] main libvlc debug: searching plug-in modules
[0000556aba3bd1c0] main libvlc debug: loading plugins cache file /usr/lib/x86_64-linux-gnu/vlc/plugins/plugins.dat
[0000556aba3bd1c0] main libvlc debug: recursively browsing `/usr/lib/x86_64-linux-gnu/vlc/plugins'
[0000556aba3bd1c0] main libvlc debug: plug-ins loaded: 521 modules
[0000556aba273830] main logger debug: looking for logger module matching "any": 4 candidates
[0000556aba273830] main logger debug: using logger module "console"
[0000556aba3bd1c0] main libvlc debug: translation test: code is "C"
[0000556abb1709f0] main keystore debug: looking for keystore module matching "memory": 4 candidates
[0000556abb1709f0] main keystore debug: using keystore module "memory"
[0000556aba3bd1c0] main libvlc debug: CPU has capabilities MMX MMXEXT SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 AVX AVX2 FPU 
[h264 @ 0x7fc34c11c1c0] Reinit context to 1280x720, pix_fmt: yuv420p
[h264 @ 0x7fc34c11c1c0] get_buffer() failed
[h264 @ 0x7fc34c11c1c0] thread_get_buffer() failed
[h264 @ 0x7fc34c11c1c0] decode_slice_header error
[h264 @ 0x7fc34c11c1c0] no frame!
[h264 @ 0x7fc34c12bfc0] get_buffer() failed
[h264 @ 0x7fc34c12bfc0] thread_get_buffer() failed
[h264 @ 0x7fc34c12bfc0] decode_slice_header error
[h264 @ 0x7fc34c12bfc0] no frame!
[h264 @ 0x7fc34c1746c0] get_buffer() failed
[h264 @ 0x7fc34c1746c0] thread_get_buffer() failed
[h264 @ 0x7fc34c1746c0] decode_slice_header error
[h264 @ 0x7fc34c1746c0] no frame!
... (loops) ...

A few things: I bumped up to use .NET6.0 as I do not have 5.0. It does not seems to be related.

just in case I forced the code to select X server:

        public static void SetHandle(this MediaPlayer player, IPlatformHandle handle)
        {
            player.XWindow = (uint)handle.Handle;
            // if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            //     player.Hwnd = handle.Handle;
            // else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
            //     player.XWindow = (uint)handle.Handle;
            // else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) player.NsObject = handle.Handle;
        }
ls ~/.nuget/packages/
avalonia                                           skiasharp.nativeassets.win32
avalonia.angle.windows.natives                     splat
avalonia.controls.datagrid                         system.buffers
avalonia.desktop                                   system.collections
avalonia.diagnostics                               system.collections.immutable
avalonia.freedesktop                               system.componentmodel.annotations
avalonia.native                                    system.diagnostics.debug
avalonia.reactiveui                                system.drawing.common
avalonia.remote.protocol                           system.dynamic.runtime
avalonia.skia                                      system.globalization
avalonia.win32                                     system.io
avalonia.x11                                       system.linq
csharpfunctionalextensions                         system.linq.expressions
dynamicdata                                        system.memory
harfbuzzsharp                                      system.numerics.vectors
harfbuzzsharp.nativeassets.linux                   system.objectmodel
harfbuzzsharp.nativeassets.macos                   system.reactive
harfbuzzsharp.nativeassets.webassembly             system.reflection
harfbuzzsharp.nativeassets.win32                   system.reflection.emit
jetbrains.annotations                              system.reflection.emit.ilgeneration
libvlcsharp                                        system.reflection.emit.lightweight
libvlcsharp.avalonia                               system.reflection.extensions
microsoft.aspnetcore.app.ref                       system.reflection.metadata
microsoft.codeanalysis.analyzers                   system.reflection.primitives
microsoft.codeanalysis.common                      system.reflection.typeextensions
microsoft.codeanalysis.csharp                      system.resources.resourcemanager
microsoft.codeanalysis.csharp.scripting            system.runtime
microsoft.codeanalysis.scripting.common            system.runtime.compilerservices.unsafe
microsoft.csharp                                   system.runtime.extensions
microsoft.netcore.app.host.linux-x64               system.runtime.handles
microsoft.netcore.app.ref                          system.runtime.interopservices
microsoft.netcore.platforms                        system.runtime.interopservices.runtimeinformation
microsoft.netcore.targets                          system.runtime.interopservices.windowsruntime
microsoft.netframework.referenceassemblies         system.runtime.serialization.primitives
microsoft.netframework.referenceassemblies.net45   system.security.principal.windows
microsoft.netframework.referenceassemblies.net471  system.text.encoding
microsoft.win32.systemevents                       system.text.encoding.codepages
msbuild.sdk.extras                                 system.threading
netstandard.library                                system.threading.tasks
reactiveui                                         system.threading.tasks.extensions
runtime.native.system                              system.valuetuple
skiasharp                                          tmds.dbus
skiasharp.nativeassets.linux                       videolan.libvlc.windows
skiasharp.nativeassets.macos                       xamlnamereferencegenerator
skiasharp.nativeassets.webassembly

About installed libvlc:

~/AvaVLCControl/AvaVLCControl/AvaVLCControl$ apt show libvlc-bin
Package: libvlc-bin
Version: 3.0.9.2-1
Priority: optional
Section: universe/video
Source: vlc
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Multimedia Maintainers <debian-multimedia@lists.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 204 kB
Depends: libc6 (>= 2.4), libvlc5 (>= 3.0.9.2)
Homepage: https://www.videolan.org/vlc/
Task: kubuntu-desktop, kubuntu-full, lubuntu-desktop, ubuntustudio-video
Download-Size: 17.1 kB
APT-Manual-Installed: no
APT-Sources: http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
Description: tools for VLC's base library
 VLC is the VideoLAN project's media player. It plays MPEG, MPEG-2, MPEG-4,
 DivX, MOV, WMV, QuickTime, WebM, FLAC, MP3, Ogg/Vorbis files, DVDs, VCDs,
 podcasts, and multimedia streams from various network sources.
 .
 This package contains the vlc-cache-gen binary.

Any suggestion?
Thanks in advance,
Marcelo

@radiolondra
Copy link
Owner

radiolondra commented Apr 15, 2022

Found that overlay shows up even when another windows is on foreground and cursor moves to the player control area.

Sorry, I forgot to update the library project in the samples to the latest version (find it HERE)

Anyway, now I lined up both sample projects to the latest lib version. It should work.

About Mint behaviour. I never tested anything under linux Mint (Kubuntu only). Once I have time, I'll prepare a VM with Mint and make my own tests there.

@radiolondra
Copy link
Owner

Tested on Linux Mint (MATE).
It works perfectly.

Did u installed all the needed libs?

  • sudo apt-get install libx11-dev
  • sudo apt-get install libvlc-dev
  • sudo apt-get install vlc
  • Give the right permits to the files inside your deployed folder (I did a simple chmod 777)
  • Start AvaVLCWindow (or AvaVLCControl) as root or with sudo

AvaVLCMint

@mvaranda
Copy link
Author

Hi Roberto, thanks a lot.
Latest main branch does not show anymore the overlay control panel (no play/stop buttons).
I have to checkout 72340f8 in order to get it back.

Suggested libs where all already installed. Note that audio was playing fine, so the libs access were good. I installed notnet 5.0.407 and still have black screen.

A GTK demo using libvlc works:
https://raw.githubusercontent.com/videolan/vlc/master/doc/libvlc/gtk_player.c
I just had to comment out the content of on_stop function.

I am wondering if OpenGL presence (or absence) has anything to do with this.

@radiolondra
Copy link
Owner

radiolondra commented Apr 16, 2022

It effectively seems in Mint there is the issue on setting ZIndex and it needs topmost.
This happens in Mint only (on Kubuntu and MacOS ZIndex works fine).
But the video is playing fine even in Mint and with the latest lib, as you can see in the picture above.
Check your environment and all the changes you eventually did to the sample code.
I suggest to try from the beginning in a clean Mint OS (I used MATE) in a virtual machine.

The ZIndex vs Topmost settings will be reviewed as soon as possible, to allow the right behaviour in Mint too.

@radiolondra
Copy link
Owner

radiolondra commented Apr 16, 2022

It seems Mint has stopped shipping with Kde, generating a lot of issues.
In my Mint MATE, I installed Kde again. And ZIndex started to work again!

To install Kde in Mint MATE:

  • sudo apt update
  • sudo apt install kubuntu-desktop kde-plasma-desktop kscreen
  • Reboot.
  • At the system login screen, there is an option to select the desktop environment, click it and set "Plasma".
  • Type your password and hit enter. And you are in Kde.

Run the sample using the latest lib. The panel at the bottom should work fine without overlapping any other window.

Note that the video was playing successfully even without Kde installed, at least in my Mint MATE VM.

@oolong2
Copy link

oolong2 commented May 23, 2022

I was also experiencing transparency and ZIndex issues trying to get this working on a Raspberry Pi. So this is an FYI and for anyone else experiencing similar problems.

To fix the transparency issues (TLDR: make sure xcompmgr is running):

  • I had to use raspi-config under Advanced Options to enable a composition manager (xcompmgr). Which also apparently requires enabled GL support. After rebooting this still didn't work for some reason. I could see xcompmgr running in the list of processes, but transparency only started working when I ran xcompmgr manually from a terminal window. So I edited the cmstart.sh script under /usr/lib/raspi-config, because for whatever reason the exec command running xcompmgr wasn't working properly, and changed the line that runs xcompmgr to something like "xcompmgr -Cc -t1 -l1 -r3 -o0.25". Which I found online somewhere to enable drop shadows in the desktop. Although just "xcompmgr" would probably be fine since that worked in the terminal.

To fix the ZIndex:

  • I couldn't actually fix the ZIndex issue so I worked around it.... I also didn't want to install kde desktop since that is overkill for me and I didn't want to mess anything else up. So I modified the VideoViewer to add an event handler to the PositionChanged event of the containing window. Which fires once after the containing window is loaded. There I just call _floatingContent.Activate() to being the controls to the front.

Probably not the most ideal, but this worked for my purposes. Also this is my first time doing anything on Linux so I'm sure I'm missing something

Also this does not work with Avalonia 0.10.14 only version 0.10.13 I tried several times to get version 0.10.14 to work with an overlay, I don't think the right handle was getting passed and VLC just kept opening up in it's own window. I was able to get version 0.10.13 to work on both Windows 10 and the Raspberry Pi.

@elveejay1
Copy link

I have the same issue, running on a Ubuntu 22.04 in a Hyper-V VM.

I have run

sudo apt-get install libx11-dev
sudo apt-get install libvlc-dev
sudo apt-get install vlc

previously to make it build, but still see a black screen and the errors mentioned initially in this thread.
I also don't see the buttons, so I changed SetPlayerHandle() to call viewModel.Play(); after the if().

I downloaded the software today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants