VLC Pulse Audio Errors in Debian Subsystem on win 10 - linux

I am writing a small program in my Debian Environment on Windows 10. I intend to use this code later on my Raspberry Pi 4.
The code runs videos through VLC at certain times of day.
The core of the VLC code (Python3) is below. Full Python code at the bottom.
VLC code:
import vlc;
Instance = vlc.Instance('--fullscreen');
player = Instance.media_player_new();
Media = Instance.media_new("../videos/starscape.mp4");
Media.get_mrl();
player.set_media(Media);
player.play();
However, this is throwing all sorts of errors.
VLC media player 3.0.7 Vetinari (revision 3.0.7-0-g86cee31099)
shared memfd open() failed: Function not implemented
[00007fffdc1e0410] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
shared memfd open() failed: Function not implemented
[00007fffdc225830] dbus interface error: Failed to connect to the D-Bus session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
[00007fffdc225830] main interface error: no suitable interface module
[00007fffdc1291a0] main libvlc error: interface "dbus,none" initialization failed
[00007fffdc204440] main interface error: no suitable interface module
[00007fffdc1291a0] main libvlc error: interface "globalhotkeys,none" initialization failed
[00007fffdc1291a0] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
error: XDG_RUNTIME_DIR not set in the environment.
[00007fffdc204440] skins2 interface error: cannot initialize OSFactory
Here is what I have tried to fix it:
apt-get update and apt-get upgrade
uninstall and reinstall vlc
uninstall and reinstall python-vlc
uninstall and reinstall pulseaudio
google these errors and try random solutions
I have never worked with VLC from the CLI before, so I do not know if this is an error with my code, with my install, or with the Debian instance.
Can anyone point me the right way?
FULL CODE (still WIP, but the general idea is there)
Gist: https://gist.github.com/Code2Empower/7deb6e05ffd10b0ea83eaff41c8cf294

OK, so I am an idiot. Installing Debian on Windows 10, creates a completely headless install.
So, of course VLC is giving errors.
I also stopped using vlc-python to make the call to vlc and used the subprocess module (much cleaner).
I tested the code in a Windows environment, and it works. I will test it on the Pi, when it gets here, but it should behave the same.
Here is the new vlc code, in case anyone else needs it.
import subprocess;
media = "../videos/starscape.mp4";
subprocess.Popen(["vlc.exe", media, "-f", "-L" ]);
Gist: https://gist.github.com/Code2Empower/7deb6e05ffd10b0ea83eaff41c8cf294

Related

Could not open camera using gphoto2 in python

I try to control a Sony Alpha using Python/gphoto2 on a Raspberry PI. I've tried a number of python bindings (python-gphoto2, gphoto2-cffi, ...) but they all fail at the instruction to create a camera object (eg. my_cam = gphoto.Camera()) with the error:
"Could not claim interface 0 (Device or resource busy). Make sure no other program (gvfs-gphoto2-volume-monitor) or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write access to the device."
We tried to kill background programs, make sure the kernel modules are not running, install the latest versions of the libraries and python packages, ... but could not get rid of the error. Furthermore C code using libgphoto2 works fine so it's not likely that the resource is really busy. We suspect the problem is missing USB libs in the python packages, and have tried to install libusb-dev, ... but it doesn't help.
Any suggestions what else we should try? Thanks.
You mentioned trying python-gphoto2. I'm the author of that package. Assuming you have installed it successfully then I'd try the list-cameras.py example program. It should list any cameras recognised by libgphoto2 that are connected and switched on.
If C programs are working but Python ones aren't you could check that they're using the same versions of libgphoto2. Try ldd on the C program's executable and on one of the python-gphoto2 compiled modules, e.g. /usr/local/lib/python3.5/dist-packages/gphoto2/_camera.cpython-35m-arm-linux-gnueabihf.so.

linphonec hangs/freezes on Remote ringing

