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

Qt interface did not work under Linux #737

Closed
chaserhkj opened this issue Feb 19, 2013 · 10 comments
Closed

Qt interface did not work under Linux #737

chaserhkj opened this issue Feb 19, 2013 · 10 comments

Comments

@chaserhkj
Copy link
Contributor

Application was built with qmake.

While executing the application, a window shows up like below:
 04
Then the application blocks, even not responding to the close action of the window.

The application blocks with following output:

Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated.
I: ../native/file/zip_read.cpp:203: I: Registered VFS for prefix : assets/
I: ../native/file/zip_read.cpp:203: I: Registered VFS for prefix : ./
QMetaObject::connectSlotsByName: No matching signal for on_MainWindow_destroyed()
QMetaObject::connectSlotsByName: No matching signal for on_language_changed(QAction*)
05:48:238 ../Qt/QtHost.cpp:222 I[BOOT]: NativeInitGraphics - should only be called once!
Unable to create a connection to the pulseaudio context
I: ../native/file/zip_read.cpp:220: I: Prefix match: (ui_atlas.zim) -> ui_atlas.zim
I: ../native/file/zip_read.cpp:220: I: Prefix match: (ui_atlas.zim) -> ui_atlas.zim
E: ../native/file/zip_read.cpp:229: E: Missing filesystem for ui_atlas.zim
Failed to load texture
05:48:284 ../Qt/EmuThread.cpp:162 I[BOOT]: Starting up hardware.

Environment Information:
Distribution: Arch Linux
Kernel: Linux 3.7.2 with pf patch
DE: KDE 4.10.0-1
SDL Version: 1.2.15-3
Qt Version: 4.8.4-3
Locale: zh_CN.UTF8

@hrydgard
Copy link
Owner

did you read the log?

You must have ui_atlas.zim in /assets under the directory you run PPSSPP from.

@chaserhkj
Copy link
Contributor Author

@hrydgard
After I copied the android/assets directory which contained ui_atlas.zim to the build directory, the appearance of the UI turned to be fine:
 05
But I still got no menus and the application blocks at this state as well, not responding to the close action of the window, either.

Now I got the following output:

Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated.
I: ../native/file/zip_read.cpp:203: I: Registered VFS for prefix : assets/
I: ../native/file/zip_read.cpp:203: I: Registered VFS for prefix : ./
QMetaObject::connectSlotsByName: No matching signal for on_MainWindow_destroyed()
QMetaObject::connectSlotsByName: No matching signal for on_language_changed(QAction*)
22:15:342 ../Qt/QtHost.cpp:222 I[BOOT]: NativeInitGraphics - should only be called once!
Unable to create a connection to the pulseaudio context
I: ../native/file/zip_read.cpp:220: I: Prefix match: (ui_atlas.zim) -> ui_atlas.zim
22:15:360 ../Qt/EmuThread.cpp:162 I[BOOT]: Starting up hardware.

Core file of blocked state (dumped with SIGQUIT)
https://docs.google.com/file/d/0B2cmIAqfPwVaTjFCcVh4Q0p3RXM/edit?usp=sharing

@hrydgard
Copy link
Owner

See this:

cbb786c#commitcomment-2647137

Move the setting of coreState into the win32 ifdef and try if that works. (Core/Core.cpp)

@chaserhkj
Copy link
Contributor Author

@hrydgard
That didn't work, the application still blocks.
It seems that the problem is in the Qt section rather than Core section.

Used gdb to analyze the blocked state, here are back trace messages:
0 0x00007ffff5fa1fef in pthread_join () from /usr/lib/libpthread.so.0
1 0x00007ffff4fba66b in pa_threaded_mainloop_free () from /usr/lib/libpulse.so.0
2 0x00007fffdbdf97a7 in ?? () from /usr/lib/qt/plugins/audio/libqtmedia_pulse.so
3 0x00007fffdbdf9ae6 in ?? () from /usr/lib/qt/plugins/audio/libqtmedia_pulse.so
4 0x00007fffdbdf2133 in ?? () from /usr/lib/qt/plugins/audio/libqtmedia_pulse.so
5 0x00007fffdbdf2367 in qt_plugin_instance () from /usr/lib/qt/plugins/audio/libqtmedia_pulse.so
6 0x00007ffff657700b in QPluginLoader::instance() () from /usr/lib/libQtCore.so.4
7 0x00007ffff7906d6d in ?? () from /usr/lib/libQtMultimediaKit.so.1
8 0x00007ffff7906ea3 in ?? () from /usr/lib/libQtMultimediaKit.so.1
9 0x00007ffff790470a in ?? () from /usr/lib/libQtMultimediaKit.so.1
10 0x00007ffff7904c0b in ?? () from /usr/lib/libQtMultimediaKit.so.1
11 0x00007ffff7904d52 in ?? () from /usr/lib/libQtMultimediaKit.so.1
12 0x00007ffff790389a in QAudioOutput::QAudioOutput(QAudioFormat const&, QObject*) () from /usr/lib/libQtMultimediaKit.so.1
13 0x000000000044cdec in MainAudio::MainAudio (this=0xd234e0) at ../native/base/QtMain.h:161
14 0x000000000044c9e8 in main (argc=1, argv=0x7fffffffe4a8) at ../native/base/QtMain.cpp:83

