what is dbus daemon and why vlc needs it - linux

I have cross-compiled VLC (version 2.1.2) media player using buildroot for an arm board. I have connected the board to my linux PC using serial cable. When I try to run the player using "vlc" command in minicom, which is located in /usr/bin of my root filesystem. I get the following error:
inhibit interface error: Failed to connect to the D-Bus session daemon: /usr/bin/dbus-launch terminated abnormally with the following error: Autolaunch error: X11 initialization failed.
Can anyone please clarify what this error means and also can any one please tell me what is a dbus and why it is required for my VLC player.
Thanks for any help.

I am working on a minimal rootfs based on buildroot. This error is solved for me after I have included the package "twm" in my rootfs. Then after the board is up I run following commands on the terminal:
export DISPLAY=:0
startx &
then run vlc
vlc
This way I got rid of this error.

Since you say that you have cross compiled vlc and facing dbus launch issues, I expect you are working on a minimal root fs.
Try doing this in your terminal before you run vlc:
$ export DISPLAY=:0
If you have compiled dbus with x11 support, then dbus-launch will succeed.

Related

avrdude: ser_open(): can't open device /dev/ttyACM0: Permission denied

I use vscode with Arduino extension on Ubuntu 22.04.1 LTS which had worked well until now.
If I'm trying to upload I'm getting the error:
avrdude: ser_open(): can't open device "/dev/ttyACM0: Permission denied"
When trying to upload a sketch to an Arduino Micro.
Then I tried it with the Arduino IDE 1.8.19 which produces the same error.
I have added my user to the dialout group even though it had worked before without that (and I restarted after that).
If I change chmod of /dev/ttyACM0 that does not help at all.
If I do:
~ $ ls -al /dev/ttyACM0
crw-rw----+ 1 root dialout 166, 0 Sep 14 00:15 /dev/ttyACM0
~ $ id
uid=1000(magraina) gid=1000(magraina) groups=1000(magraina),4(adm),20(dialout),24(cdrom),27(sudo),30(dip),46(plugdev),122(lpadmin),134(lxd),135(sambashare)
I was able to run avrdude manually with sudo
So I have now setup a rule under:
/etc/udev/rules.d named 50-myusb.rules
With:
SUBSYSTEM=="usb", MODE="0666", GROUP="dialout"
Now I'm able to run avrdude in the terminal to upload my sketch manually without sudo, but I'm still unable to run it through vscode or the Arduino IDE.
What else can I do?
It's more like a workaround but it's a solution that works for me.
Now the Arduino IDE in Version 2.0 has been released.
I downloaded it and run it.
With that version I'm now able to to upload a sketch as usual.
But sadly I could not find a solution for vscode as the Arduino extension only supports the old version for now.
Even though vscode runs avrdude from the same path as the new version of the Arduino IDE does.
It seems to me like, as if vscode has different user rights and I don't know how to change that.
sudo chmod a+rw /dev/ttyUSB0 or /dev/ttyACM0 which port used see Tools

Error while trying to run HRTF example from PyAL (File descriptor in bad state) on Raspberry Pi