i have issue with linphonec on amazon ec2 instance with ubuntu.
(on my local ubuntu everything works as expected.)
linphonec hangs when i try to make a call. but chat works w/o problems.
when i start it i get error that pc doesn't have sound card.
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
it's ok because it's server linux and i don't plan to use it.
i'm going to record call to file.
so after start i use commands
soundcard use files
play welcome.wav
record record.wav
when i type call sip:alice#ip:5080 i see incomming call on another pc but linphonec is freezed on the first machine.
when i drop call on the second pc linphonec is still freezed and i need to use kill to terminate process
amazon ec2 instance use ubuntu with the following kernel - linux-image-virtual kernel​
this kernel doesn't have snd-dummy kernel module
but this module presents in linux-image-extra-virtual package.
so we need to install it before execute modprobe snd-dummy
After that linphone works w/o problem

Qt-based Face Recognition Application

Im trying to compile a Qt project based on the example given here.
I managed to compile without errors, but during execution there are errors. I'm getting these errors in pop up windows:
-open /dev/dsp error
-init failed
-start capture failed
-get frame failed
Moreover, the output displays:
sh: line 0: .:setqt4env:file not found
Trying open file
Could not open File! Error code: 5
/home/QFaceRec/QTFaceRecForPC exited with code 0
SIGSEGV Error when debugging with Qt Creator.
I have googled, answers are due to the application tries to access memory illegally.
Therefore, I try to execute in su - / root, but the run time error remain unsolved.
Im trying to compile and run the code in fedora with qt creator without the GPIO and serial port setting.
Anyone got any ideas to my problem? or knows how to compile the qt code in the link above
Answers are due to the application tries to access memory illegally. Therefore, I try to execute in su - / root
Do not do that! The illegal memory access is not a matter of permissions, it's a matter of the software having bugs. By running it as root, there's a possibility that those bugs will wreck your system.

Headless X11 Angstrom

I have a BeagleBone - no LCD/display. In the console when I try and use startx, it says /dev/fb0 doesn't exist. The xorg.conf file is using the fbdev driver. Apparently, if an LCD is detected, everything works.
How can I setup a virtual display so I can vnc to it?
Thought I better answer this for reference. Oh, I also got the 'Tumbleweed' badge... Great...
If no LCD/DVI cape is attached, then the boot doesn't load a frame buffer (/dev/fb0). As such, no X11 server starts up. x11vnc requires a real X11 server to be running for it to work. There is also the program xvnc which can create a virtual X11/frame buffer on your behalf, but I couldn't see it in the Angstrom packages.
So, I installed Xvfb - and created a virtual frame buffer. Install the package
xserver-xorg-xvfb
When starting, keep in mind (for the newbies like me coming from Windows), it is case-sensitive. To create a virtual X11 server;
Xvfb :1 -screen 0 1024x768x16 &
When you do this, you will probably get these errors;
(EE) AIGLX error: dlopen of /usr/X11/lib/dri/swrast_dri.so failed (dlopen(/usr/X11/lib/dri/swrast_dri.so, 5): image not found)
(EE) GLX: could not load software renderer
So, load the package;
mesa-dri-driver-swrast
OK, error gone. Now we can export our display (an environment variable so Firefox, or whatever X11 client you run, can attach to the display).
export DISPLAY=:1
Load up Firefox (something to see)
firefox &
And now we try and start the x11vnc;
x11vnc -display :1 -bg -nopw -xkb
At this point, with this distro, you'll see an error about XTEST not being found/not available when it was built. Here describes the issue.
I made sure that I had all the proper libraries installed, so I figured it must have been a bad build on Angstrom. So, now to build it myself. I ensured all required libraries were available; these are the ones ending with '-dev'; by default they all appeared to be available. I followed the instructions here.
Except the copy line didn't work too good for me, so do what you need to do to copy it to the /usr/bin folder.
Now it starts, and there are no errors about XTEST, and the input works!

how to use XBMC with frame buffer?

We have cross-compiled XBMC for a Set-top-Box, board with Intel graphics card.
When I run XBMC , we are getting the following errors:
10:20:09 T:3053991728 M:527937536 ERROR: CXRandR::Query - unable to open xrandr xml
10:20:09 T:3053991728 M:527945728 NOTICE: Setup SDL
10:20:09 T:3053991728 M:529735680 FATAL: XBAppEx: Unable to initialize SDL: DirectFBCreate: Initialization error!
I do have all the related libraries and have linked the same thru LD_LIBRARY_PATH , Does any one know how to configure XBMC to use the FrameBuffers.
Any quick help in this regard is of great help.
Thanks in advance,

Resources