System crash with QMediaPlayer and gstreamer - c++

I am currently writing an application with build-in audio player.
When I setup QMediaPlayer, I (always) get the following error:
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
There are some google results about that, but I did not find any solution to fix it.
Please note that I do not use jack.
So far I can live with that error message, but there is a much worse problem. Most of the time, the application works fine and does the expected but sporadically it freezes. The whole system freezes. I can turn the mouse around (with a poor frame rate) but I cannot click on anything or interact with any other program. Even switching to a text terminal with Ctrl+Alt+F1 does not help which make me think there should be an issue with a driver or a kernel module.
I tried mp3 and vorbis, with and without debugger, in debug and in release mode. Always the same.
There is no additional warning, error etc.
The error also occurs when starting the application from console (an executable that ran just before without any problems).
System:
Linux t420s 3.16-3-amd64 #1 SMP Debian 3.16.5-1 (2014-10-10) x86_64 GNU/Linux
Qt 5.1.1, C++11
qmake:
qmake .../CAN.pro -r -spec linux-g++-64 CONFIG+=debug
The part of code causing the issue:
QMediaPlayer* _player = 0;
_player = new QMediaPlayer(this);
...
QFile tmpFile(filename);
tmpFile.open(QIODevice::ReadWrite);
tmpFile.write(_mediaFile);
_player->setMedia(QUrl::fromLocalFile(filename)); // <-- this line causes the freezing
The last system update/upgrade was on November 9, 2014.
Btw, the whole project is publicly hosted on github. I also asked the same question here but did not receive any answer. Sorry for multipost.

One or two months ago, I had to reinstall my system for irrelevant reasons. I decided to install Ubunutu 14.04 instead of Debian.
Since then, the error did not show up again. So I guess this issue is solved. Although I'd be glad to know the reasons...

Related

MySql connector-c++ wont link in QtCreator but works fine locally on raspberry pi3