I am trying to experiment with HRTF audio spatialization using PyAL library on the Raspberry Pi
https://github.com/NicklasTegner/PyAL/tree/master/examples/HRTF
PyAL depends on OpenAL. I have installed necessary dependencies using sudo apt-get install to ensure the library works: libopenal-dev libopenal1 libopenal-data libmysofa-dev libmysofa0 libmysofa-utils qt5-default alsa-utils alsa-oss alsaplayer-jack g++ gstreamer1.0-python3-plugin-loader gstreamer1.0-alsa
Additionally, I installed pyglet using: sudo pip3 install pyglet
All examples (3D audio, playback, efx, audiplayer, player) work except the HRTF example. When I try to run the HRTF example, I get the following error:
AL lib: (EE) ALCplaybackAlsa_reset: snd_pcm_hw_params(self->pcmHandle, hp) failed: File descriptor in bad state
I know for a fact that this is being caused by PulseAudio not being present in the system (https://unix.stackexchange.com/questions/467193/error-while-running-the-gstreamer-example-on-development-kit-file-descriptor). So I installed pulseaudio and its corresponding tools (e.g. pavucontrol using sudo apt-get install pulseaudio.
After installing pulseaudio and rebooting, when I run that example, the example executes without error. However, I do not hear any audio output in the headphones. In fact, audio output from the entire system stops. I made sure the audio output is headphones from sudo raspi-config and alsamixer does show pulseaudio as a audio driver (when it is installed).
I am getting conflicting information from the Internet. The above link suggests using pulseaudio to mitigate the error (which is correct), whereas this link: https://www.youtube.com/watch?v=stvc7ehCWUU and https://raspberrypi.stackexchange.com/questions/1621/no-sound-output-in-vlc say to remove pulseaudio (which is also correct in the sense it brings my audio back but I can't run the HRTF example).
Any suggestions?
This is very odd, but I solved the problem by connecting a cheap external USB audio card (https://www.amazon.com/gp/product/B00IRVQ0F8/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1). Apparently, ALSA keeps control of 3.5mm jack and doesn't surrender control to Pulseaudio of that jack. Simplest solution is to use an external audio card.

Pulseaudio no audio via bluetooth a2dp connection buildroot

Edit:
I discovered, that if I run parec | paplay --raw it does play back properly.
How is this possible? There should be just a simple module-loopback error or something like that.
I´m using the CHIP SBC from getchip.com to build an embedded bluetooth audio receiver.
getchip.com offers a debian linux and a customizable buildroot distribution.
I got everything working on the debian distribution with one exception. The volume control with iOS devices don´t work because of the lack of uinput inside the debian kernel.
That´s why i tried to get it to work with the buildroot distribution. It took me a while to get bluetoothd running with simple-agent, as well as pulseaudio built with bluetooth support and the dbus configuration.
I finally got everything ready.
But:
I can connect to the sbc, but there is no sound playing on the headphone jack.
My debugging steps so far:
I´m able to play a local .wav file via paplay
just fine.
I allowed every communication via dbus
the pulseaudio logs show, that sound is coming from the bluetooth source.
the module-switch-on-connect does spawn a loopback from the bluetooth source to the same audio sink as paplay uses.
Debug Logs:
Boot log
Pulseaudio verbose startup
/usr/bin/pulseaudio -vvvv --system --daemonize --disallow-exit
Bluetoothd verbose connection
/usr/libexec/bluetooth/bluetoothd -C -d &
and the bt-agent:
/usr/bin/bt-agent -d -c NoInputNoOutput -p /home/cubbo/.config/bluetooth-default-pin
Pulseaudio verbose connection
Configuration:
Pulseaudio system.pa
Pulseaudio daemon.conf
dbus system.conf
dbus-1/system.d/bluetooth.conf
dbus-1/system.d/pulseaudio-bluetooth.conf
bluetooth/audio.conf
bluetooth/main.conf
I´m pretty sure that I just miss some little configuration and it´ll play just fine. But after nearly one week of debugging I wanted to ask you for help.
I hope I´ve done everything right with attaching the logs via pastebin.
I would appreciate your help!
Thanks!
Greetings, Phil.
I had a similar problem on Antergos, A2DP was not available in pulseaudio.
A2DP was available only when restarting bluethooth service by "systemctl restart bluethooth"
It resulted to be a problem caused by GDM that opened another instance of pulseaudio and captured the bluethooth device. I prevented pulseaudio capturing bluethooth device by masking it for GDM user.
https://wiki.archlinux.org/index.php/Bluetooth_headset#Connecting_works.2C_but_I_cannot_play_sound
$ mkdir -p ~/.config/systemd/user
$ ln -s /dev/null ~/.config/systemd/user/pulseaudio.socket
[restart required]

Can't launch Visual Studio Code on Ubuntu

I'm running a VM in Azure with Ubuntu 14.04. I've installed XFCE and use X2GO to remote desktop to the machine.
I've downloaded the VS Code and unzipped the files. When I run Code from a terminal I get the following error:
WouterDeKort#UbuntuDev:~/tools/web/visual-studio-code$ ./Code
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell
WouterDeKort#UbuntuDev:~/tools/web/visual-studio-code$ [ , [Error: channel closed] ]
Any idea what I'm doing wrong?
DISCLAIMER ;-) I'm a total Linux newby. I've just installed Linux for the first time today and I have no idea what I'm doing ;-)
The work-a-round is in issue 3451. After running this, I was able to launch it from Debian Jessie with LXDE over X2Go.
sudo sed -i 's/BIG-REQUESTS/_IG-REQUESTS/' /usr/lib/x86_64-linux-gnu/libxcb.so.1
I have the same problem using X2GO and LXDE. Works okay (but slowly) using MobaXterm so apparently this is a problem specific to X2GO.
For anyone who still wonder what is the best choice if you want to start Visual Studio Code on a headless Ubuntu - the winning combination is:
Ubuntu Server + xfce + nomachine remote desktop
VS Code starts immediately without any hacks, you can set your resolution however you like, and nomachine is blazingly fast.

OpenCV keeps "uninstalling" itself (Linux)

Really annoying issue here. On Linux Mint OS. Every so often, I'll get this error when running OpenCV code:
HIGHGUI ERROR: V4L/V4L2: VIDIOC_S_CROP
OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvNamedWindow, file /home/ravi/Desktop/opencv/OpenCV-2.1.0/src/highgui/window.cpp, line 180
terminate called after throwing an instance of 'cv::Exception'
what(): /home/ravi/Desktop/opencv/OpenCV-2.1.0/src/highgui/window.cpp:180: error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvNamedWindow
The way to fix this, I've found, it to do the following:
cd OpenCV/
cd build/
cmake ..
make
sudo make install
sudo ldconfig
<restart computer>
Then I'll come back, start running my OpenCV code again, and it'll be fine. But then a few hours later, or possibly between turning cpu on/off, I'll be back to the same stupid error!
Does anyone have any idea what's going on here and how I can prevent this? It's frustrating as hell.
It sounds like a general critical error in the program code. Is there a specific task that is done when the error occurs? You might want to use strace to get the output of the program as it runs or enable application memory dumps for the user you are running the process as. This would be passed to the developer for debugging and inspection.
I believe the problem was solved by paying attention to where my USB camera was actually located in /dev/. Giving a faulty path to the get video source functions causes this type of error; restarting my computer occasionally shifted which /dev/video# my device was attached to.
Please do ls /dev/vid* to find out if you're using the right video source!

Resources