linphonec hangs/freezes on Remote ringing - linux

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

Related

VLC Pulse Audio Errors in Debian Subsystem on win 10

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

how to debug kernel loading and intrd load in virtualbox

I have cloned the linux kernel repo on my arch hosted machine (host is ubuntu 16.04). Two weeks ago I was able to boot into the new kernel (it was 4.11.rc06 back then), then I did git pull and recompiled everything and it just hangs after "loading initial ramdisk image...".
So I tried git clean -xfd then make localmoduleconfig answering defaults for everything, then make then make modules_install then mkinitcpio -p linux.4.11.custom and of course sudo cp -v arch/x86_64/boot/bzImage /boot/vmlinuz-linux.4.11.custom.
After I verified it does indeed hang I tried more git pulls, more cleans, but nothing changed.
Running the same kernel from the same source on a real machine boots.
I could not find recorded bug in virtualbox or find an update for ubuntu.
Next I tried debugging it myself by adding to the grub's linux command: debug earlyprintk=vga,keep and even removing the initrd line adding noinitrd to the kernel, but I get no error. Just a screen with the grub's "echo" messages that stays like that forever.
How can I debug it?
Has anyone got any idea what can be done?
To check whether the kernel even starts I would use KDB (kernel's built-in debugger), and see if you get a prompt at startup.
For better debugging I would try to get KGDB (GDB for kernel) working.
You can actually activate both to have all options available. See following link for more information about this:
https://www.kernel.org/doc/htmldocs/kgdb/index.html

XRUSB raspberry pi

I'm working with a raspberry pi connected with xrusb to a controller using python.I use make file to Compile and install the common usb serial driver module and it works fine. After reboot i have problem. The driver is lost. I have to install the module again using this
modprobe usbserial
insmod ./xr_usb_serial_common.ko
Any idea?
Now my answer might be off because of the way you say "install the driver". I bet the make script most likely just loaded the driver just like you did via modprobe.
In order to get the module to be loaded at boot time, you need to tell udev what to load/do during bootup. And tell the kernel to load your driver.. Otherwise it assumes you don't want it to be loaded at boot time.
Either you can do a automatic module handling via:
#nano /etc/modules-load.d/usbserial.conf
usbserial
or, you can specify options:
#nano /etc/modprobe.d/usbserial.conf
options usbserial parameter_name=parameter_value
Here's some documentation on how this works:
http://man7.org/linux/man-pages/man5/modules-load.d.5.html
https://wiki.archlinux.org/index.php/kernel_modules
(Even if you're not running Arch on your RPi, they still have one of the best documentation websites for Linux out there. User friendly, in depth etc. So apply the information there to your Distribution, they should be very much the same this day and age)
I found maybe a temporary solution so i can finish my project and look for the best way later.
I make a script to run after reboot to load the driver.
use:
sudo crontab -e
then go to the bottom and write
#reboot bash /your/path/script/script.sh
`

How to disable the autoloading of a specific module in Linux

I compiled my Linux kernel according to the Linux Device Driver Chapter 4: Debugging Techniques. After I loaded my first hello world module and then checked the output by dmesg, however, all I can see is evbug: ........
I know I can turn off evbug's output by execute sudo rmmod evbug. But, obviously, it is inconvenient to execute this command after each reboot.
How could I disable this module's autoloading? I just want to load it manually when I need it.
You need to blacklist the module. For debian systems see https://wiki.debian.org/KernelModuleBlacklisting. For redhat systems see https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/rescuemode_drivers-blacklisting.html

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!

Resources