Firstly, thank you in advance for at least reading this question.
Secondly, feel free to call me an idiot if this is a "no brainer"
Now down to the issue at hand...
I am running Ubuntu 16.04 (64bit) with QT Creator as my IDE and on the whole it works great. I can cross compile for the Raspberry Pi3 (running raspbian) and also compile plugins for X-Plane.
Everything was going great until I needed to implement MySql into my project. That's when it all went south.
I can not use the Qt library for this as X-Plane does not like anything Qt related in its plugins. But that is fine, I have connector-c++ working on that machine and it connects to my MySql server and does everything it's supposed to.
I think I have read just about every forum and watched every youtube video on this but can not get Qt Creator to compile with connector for the raspberry pi.
I wrote/compiled a test app locally (with g++) on the pi and it works great. However for some reason (government plot maybe?) it refuses to link the libraries when compiling under Qt Creator.
The error I get when compiling in QtCreator is:
undefined reference to `get_driver_instance'
Currently,
I have followed the instructions for setting up a cross compiler here:
https://wiki.qt.io/RaspberryPi2EGLFS
Downloaded the connector code from here:
git clone https://github.com/mysql/mysql-connector-cpp
I have followed the instructions for compiling connector-c++ here:
https://dev.mysql.com/doc/connector-cpp/en/connector-cpp-installation-source-unix.html
And I have banged my head 1000x on a brick wall here:
(picture of blood stained wall not available)
Also, I have tried compiling connector on my Ubuntu pc with paths to the pi's sysroot etc. but i think it made a 64bit version which causes Qt Creator to have a dummy spit about "unrecognized format".
I am hoping that this is just me having a "senior moment" and that someone can point me in the right direction.
To save putting up irrelevant logs/code I will wait until someone asks for it and then copy/paste what they need.
Again, thanks in advance and know that I will be eternally grateful for any light on this matter (preferably before I go even insanerer)
Well after 2 weeks of pain, I have solved this problem. Here is what I think is the issue:
Firstly, I found that mysqlcppconn is not needed (at least for me) and used the mysql libraries in /usr/lib
Secondly, the symlinks to libmysqlclient.so.6.0.22 were by default:
libmysqlclient.so.6 -> libmysqlclient.so.6.0.22
The compiler was looking for libmysqlclient.so which didn't exist. So I created the link (libmysqlclient.so -> libmysqlclient.so.6) and it worked!!
Thanks to all who helped.

Qt 5.5.0 with mingw on Windows : Compiled executable can't be terminated

I have a really weird problem here.
I am using Qt 5.5.0 with mingw 4.9.2 32bit and QtCreator and Git on Windows 7.
My Project builds just fine but when I run the executable either outside or inside QtCreator the process appears in Task-Manager/ProcessExplorer but the Window itself does not show up and when I try to kill the process it does not react. Process Hacker can't terminate the process either. The QtCreator debugger waits in vain for the process to start. I have to reboot the PC to kill the process.
Thing is that it worked a few days ago and other qt projects work fine, too. I had the same issue on a different PC. I couldn't find the issue so I reset it to stock; I can't do the same with this one.
What could I have possibly done to cause this?
OK, I found the issue. It was my antivirus software. I am using avast free antivirus and somehow it caused the issue without telling me. Excluding the build directory from the scans solved the issue.
Thanks to Paul for the answer!

"Program File does not exist" while trying to debug with Eclipse/OpenOCD

I recently got a nrf51 bluetooth module and I am trying to debug it with Eclipse Mars. I installed the required toolchain as well as OpenOCD (I am using STLink v2 to debug the board).
While running openOCD and arm-none-eabi-gdb in console, everything works fine. The OpenOCD server starts up and I am able to connect with the gdb tool.
However, when trying to start a debug session with Eclipse, it throws the error "Exception occurred during launch. Reason: Program file does not exist". The build process finishes normally. It's the first time I used Eclipse for C/C++ development and the first time after years I used Eclipse at all so I don't even have an idea what could be wrong.
I tried messing around with the project settings without luck. Can anyone give me a hint?
I should mention, I used an already existing Makefile since I tried compiling one of the nordic SDK examples. I Changed it so the resulting files are ready for debugging.
In past I've used Segger's Jlink programmer and the JlinkExe (A pre-built binary) for Linux platform to program Nordic Bluetooth module such as NRF51 and it worked seamlessly. There are some very good documentation on using GNU toolchain with NRF51 series SOC and in case you get your hands on Segger's Jlink, I would recommend you to use that for programming. Meanwhile, this thread in the Nordic's developer zone seem to be very much similar to your problem. Maybe you'll be find some clues there.

Visual Studio 2015 error: Unable to start debugging. Unexpected GDB output from command "-target-select remote :5039". Remote connection closed

I see the following error whenever I try to debug "Cross Platform" under "C++" category: "Unable to start debugging. Unexpected GDB output from command "-target-select remote :5039". Remote connection closed"
I've installed all of the contents when I downloaded Visual Studio 2015 community and I ran it on Windows 10 Pro which supports Hyper-V.
I've been searching a solution for this and I've found an assumption:
"What is your debug target, the VS Android Emulator? When we saw this before it turned out to be a bad emulator image. Do you have this problem with all targets (e.g. if you try a physical device) or just one?"
In my case, I just tried this via Emulator(VS Emulator 5" Lolipop (5.0) XXHDP Phone (0x86 -...)
So I've sent an Email to VS 2015.
And the answer was like this:
"Sorry for the delay in responding we were looking at an emulator image of another user that ran into this problem so I was waiting until we had the results of that investigation to report back. We actually were not able to find anything wrong the emulator itself, our current hypothesis is that it is a network or adb problem interfering with GDB’s ability to connect to GDB server on the remote machine. Do you see this error every time you try to debug, or if you reboot the emulator will it work sometimes right after the reboot? Next time you see the error, can you open the emulator’s console mode by going go the Hyper-V manager and double clicking the emulator. Then find the location your app installed to and run “gdbserver --version" from the app path and let me know what it says? This will validate if the correct version of gdbserver is on the device."
So we are trying to solve this problem but I'm also asking here just in case.
Is there anyone who has magical solution for this problem?
I'll put a comment on this if I figure out how to solve this.
Thanks in advance.
** Following answer is from the manager of Visual Studio 2015:
You are only the second person who has run into this issue, and the first person that ran into it provided their everything works correctly when we run their .vhd on our machines so it appears to be some strange problem where gdbserver (which comes from the Android NDK provided by Google) crashes only when running on certain machines. Unfortunately the .vhd you provided does not appear to be the correct one it won’t boot for me. You can see the .vhd file being used by the emulator if you look under the settings of the emulator in your Hyper-V manager. .However given we got the other person’s .vhd you can hold off providing any additional information at this point. I’m waiting to hear back from the emulator team on if they have any ideas since this appears to be an issue only on specific machines since.
If you don’t mind my asking, if you don’t have a background in computers what inspired you to try C++ on Android? That scenario will be significantly more complicated than doing Java on Android.
It's been almost two months since I got this answer but I haven't got any additional response from them yet. So, I ended up quitting developing an application by using VS2015.
If you run into this problem, there are only two ways to go. Change your computer or stop developing application via VS2015.
If the project name contains spaces, the whole remote debugging fails. Visual Studio also creates weird paths. When checking out the "Blink1 for Raspberry Pi" template, I named the Project "Blink1 for Pi", which resulted in a path like this:
~/projects/Blink1?/for/pi/PI/for/pi....
And all the debugging failed. When I recreated this keeping the project name "Blink1", everything worked fine. It's a pity, that spaces aren't handled here...

Can't run Python via IDLE from Explorer [2013] - IDLE's subprocess didn't make connection

Resolved April 15, 2013.
In windows 7 (64bit) windows explorer when I right clicked a Python file and selected "edit with IDLE" the editor opens properly but when I run (or f5) the Python 3.3.1 program, it fails with the "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." error message. All other methods of starting IDLE for running my python 3.3.1 programs worked perfectly.
Even the "Send to" method worked but it was unacceptably clunky. I've spend four days (so far) researching this and trying various things including reinstalling Python many times.
And NO it's not the FireWall blocking it. I've tried totally turning Firewall off and it had no effect.
Here's an important clue: In the beginning I installed and configured python 3.3 64 bit and everything worked including running from "edit with IDLE" but then recently when I needed a library only available in Python 2 I installed python 2.7.4 and from that point on the stated problem began. At one point I completely removed all traces of both versions and reinstalled Python 3.3.1 64 bit. Problem remained.
Then I tried have both 32 bit versions installed but still no luck. Then at some point in my muddling around I lost the option to "edit with IDLE" and spent a day trying everything including editing in Regedit. No luck there either. I reinstalled Python 3.3.1 still no "edit with IDLE" then Finally I uninstalled all versions of Python and I removed python references to environment variables PATH and PYTHONPATH. Then I Deleted all the Python related keys in the windows registry, deleted the C:\python33 directory that the uninstall didn't bother to delete. Overkill, of course, then I restarted windows and installed Python 3.3.1 64 bit version again and thankfully the option to 'edit with IDLE' was back. I was momentarily happy, I opened windows explorer, right clicked on a python program, selected 'edit with IDLE' selected RUN (eyes closed) and you guessed it, same original error message "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection."
I am completely stuck on this issue and really need help. Pretty sure that you can see I and not a happy camper. And to top it all off, I guess I don't understand StackOverflow yet, I have had this plea for help up in various versions for 5 days and not one response from anyone. Believe me I've looked at every thing in stackoverflow plus other sites and I can't see the answer. Almost seems like I have to answer my own question and post it, trouble is, so far I can't.
Anyway, thanks for listening. Yes I'm pretty new to Python but I've been programming and overcoming problems for many years (too many perhaps). anyone? Not personally having someone that is familiar with Python makes this difficult, how can I get in touch with an expert in Python for a quick phone conversation?
I had this same problem today. I found another stack overflow post where someone had a tkinter.py file in the same directory as python, and they fixed it by removing that tkinter.py file. When I looked in my python directory, I realized I had created a script called random.py and put it there. I suspect that it conflicted with the normal random module in python. When I removed this file, python started working again.
So I would suggest you look in your main python directory and see if there are any .py files that you could move to different places.
I'm running Windows 7 64-bit. I saw the same errors today. I tracked down the cause for me, hopefully it'll help you. I had IDLE open in the background for days. Today I tried to run a script in IDLE, and got the "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." errors. So I closed all IDLE windows, and tried to restart IDLE. That then caused the same errors to pop up, and now IDLE wouldn't open successfully.
The cause was an extra pythonw.exe process running in the background. If I open up an instance of IDLE, then open a second, the second has issues connecting, and closes. But it does not close the instances of pythonw.exe that it opened, one is left running in the background. That extra instance then prevents future attempts to open IDLE.
Opening up Task Manager and killing all pythonw.exe processes fixed IDLE, and now it functions properly on my machine (1 instance open at a time though!).
Look for files on your main python folder that you may create in names like "threading.py", "tkinter.py" and other names that overlapps with your Lib folder and move/delete them
Adding to existing answers - it is actually possible to have firewall block IDLE when not running with -n flag. I haven't used IDLE for a few months and decided to try if it works properly with newly installed python3.3 (on Linux Mint 13 x86). In between I made iptables setup much more aggressive and apparently it blocked idle-python3.3 from connecting to the Python RPC server. Sometimes it is just what the message says.
I had exactly the same issue :"IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection."
I found the answer from this stackoverflow site. I created a file named string.py and that classhed with the normal python files. I removed the string.py and everything works now. Thanks folks.
I had the same error message. Error not seen after I added all the *.exe filea to be found in the Python install directory to the Windows firewall exception list.
I finally got it to work when I disabled ALL firewalls and antivirus, because some antivirus ALSO have firewall control. Ex. avast
Remove copy.py in your folder if you happen to have one
Using Windows 7 64 installation of Python 2.7.10 Shell I solved the above problem by opening the program as an administrator.
i have the Same issue on os win7 64Bit and Python 3.1 and find a workaround because i have a Project with many .py files and just one gave this error. - Workaround is to copy a working file and copy the contents from not working file to working file. (i used Another editor as idle. The Problem with that workaround is... of you rename the file it doenst work. attention just rename the not working file doesnt work for me. just that copy paste. – john
I came across this problem too. There are two things you can do
You may already have a process running call pythonw.exe which prevents IDLE from being starting. End that task and try running IDLE again
Use pythonwin or python command line