PDA

View Full Version : Phonon module question -- help needed



swamyonline
8th May 2009, 03:54
hi ,
this is almost the repeat post of phonon module question. how can i get phonon enabled and use it in applications with qt-4.5.1-mingw-windows.exe version? is it compulsory to compile sources of qt to active phonon? thanks in advance. bye

roxton
8th May 2009, 18:48
Please read this: http://wiki.qtcentre.org/index.php?title=Building_the_Phonon_backend_plugin _on_Windows_using_MinGW
But, you also need a GCC-adapted dvdmedia.h file from the Strawberry Perl (strawberryperl.com) package. Copy this dvdmedia.h into the include dir of MinGW, and recompile Phonon and backend.
Another way - you can recomile the whole Qt with Visual Studio C++.

FS Lover
4th July 2009, 17:17
Another way - you can recomile the whole Qt with Visual Studio C++.
can I then compile my qt progs with mingw?

wysota
4th July 2009, 17:42
No, you need to stick with one compiler.

FS Lover
4th July 2009, 18:04
I prefer mingw. Its simple and my way. its free software. universal. cross platform (a thing qt is/claims to be). I am a free software lover (hence the username FS Lover). I like independence too.
I will try to compile phonon with mingw.
but I haven't high speed internet connection in home. tommorow I will download kdewin32 package at work.
but I have a question in advance. that wiki article (http://wiki.qtcentre.org/index.php?title=Building_the_Phonon_backend_plugin _on_Windows_using_MinGW) says 'Copy the file comdef.h from kdewin32/include/mingw into kdewin32/include/directx'.
so where is the kdewin32/include/directx on my system? should I install anything before?

Lykurg
4th July 2009, 19:29
so where is the kdewin32/include/directx on my system? should I install anything before?
It's inside the kdewin package you first have to download.

FS Lover
5th July 2009, 07:22
this link: http://websvn.kde.org/trunk/kdesupport/kdewin32/
does not work and I couldn't find any other download link.
can anybody help me please?

another question: why is dvdmedia.h from strawberry perl needed? its not mentioned in the wiki article.

I found http://windows.kde.org/download.php. is that ok?
additionally it seems that overal download will be huge (see http://techbase.kde.org/Projects/KDE_on_Windows/Installation#Package_status_and_contents). I have a 256Kb connection.
is there any way for downloading only those components necessary for compiling phonon?

apparently kdewin32 installer has a package selection for download, but I don't know which packages should I choose. also there is a binary, a devel, and a src selection option for each package; which ones should I select?

oh no, it has too many options!! too many packages. too many bytes. it huge!
please help me! help...

wysota
5th July 2009, 08:29
Please edit your posts instead of replying to your own posts.

FS Lover
5th July 2009, 08:31
I am downloding. I chose only some packages that I thought are relevant to phonon. some have clear names (phonon*).
microsoft directx sdk alone is about 452MB and its download is in progress now.
in the installer program there were some options such as mingw or msvc type that I chose mingw version. I think these can cause mistakes buy less powerful users.
they don't certainly know which type and packages should they download.
I think a step by step tutorial with exactly those minimal resources required for compiling phonon is a must.

BTW I think I found another repository for kdewin32 files by looking at some ini file of the kdewin32 installer program, so I insert that link here so that if someone some day find this topic probably there is some useful info for him:
ftp://gd.tuwien.ac.at/kde/stable/4.2.3/win32/

Lykurg
5th July 2009, 08:43
this link: http://websvn.kde.org/trunk/kdesupport/kdewin32/
does not work and I couldn't find any other download link.
can anybody help me please?

It's http://websvn.kde.org/trunk/kdesupport/kdewin/

FS Lover
9th July 2009, 07:01
now I have these files downloaded:

29,114 config.txt
462,460,792 dxsdk_apr2007.exe
475,844 OggDS0995.exe
54 expat-2.0.1-bin.zip.md5
66,829 expat-2.0.1-bin.zip
65 phonon-mingw-4.3.0-bin.tar.bz2.md5
384,131 phonon-mingw-4.3.0-bin.tar.bz2
65 phonon-mingw-4.3.0-lib.tar.bz2.md5
147,308 phonon-mingw-4.3.0-lib.tar.bz2
65 phonon-mingw-4.3.0-src.tar.bz2.md5
566,452 phonon-mingw-4.3.0-src.tar.bz2
65 dbus-mingw-1.2.4-1-bin.tar.bz2.md5
1,170,713 dbus-mingw-1.2.4-1-bin.tar.bz2
63 qt-mingw-4.4.3-3-bin.tar.bz2.md5
16,037,341 qt-mingw-4.4.3-3-bin.tar.bz2
60 runtime-mingw-1.0-bin.zip.md5
3,604 runtime-mingw-1.0-bin.zip
827 kdewin-installer.log
are they sufficient?
any help please?
have I to install with kde installer first?

FS Lover
9th July 2009, 07:15
wiki: Make sure your Qt is configured with -phonon -phonon-backend.
how?

wysota
9th July 2009, 09:36
wiki: Make sure your Qt is configured with -phonon -phonon-backend.
how?

Pass those switches to configure

FS Lover
12th July 2009, 10:17
I am ready to re-compile qt.
but I want to know before if MS DirectX SDK or any other windows related parts should be installed on my system or not before compiling qt.
I have windows XP SP2.

FS Lover
12th July 2009, 15:06
should I issue the build commands in the src dir?

benlau
12th July 2009, 16:57
I am also looking for method to use phonon on windows.. I found that phonon is present in the kdewin32 project. Is it possible to use the precompiled binary from the project?

http://sourceforge.net/projects/kde-windows/files/

wysota
12th July 2009, 17:29
should I issue the build commands in the src dir?

Follow the contents of the INSTALL file.

benlau
12th July 2009, 18:29
I am quite confused about the instruction now..

1. In fact, what is phonond.dll ? I think the correct name for DS9 background is phonon_ds9.dll , and the dll of phonon is phonond.dll . I have searched "phonond" in the source tree of qt 4.5.2 , but could only found the target of phonon_ds9

2. Do I need to build kdewin32?

3. Do I need to recompile the whole QT 4.5.2? Or I need to build the DS9 backend only?

FS Lover
13th July 2009, 07:12
Is it possible to use the precompiled binary from the project?

I tried this already but I couldn't get it to work.

it seems that there should exist some more easy and reliable way for solving all of this mess:

Thank you for your mail. You can try the following patch, which still hasn't been accepted by MinGW, it should solve the problem:
http://sourceforge.net/tracker/?func=detail&aid=2673182&group_id=2435&atid=302435

Regards,

Martin

--

Martin Pejcoch, Support Engineer
Qt Software, Nokia, Oslo, Norway
but the patch was not completely successful; it had one case of reject.
I tried to apply the rejected section manually (I found those C syntax errors in a struct within another .h file);
I started re-compiling qt; that took several hours but eventually I got webkit compilation errors, phonon plugin/backend was not created (although a phonon.dll was created), and programs (qt examples) while compiled and executed without errors but couldn't playback any file.

now, I decided to download the (probably whole) kdewin and try another way according to the the wiki article.

FS Lover
13th July 2009, 21:52
after about 6 hours of compiling, I got the same results as with the mingw patch method.
although I downloaded only those parts of the kdewin project's source tree that seemed to be necessary (mingw and directx includes).
I still have some ideas to try (downloading whole kdewin doesn't seem to be necessary, so it would be on the end of the list).

there are several possible combination of methods and configurations to try.

it seems that there is a problem with compiling webkit. can anybody tell me how to disable (re)compiling of webkit?

I am now compiling again.
this time with a combination of methods.
I patched mingw headers and added extra .h files.
I replaced qt's phonon sources with those in the kdewin project.
I acted according to the wiki article (http://wiki.qtcentre.org/index.php?title=Building_the_Phonon_backend_plugin _on_Windows_using_MinGW) too.
finally I specified the release target to the mingw32-make command (probably it will work and will be much faster for my tests since no debug dlls are generated).

any help/advice and ideas are very welcome.

somebody some day should address this problem.
qt is amongst the few free/open source alternative gui/application frameworks on windows for us. personally I hate dependence on tools like MS VC (I think it is not free software too that is even worse).
and it is very unfortunate that phonon support is lacked with mingw version of qt while it has no problem with MS VC or on other platforms. qt claims to be cross platform and it is one of the reasons we chose it. but now its in doubt with this ugly situation.
It should not be so hard and complicated to solve since all involved parts are free/open source software that are available for windows too.

benlau
14th July 2009, 04:54
I am now compiling again.
this time with a combination of methods.
I patched mingw headers and added extra .h files.
I replaced qt's phonon sources with those in the kdewin project.
I acted according to the wiki article (http://wiki.qtcentre.org/index.php?title=Building_the_Phonon_backend_plugin _on_Windows_using_MinGW) too.
finally I specified the release target to the mingw32-make command (probably it will work and will be much faster for my tests since no debug dlls are generated).



Hi FS Lover,

I would also like to try to build the mingw version . Do you mind to post more detailed instruction of your work? e.g the version of qt source code used , the parameter passed to configure script , and what was patched.

I have downloaded the qt-win-opensource-src-4.5.2 , and run "configure -phonon-backend" , however the output shown that the support of phonon is disabled:

Phonon support..............no

WebKit support..............yes

QtScriptTools support.......yes

Graphics System.............raster

FS Lover
14th July 2009, 06:00
I don't need and don't like tools like qt creator.
I need phonon support with mingw.
I need a completely free environments and tools.
I need independence.
all of these are reasons why I chose Qt.
I can and will try even more to add phonon support to mingw version.
but I am an application developer, not an OS or programming framework developer!
spending too much time and energy in this field on a product that is not mine seems not to be rational any more.

I want html docs again to appear in qt directory too! as was the case before recent versions of qt.
I didn't like qt assistant too and I used firefox for reading docs. it is more fast, flexible and feature rich.

nish
14th July 2009, 07:19
dont you find the index feature of qt assistant good enough to browser?

FS Lover
14th July 2009, 09:57
I read the whole documentation from the begining and firefox was far better for me.
additionally, qt assistant was slower on my system.
I used categorized index of html docs very well.
besides all of these firefox allowed me to enlarge fonts very easily.
for studying I almost always enlarge fonts to realy big sizes and study from a distance.
it is the reason I still have my eyes healthy!
I feel and use very better all other features of firefox such as bookmarks etc. that are standard and we use everyday in the web. it has a history too. etc...

FS Lover
14th July 2009, 10:00
ialiasedLines(const QPainterPath&, QD3DBatchItem**, const QRectF&)':
painting\qpaintengine_d3d.cpp:2109: warning: converting to `int' from `qreal'
painting\qpaintengine_d3d.cpp:2110: warning: converting to `int' from `qreal'
painting\qpaintengine_d3d.cpp: In member function `virtual void QD3DDrawHelper::
addTrap(const QTessellator::Trapezoid&)':
painting\qpaintengine_d3d.cpp:2514: warning: converting to `DWORD' from `float'
painting\qpaintengine_d3d.cpp:2517: warning: converting to `DWORD' from `float'
painting\qpaintengine_d3d.cpp:2520: warning: converting to `DWORD' from `float'
painting\qpaintengine_d3d.cpp:2524: warning: converting to `DWORD' from `float'
painting\qpaintengine_d3d.cpp:2527: warning: converting to `DWORD' from `float'
painting\qpaintengine_d3d.cpp:2530: warning: converting to `DWORD' from `float'
painting\qpaintengine_d3d.cpp: In member function `void QD3DDrawHelper::tessella
te(const QPolygonF&)':
painting\qpaintengine_d3d.cpp:2568: warning: converting to `int' from `qreal'
painting\qpaintengine_d3d.cpp:2569: warning: converting to `int' from `qreal'
painting\qpaintengine_d3d.cpp: In member function `virtual void QDirect3DPaintEn
gine::updateState(const QPaintEngineState&)':
painting\qpaintengine_d3d.cpp:4425: warning: converting to `uint' from `qreal'
mingw32-make[2]: *** [tmp/obj/debug_shared/qpaintengine_d3d.o] Error 1
mingw32-make[2]: Leaving directory `D:/Qt/qt/src/gui'
mingw32-make[1]: *** [debug-all] Error 2
mingw32-make[1]: Leaving directory `D:/Qt/qt/src/gui'
mingw32-make: *** [sub-gui-make_default-ordered] Error 2


I get errors successively. I don't know what I should do!
can anybody help me please?

wysota
14th July 2009, 10:04
I read the whole documentation from the begining and firefox was far better for me.
additionally, qt assistant was slower on my system.
I used categorized index of html docs very well.
besides all of these firefox allowed me to enlarge fonts very easily.
for studying I almost always enlarge fonts to realy big sizes and study from a distance.
it is the reason I still have my eyes healthy!
I feel and use very better all other features of firefox such as bookmarks etc. that are standard and we use everyday in the web. it has a history too. etc...

Assistant has all of those too, you know... And it has a search engine built-in which Firefox doesn't.

FS Lover
14th July 2009, 22:10
Assistant has all of those too, you know... And it has a search engine built-in which Firefox doesn't.
do you mean it has a history too?!
it's slower anyway.
and since I have most of the time firefox open (for web and other offline docs), there is no desire to open another app just for reading some other doc.
additionally, apparently in recent versions (qt sdk) Assistant is merged inside qt creator. so it is now much more heavy and irrelevant for reading docs.

wysota
14th July 2009, 22:23
Don't confuse Qt with Qt SDK, they are two separate packages. And I won't believe assistant is heavier than firefox :)

FS Lover
14th July 2009, 23:11
Hi FS Lover,

I would also like to try to build the mingw version . Do you mind to post more detailed instruction of your work? e.g the version of qt source code used , the parameter passed to configure script , and what was patched.

I have downloaded the qt-win-opensource-src-4.5.2 , and run "configure -phonon-backend" , however the output shown that the support of phonon is disabled:

Phonon support..............no

WebKit support..............yes

QtScriptTools support.......yes

Graphics System.............raster

maybe we should run the MS directX SDK's env batch file before configuring.
it is not mentioned in the wiki article.
but I did that last time but I got compilation errors again.
I am suspected that I should download the latest dx sdk (currently I have that kdewin installer downloaded for me).
I am going to download the latest dx sdk tomorrow and try with it again.
probably that will be my last try with mingw.
if I succeed, probably I will try to provide a step by step guide.

next, probably I will try compiling with MS VC.

FS Lover
14th July 2009, 23:15
maybe we should run the MS directX SDK's env batch file before configuring.
it is not mentioned in the wiki article.
why?!!!!!!!!

FS Lover
14th July 2009, 23:19
Don't confuse Qt with Qt SDK, they are two separate packages. And I won't believe assistant is heavier than firefox :)
in more technical/precise words, heavier and slower are not necessarily the same/accompanied.
an app can be heavy but performs its function rapidly.

wysota
14th July 2009, 23:31
Ok, then I won't believe assistant is heavier or slower than firefox.

FS Lover
15th July 2009, 06:46
your beliefs proved to be false often :D

nish
15th July 2009, 06:58
if you like firefox.. stick with it. But dont argue that what u do is the best and dust is rest.

wysota
15th July 2009, 10:31
your beliefs proved to be false often :D

If you're referring to the thread about qobejct_cast then I wasn't wrong there. I just got tired of convinving a person that doesn't want to be convinced.

FS Lover
15th July 2009, 21:38
if you like firefox.. stick with it. But dont argue that what u do is the best and dust is rest.
I want to say qt is becoming more restrictive, taking options from users. html docs are gone!
I want phonon support in mingw version too. its a very important option to use mingw version only.
I suspect they don't work sufficiently on such things in the open source version so that more people buy their commercial version.

FS Lover
15th July 2009, 21:46
If you're referring to the thread about qobejct_cast then I wasn't wrong there.
so answer my last question there.

PS: although what I said was for fun somewhat.
you aren't wrong often (except in that topic).

nish
16th July 2009, 03:06
I want to say qt is becoming more restrictive, taking options from users. html docs are gone!
I want phonon support in mingw version too. its a very important option to use mingw version only.
I suspect they don't work sufficiently on such things in the open source version so that more people buy their commercial version.

sorry for my ignorance... i have Qt4.5.1,, and in the the doc folder i have html... did 4.5.2 removed them ... am i missing something..?

wysota
16th July 2009, 04:18
I suspect they don't work sufficiently on such things in the open source version so that more people buy their commercial version.

Commercial and Open-source versions are now practically identical (apart from the licence descriptions in every file).

FS Lover
16th July 2009, 06:49
for very technical persons (well informed about the OS and system programming) you are right (somewhat).
although commercial version has active qt that open source version hasn't.
I think this is a subtle policy that open source version is available in binary form only with mingw that hasn't phonon module pre-compiled.
I am a technical guy myself, but couldn't re-compile the whole qt successfully with mingw (additionally it is bothersome since takes many hours every time).
there are many errors and needed information. there are too many combinations and possibilities. and no person and no article helped me step by step.

FS Lover
16th July 2009, 06:54
sorry for my ignorance... i have Qt4.5.1,, and in the the doc folder i have html... did 4.5.2 removed them ... am i missing something..?
I have qt 5.4.2 (complete sdk bundle) and docs aren't available in html form.
but it is possible that other bundles have them.

FS Lover
16th July 2009, 06:59
for very technical persons (well informed about the OS and system programming) you are right (somewhat).
although commercial version has active qt that open source version hasn't.
I think this is a subtle policy that open source version is available in binary form only with mingw that hasn't phonon module pre-compiled.
I am a technical guy myself, but couldn't re-compile the whole qt successfully with mingw (additionally it is bothersome since takes many hours every time).
there are many errors and needed information. there are too many combinations and possibilities. and no person and no article helped me step by step.
although I am going to re-compile qt by MS VC++ for phonon support, but it is very unfortunate and undesired. I dislike depending on such MS only and Proprietary tools.
additionally, I don't know why isn't a pre-compiled VC++ version available for download. is it for legal reasons?

nish
16th July 2009, 07:04
i dont think they will remove html in patch version... i also have the sdk.. it contains html... better u re download :)

FS Lover
16th July 2009, 07:08
see if you can find all pages of docs in .html files? (all class references, tutorials, examples)

nish
16th July 2009, 07:13
i have checked it.. everything is present.. and i can view them in firefox!!!!! :)

FS Lover
16th July 2009, 08:27
please tell me your html docs directory's address.

nish
16th July 2009, 09:41
/home/MrDeath/qtsdk-2009.02/qt/doc/html

wysota
16th July 2009, 10:54
although commercial version has active qt that open source version hasn't.
I haven't monitored that lately as I don't use ActiveQt myself, but from what I know ActiveQt is meant to be part of the OS release as well. If it's not, this is probably because of some licencing issues.


I think this is a subtle policy that open source version is available in binary form only with mingw that hasn't phonon module pre-compiled.
I am a technical guy myself, but couldn't re-compile the whole qt successfully with mingw (additionally it is bothersome since takes many hours every time).
I don't think this is part of some policy.


there are many errors and needed information. there are too many combinations and possibilities. and no person and no article helped me step by step.
Make the day have 30 hours instead of 24 and I'll prepare a "guide for newbies" especially for you.


I have qt 5.4.2 (complete sdk bundle) and docs aren't available in html form.
but it is possible that other bundles have them.

The docs are generated form the source code. You have all the tools you need so there is no problem in regenerating them if you need them and somehow didn't find them on your system.



although I am going to re-compile qt by MS VC++ for phonon support, but it is very unfortunate and undesired. I dislike depending on such MS only and Proprietary tools.

additionally, I don't know why isn't a pre-compiled VC++ version available for download. is it for legal reasons?
Probably so. Also because Trolltech has always been pushing the use of MinGW instead of MSVC in the open-source edition. MSVC support has always been a battle between Trolltech and the community and eventually Trolltech yielded (somewhere around Qt 4.2 as far as I remember).
This is really their choice you know... The project is open-source - you have access to the sources, the licence doesn't specify you have to have access to all possible binary versions for all possible platforms. If you want Qt pre-compiled for MSVC, consider buying a commercial licence.

FS Lover
16th July 2009, 15:08
/home/MrDeath/qtsdk-2009.02/qt/doc/html
oh, you are using linux!
on windows there is not such html directory (qtsdk2009.02 & qtsdk2009.03).
just out of curiosity, what is your distro?

nish
16th July 2009, 15:20
qtsdk directory will be there in windows also.. generally in C:\Qt\ or wherever u decided to install it.

i m on Fedora8

wysota
16th July 2009, 15:47
There are indeed no html docs in the sdk, there is no need for them anymore since the help system uses compressed help files. If you want something non-standard, unfortunately you have to deal with it yourself - run make adp_docs which should get the html docs built.

nish
17th July 2009, 03:09
but i have it on linux?.. i did not recompiled anything... may be its windows only.

FS Lover
17th July 2009, 03:21
but i have it on linux?.. i did not recompiled anything... may be its windows only.it can have many reasons. e.g. GNU/linux uses kde as one of its desktop environments and if you have kde installed (probably old) docs may be installed too.
additionally, linux has a different structure, philosophy, standards, and way for doing things.
probably different people make its qt packages. etc.
it can be different simply for other reasons that I can't guess.

FS Lover
17th July 2009, 03:34
now I have phonon backend compiled with mingw.
two files are created in plugins\phonon_backend directory: libphonon_ds94.a and phonon_ds94.dll

musicplayer and capabilities examples compiled and work perfectly.
but I have problem with video. it has not colors and 4 pictures are repeated in width (screenshot is attached).
can anybody help me? I have no idea about the reason.

my code was this:

Phonon::VideoPlayer *player = new Phonon::VideoPlayer(Phonon::VideoCategory, 0);
player->show();
player->play(Phonon::MediaSource("s.wmv"));

I am using qt 4.5.2 and phonon compiled with MinGW and MS DX SDK 2008.
my configure command line was:
configure -release -fast -no-exceptions -no-qt3support -no-3dnow -phonon -phonon-backend -no-webkit -no-scripttools -no-direct3d

nish
17th July 2009, 04:14
is that a cat on two legs in this video?

FS Lover
17th July 2009, 06:24
is that a cat on two legs in this video?
yes. indeed there are two cats in the video. can you help me save them? :D

nish
17th July 2009, 06:59
if am afraid of black cats

wysota
17th July 2009, 08:59
The colours are probably caused by incorrect codecs being used by the player. You probably have to install them or somehow tell your system which ones to use.

FS Lover
17th July 2009, 10:19
if am afraid of black cats
what?!
I love cats. maybe black cats just aren't so beautiful.
I am afraid of humans much more :D

nish
17th July 2009, 10:42
i like white ones too!

SunnySan
17th July 2009, 17:32
now I have phonon backend compiled with mingw.
two files are created in plugins\phonon_backend directory: libphonon_ds94.a and phonon_ds94.dll

musicplayer and capabilities examples compiled and work perfectly.
but I have problem with video. it has not colors and 4 pictures are repeated in width (screenshot is attached).
can anybody help me? I have no idea about the reason.

my code was this:

Phonon::VideoPlayer *player = new Phonon::VideoPlayer(Phonon::VideoCategory, 0);
player->show();
player->play(Phonon::MediaSource("s.wmv"));

I am using qt 4.5.2 and phonon compiled with MinGW and MS DX SDK 2008.
my configure command line was:
configure -release -fast -no-exceptions -no-qt3support -no-3dnow -phonon -phonon-backend -no-webkit -no-scripttools -no-direct3d

Thanks FS Lover
Do you have a step by step how to compile the phonon?
I am downloading the SDK libs of MS and I also going to compile the phonon libs.

Did you run the "dx_setenv.cmd" and "setenv.cmd" before the compile like memtion in QT4.5 phonon install (http://doc.trolltech.com/4.5/phonon-overview.html#installing-phonon) ?

I also wouldn't like to install the platform of MS if possible.

Thanks

FS Lover
17th July 2009, 21:37
Thanks FS Lover
Do you have a step by step how to compile the phonon?

if I succeed I will try to write a step by step guide.
I have several other combinations/compilations to test ahead.
video is corrupt and must be fixed; you know it is essential.
other tests are (order is not meaningful):
- building phonon with DX SDK 2005 (that kdewin uses)
- adding -no-opengl to the configure command line.
- probably tring other backends like mplayer (as in QuarkPlayer)
although QuarkPlayer doesn't show video on my system! I don't know the reason; in the past it worked well.
- compiling with MS VC++
- ?


I am downloading the SDK libs of MS and I also going to compile the phonon libs.
please report your work here (configure commands, problems, results, etc.). gathering information can help us recognize common cases and guess causes of problems.


Did you run the "dx_setenv.cmd" and "setenv.cmd" before the compile like memtion in QT4.5 phonon install (http://doc.trolltech.com/4.5/phonon-overview.html#installing-phonon) ?
yes; it seems to be essential anyway (qt's phonon backend uses MS DirectShow). you can see early outputs of the configure command; if there is not such env set, phonon support will be set to 'no' regardless of the command line options.
but I have only dx_setenv.cmd on my system!
maybe I should download the whole MS SDK (its huge!!), since setenv.cmd isn't in the MS DX SDK.
probably it will be other test case I have to try.

qt is being compiled now on my system. this time I used both the mingw patch and direct x headers from the kdewin and somewhat changed the configure command line.
I am waiting. it takes many hours evey time :crying:

FS Lover
18th July 2009, 03:45
The DS9 backend contains 2 renderers, VMR9 and softrenderer. In my Windows XP installation the VMR9 one doesn't work (can be seen by a warning "the video widget could not be initialized correctly" when the video widget is created) The softrenderer didn't work at all until I edited the file src/3rdparty/phonon/ds9/videowidget.cpp and commented out the following function from VideoWindow:
how can we switch between these two renderers?

FS Lover
18th July 2009, 07:22
my last compile was successful too.
I used both the mingw headers' patch and what qtcentre's wiki article (http://wiki.qtcentre.org/index.php?title=Building_the_Phonon_backend_plugin _on_Windows_using_MinGW) says.
last configure command line that I used is:

configure -release -no-qt3support -phonon -phonon-backend -no-webkit -no-scripttools -no-direct3d -nomake demo -nomake examples
I have now two DirectShow phonon backend dlls (their size is different). they both work.
additionally, that phonon video problem (http://www.qtcentre.org/forum/p-phonon-module-question-help-needed-post109764/postcount54.html) is gone when I test my compiled video test programs at another system (at my work).
but I should know the cause. and I should know which method and dll is more correct.
maybe I should test several other times and on another system too.
but I want video on my own system too. non-phonon media players work without problems. and this can be a common problem at least for some others.
eventually I will try to write a step by step guide.
I have something like `introduction and learning basics of qt' topic in other forums (in my native language) that I should complete with phonon compiling article.
without mingw phonon, it has a harsh deficit.

FS Lover
19th July 2009, 07:27
apparently, configure command line must be like this:
configure -release -no-qt3support -phonon -phonon-backend -no-webkit -no-scripttools -no-direct3d -nomake demos -nomake examples

notice the change: `demos' not `demo'.

I tried to compile with webkit support but it failed.
I saved a backup of previous dll files (pre-compiled ones in the qt sdk) to see if I can replace some new compiled dlls with old ones to have webkit support concurrently with phonon.

my test programs work on two other systems perfectly, but video is corrupted on my own system. I don't know the reason yet. this is one of the concerns to think of. I hope that it is a rare case or casual.

notice that there is a patch (indeed, packaged with some extra headers too) for mingw header files that is a far more easier way than the way that is introduced in the wiki article.
you need a patch program to apply the patch. I downloaded the patch program from GNUWin32. it is only about 500KB.

but additionally, we need Microsoft DirectX SDK to compile phonon backend.
it has a download size of several hundred megabytes.
but it seems that we need just some files from the sdk installation that are only a fraction of the whole sdk installation.
so we can help others by preparing a separate package containing only needed files; probably it will be something like 25MB insteed of 500MB of the whole MS DX SDK.
but we have to compile and test with it and prepare it and also provide a step by step guide before.

any idea about all of these? please tell your experiences and suggestions here.

benlau
19th July 2009, 19:48
Hi ,

I am using an alternative approach to build phonon for mingw , it can build and run musicplayer and capabilities example successfully. However, like FS Lover , it have problem in playing video. But my problem is different. The video player widget can not draw anything on it, and output the below error message:



the video widget could not be initialized correctly
the video widget could not be initialized correctly
QPainter::begin: Paint device returned engine == 0, type: 1
QPainter::setBrush: Painter not active
QPainter::setPen: Painter not active
QPainter::drawRects: Painter not active
QPainter::drawRects: Painter not active
QPainter::setRenderHint: Painter must be active to set rendering hints
QPainter::setWorldTransform: Painter not active
QPainter::drawRects: Painter not active
QPainter::begin: Paint device returned engine == 0, type: 1
QPainter::setBrush: Painter not active
QPainter::setPen: Painter not active
QPainter::drawRects: Painter not active
QPainter::drawRects: Painter not active
QPainter::setRenderHint: Painter must be active to set rendering hints
QPainter::setWorldTransform: Painter not active
QPainter::drawRects: Painter not active
QPainter::begin: Paint device returned engine == 0, type: 1


My steps:



1. Download qt-win-opensource-4.5.2 and installed QT 2009 03 SDK

2. Run QT Command Prompt

3. cd c:\build\qt-win-opensource-4.5.2

4. configure -phonon -phonon-backend # dont' need to build the whole QT4

5. cd src\phonon; mingw32-make

It will create phonon4.dll and phonon4d.dll (not phonon.dll) in build\qt-win-opensource-4.5.2\lib.

5.1 Copy phonon4.dll and phonon4d.dll to c:\qt\2009.03\qt\bin ,

5.2 Copy phonon4.dll and phonon4d.dll to c:\qt\2009.03\qt\lib , and rename to phonon.dll and phonond.dll respectively.

6. Follow the instruction in the wiki : http://wiki.qtcentre.org/index.php?title=Building_the_Phonon_backend_plugin _on_Windows_using_MinGW

Download kdewin32 , modify the ds9.pro , then:

cd src\plugins\phonon\ds9
mingw32-make
mingw32-make install

FS Lover
19th July 2009, 22:29
I think you forgot something essential.
do you have DirectX SDK installed on your system?
then you must run dx_setenv.cmd in the console before running configure.
I don't know why isn't it mentioned in the wiki.

probably you now want to download the MS DX SDK.
but you can wait a little; because probably I will give you a surprise!
I have made a package containing all pieces that are needed for building a phonon support qt with mingw.
probably it will be very small in the zip format (less than 10 MB)

its benefits:
- you don't need to download the whole MS DX SDK which is about 500 MB.
- you don't need to search and download several pieces/tools separately.
- and, finally, you don't even need any special configurations and low level knowledge and you don't need to enter any complicated and vague command lines that are forgot and mistaken easily (*), since it builds qt for you fully automatically!
it restores webkit support after compilation by restoring the necessary prior dll files.
It can shutdown your system automatically after compilation if you want.
it generates a time report too.
and some other tiny features.
almost all of these are implemented via the windows command files (very similar to batch files).

*: but it's better to be experienced with such low level things anyway;
if I wasn't, I couldn't make such magical package.
now it helps me add phonon support to every qt sdk very quickly, easily, and more reliably;
and I can modify it if e.g. some future version of the qt changes structurally.

I named it `phonon4qtmingw'.
I am now re-building my own qt with it.
when the build process is finished, I will test it for phonon, and probably I will build and test with it a qt on another system too;
then I will upload it for you.

but, it's not so flexible or intelligent.
it can work only on a completely installed (recent) qt sdk which has its own mingw in a predetermined directory.
I had not the resources needed to test and extend it further reliably but I think it's sufficient at least for many guys like me at the moment.
it can be further extended, flexible and configurable in the near future if needed.
but it can be modified easily even now if one has the required knowledge.

-----------------------

PS: can someone inform me in advance about a good and free public file hosting to upload my package?

thanks.

benlau
20th July 2009, 04:59
I think you forgot something essential.
do you have DirectX SDK installed on your system?
then you must run dx_setenv.cmd in the console before running configure.
I don't know why isn't it mentioned in the wiki.


I am also wonder why the qtcentre's wiki didn't mention about it. I only have the Windows SDK suggested by Trolltech's manual. May be the kdewin did the job for it, as it have header for directx.

In fact, I just found that my method is working even without the DirectX SDK! The reason of why the video do not work in simple... I am running the application in VirtualBox 2.x.

I have copied the DLL built in VM to a real machine, it can play video now!

SunnySan
20th July 2009, 12:28
yes; it seems to be essential anyway (qt's phonon backend uses MS DirectShow). you can see early outputs of the configure command; if there is not such env set, phonon support will be set to 'no' regardless of the command line options.
but I have only dx_setenv.cmd on my system!
maybe I should download the whole MS SDK (its huge!!), since setenv.cmd isn't in the MS DX SDK.
probably it will be other test case I have to try.

qt is being compiled now on my system. this time I used both the mingw patch and direct x headers from the kdewin and somewhat changed the configure command line.
I am waiting. it takes many hours evey time :crying:

On my side I had only setenv.cmd at this location
C:\Program Files\Microsoft SDKs\Windows\v6.1\Bin\setenv.cmd
This was using Xp or earlier version MS download (http://www.microsoft.com/downloads/details.aspx?FamilyID=e6e1c3df-a74f-4207-8586-711ebe331cdc&DisplayLang=en) the link quoted in installing-phonon (http://doc.trolltech.com/4.5/phonon-overview.html#installing-phonon)

If you use older version there is 2 links to get. one for the setenv and one for the dx_setenv

FS Lover
20th July 2009, 18:30
see this: http://www.qtcentre.org/forum/f-installation-and-deployment-5/t-phonon4qtmingwzip-a-magical-package-22652.html
it's very beta.
test it if you can.