It seems that the problem is in the qtmobility's qtmedia module, as I haven't installed pulseaudio sever and the qtmedia module was trying to connect to it to play sudio, and eventually as a result it blocks at that point.

I'll test with pulseaudio server installed tomorrow.

Also suggesting that if pulseaudio was the problem, we might also have to add a fallback option in the application to not use pulseaudio for audio output while it is not reachable, because a lot of Linux users especially Arch Linux users following the KISS principle would not like to install pulseaudio server.

@unknownbrackets
Copy link
Collaborator

Oh, yes, I hit the same problem. I had to comment out the audio code in QtMain.cpp and I think QtHost.cpp to make it run.

Also, Qt should probably have the VFS reader look in more places for the assets/ dir, e.g. .. or something.

-[Unknown]

@chaserhkj
Copy link
Contributor Author

@unknownbrackets
Would you mind offering the specific code lines to comment out to let me try it out and inspect it further ?
Thanks.

@unknownbrackets
Copy link
Collaborator

Both the new and delete here:
https://github.com/hrydgard/native/blob/master/base/QtMain.cpp#L83

And then I made NativeMix do nothing (wasn't sure if mattered):
https://github.com/hrydgard/ppsspp/blob/master/Qt/QtHost.cpp#L216

I assume this disables sound, of course...

-[Unknown]

@chaserhkj
Copy link
Contributor Author

Rebuild the application with the latest sources from git, confirmed that this bug was repaired.
Close the issue.

@chaserhkj
Copy link
Contributor Author

This bug appeared again in the latest source code from git

The application behavior is exactly the same as what has been discussed in this issue.

Here is back trace information:
0 0x00007ffff5fa6fef in pthread_join () from /usr/lib/libpthread.so.0
1 0x00007ffff4fbf66b in pa_threaded_mainloop_free () from /usr/lib/libpulse.so.0
2 0x00007fffdbdf97a7 in ?? () from /usr/lib/qt4/plugins/audio/libqtmedia_pulse.so
3 0x00007fffdbdf9ae6 in ?? () from /usr/lib/qt4/plugins/audio/libqtmedia_pulse.so
4 0x00007fffdbdf2133 in ?? () from /usr/lib/qt4/plugins/audio/libqtmedia_pulse.so
5 0x00007fffdbdf2367 in qt_plugin_instance () from /usr/lib/qt4/plugins/audio/libqtmedia_pulse.so
6 0x00007ffff657700b in QPluginLoader::instance() () from /usr/lib/libQtCore.so.4
7 0x00007ffff7906d6d in ?? () from /usr/lib/libQtMultimediaKit.so.1
8 0x00007ffff7906ea3 in ?? () from /usr/lib/libQtMultimediaKit.so.1
9 0x00007ffff790470a in ?? () from /usr/lib/libQtMultimediaKit.so.1
10 0x00007ffff7904c0b in ?? () from /usr/lib/libQtMultimediaKit.so.1
11 0x00007ffff7904d52 in ?? () from /usr/lib/libQtMultimediaKit.so.1
12 0x00007ffff790389a in QAudioOutput::QAudioOutput(QAudioFormat const&, QObject*) () from /usr/lib/libQtMultimediaKit.so.1
13 0x000000000044e2be in MainAudio::MainAudio (this=0xe0d270) at ../native/base/QtMain.h:189
14 0x000000000044deb7 in main (argc=1, argv=0x7fffffffe548) at ../native/base/QtMain.cpp:86

I still thinks that this is an issue with auto-switching to alsa direct output while pulseaudio is not available. But as pulseaudio met with serious problem on my laptop due to hardware issues, I cannot test to confirm whether this bug was indeed about pulse... Can anyone do that?

Also, @unknownbrackets 's little hack of disabling the audio part would also make the application work.

@chaserhkj chaserhkj reopened this Mar 14, 2013
@papel
Copy link

papel commented Sep 9, 2013

@hrydgard
This issue is old and it is a duplicate of #3710, which is updated and uses new UI.

@hrydgard hrydgard closed this as completed Sep 9, 2013
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