ZDoom with OpenAL

Moderator: GZDoom Developers

Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: ZDoom with OpenAL

Post by Gez »

Apparently, because it doesn't compile on Windows. :p

Ideally, though, this would be useful. Even disregarding the potential for going GPL or double-licensing, having the possibility of choosing between OpenAL and FMOD Ex would mean that ZDoom could be ported to more platforms.
Aroenai
Posts: 20
Joined: Tue Jul 27, 2010 1:49 am

Re: ZDoom with OpenAL

Post by Aroenai »

Well I got farther, I think I'm just missing a link to a library but I can't be sure. Amazing what someone can do with no programming skills while clicking on the third result of a google search...

@Chris
http://heifner.blogspot.com/2008/02/std ... tdmax.html
Also, "#define" needed to be added to several of the lines and the DWORD error was mentioned elsewhere in the zdoom source, even with instructions on how to fix it.

Code: Select all

1>------ Build started: Project: wadsrc, Configuration: Release Win32 ------
1>Checking zdoom.pk3...
1>Could not scan 'c:/Users/Aroenai/SVN/zdoom - build/wadsrc/generated/': No such file or directory
1>        1 file(s) copied.
1>Build log was saved at "file://c:\Users\Aroenai\SVN\zdoom - build\wadsrc\Release\BuildLog.htm"
1>wadsrc - 0 error(s), 0 warning(s)
2>------ Build started: Project: zdoom, Configuration: Release Win32 ------
2>Checking svnrevision.h...
2>src/svnrevision.h is up to date at revision 2498M.
2>Linking...
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_mini_object_unref@4 referenced in function @gst_buffer_unref@4
2>oalsound.obj : error LNK2019: unresolved external symbol @g_usleep@4 referenced in function "private: static void __fastcall OpenALSoundStream::sink_eos(struct _GstAppSink *,void *)" (?sink_eos@OpenALSoundStream@@CIXPAU_GstAppSink@@PAX@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_structure_get_int@12 referenced in function "private: static enum GstFlowReturn __fastcall OpenALSoundStream::sink_preroll(struct _GstAppSink *,void *)" (?sink_preroll@OpenALSoundStream@@CI?AW4GstFlowReturn@@PAU_GstAppSink@@PAX@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_structure_has_field@8 referenced in function "private: static enum GstFlowReturn __fastcall OpenALSoundStream::sink_preroll(struct _GstAppSink *,void *)" (?sink_preroll@OpenALSoundStream@@CI?AW4GstFlowReturn@@PAU_GstAppSink@@PAX@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_caps_get_structure@8 referenced in function "private: static enum GstFlowReturn __fastcall OpenALSoundStream::sink_preroll(struct _GstAppSink *,void *)" (?sink_preroll@OpenALSoundStream@@CI?AW4GstFlowReturn@@PAU_GstAppSink@@PAX@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_caps_get_size@4 referenced in function "private: static enum GstFlowReturn __fastcall OpenALSoundStream::sink_preroll(struct _GstAppSink *,void *)" (?sink_preroll@OpenALSoundStream@@CI?AW4GstFlowReturn@@PAU_GstAppSink@@PAX@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_app_sink_pull_preroll@4 referenced in function "private: static enum GstFlowReturn __fastcall OpenALSoundStream::sink_preroll(struct _GstAppSink *,void *)" (?sink_preroll@OpenALSoundStream@@CI?AW4GstFlowReturn@@PAU_GstAppSink@@PAX@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_app_sink_pull_buffer@4 referenced in function "private: static enum GstFlowReturn __fastcall OpenALSoundStream::sink_buffer(struct _GstAppSink *,void *)" (?sink_buffer@OpenALSoundStream@@CI?AW4GstFlowReturn@@PAU_GstAppSink@@PAX@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_app_src_end_of_stream@4 referenced in function "private: static void __fastcall OpenALSoundStream::need_callback(struct _GstAppSrc *,unsigned int,void *)" (?need_callback@OpenALSoundStream@@CIXPAU_GstAppSrc@@IPAX@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_app_src_push_buffer@8 referenced in function "private: static void __fastcall OpenALSoundStream::need_callback(struct _GstAppSrc *,unsigned int,void *)" (?need_callback@OpenALSoundStream@@CIXPAU_GstAppSrc@@IPAX@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_buffer_new_and_alloc@4 referenced in function "private: static void __fastcall OpenALSoundStream::need_callback(struct _GstAppSrc *,unsigned int,void *)" (?need_callback@OpenALSoundStream@@CIXPAU_GstAppSrc@@IPAX@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_object_unref@4 referenced in function "private: static void __fastcall OpenALSoundStream::callback_source(struct _GObject *,struct _GObject *,struct _GParamSpec *,class OpenALSoundStream *)" (?callback_source@OpenALSoundStream@@CIXPAU_GObject@@0PAU_GParamSpec@@PAV1@@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_app_src_set_caps@8 referenced in function "private: static void __fastcall OpenALSoundStream::callback_source(struct _GObject *,struct _GObject *,struct _GParamSpec *,class OpenALSoundStream *)" (?callback_source@OpenALSoundStream@@CIXPAU_GObject@@0PAU_GParamSpec@@PAV1@@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_app_src_set_stream_type@8 referenced in function "private: static void __fastcall OpenALSoundStream::callback_source(struct _GObject *,struct _GObject *,struct _GParamSpec *,class OpenALSoundStream *)" (?callback_source@OpenALSoundStream@@CIXPAU_GObject@@0PAU_GParamSpec@@PAV1@@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_app_src_set_max_bytes@12 referenced in function "private: static void __fastcall OpenALSoundStream::callback_source(struct _GObject *,struct _GObject *,struct _GParamSpec *,class OpenALSoundStream *)" (?callback_source@OpenALSoundStream@@CIXPAU_GObject@@0PAU_GParamSpec@@PAV1@@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_app_src_set_size@12 referenced in function "private: static void __fastcall OpenALSoundStream::callback_source(struct _GObject *,struct _GObject *,struct _GParamSpec *,class OpenALSoundStream *)" (?callback_source@OpenALSoundStream@@CIXPAU_GObject@@0PAU_GParamSpec@@PAV1@@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_app_src_set_callbacks@16 referenced in function "private: static void __fastcall OpenALSoundStream::callback_source(struct _GObject *,struct _GObject *,struct _GParamSpec *,class OpenALSoundStream *)" (?callback_source@OpenALSoundStream@@CIXPAU_GObject@@0PAU_GParamSpec@@PAV1@@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @g_type_check_instance_cast@8 referenced in function "private: static void __fastcall OpenALSoundStream::callback_source(struct _GObject *,struct _GObject *,struct _GParamSpec *,class OpenALSoundStream *)" (?callback_source@OpenALSoundStream@@CIXPAU_GObject@@0PAU_GParamSpec@@PAV1@@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_app_src_get_type@0 referenced in function "private: static void __fastcall OpenALSoundStream::callback_source(struct _GObject *,struct _GObject *,struct _GParamSpec *,class OpenALSoundStream *)" (?callback_source@OpenALSoundStream@@CIXPAU_GObject@@0PAU_GParamSpec@@PAV1@@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_caps_unref@4 referenced in function "private: bool __thiscall OpenALSoundStream::PipelineSetup(void)" (?PipelineSetup@OpenALSoundStream@@AAE_NXZ)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_app_sink_set_caps@8 referenced in function "private: bool __thiscall OpenALSoundStream::PipelineSetup(void)" (?PipelineSetup@OpenALSoundStream@@AAE_NXZ)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_app_sink_set_drop@8 referenced in function "private: bool __thiscall OpenALSoundStream::PipelineSetup(void)" (?PipelineSetup@OpenALSoundStream@@AAE_NXZ)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_app_sink_set_callbacks@16 referenced in function "private: bool __thiscall OpenALSoundStream::PipelineSetup(void)" (?PipelineSetup@OpenALSoundStream@@AAE_NXZ)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_int_range_get_type@0 referenced in function "private: bool __thiscall OpenALSoundStream::PipelineSetup(void)" (?PipelineSetup@OpenALSoundStream@@AAE_NXZ)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_app_sink_get_type@0 referenced in function "private: bool __thiscall OpenALSoundStream::PipelineSetup(void)" (?PipelineSetup@OpenALSoundStream@@AAE_NXZ)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_element_factory_make@8 referenced in function "private: bool __thiscall OpenALSoundStream::PipelineSetup(void)" (?PipelineSetup@OpenALSoundStream@@AAE_NXZ)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_element_set_state@8 referenced in function "public: bool __thiscall OpenALSoundStream::Init(char const *)" (?Init@OpenALSoundStream@@QAE_NPBD@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @g_error_free@4 referenced in function "public: bool __thiscall OpenALSoundStream::Init(char const *)" (?Init@OpenALSoundStream@@QAE_NPBD@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @g_free@4 referenced in function "public: bool __thiscall OpenALSoundStream::Init(char const *)" (?Init@OpenALSoundStream@@QAE_NPBD@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @g_get_current_dir_utf8@0 referenced in function "public: bool __thiscall OpenALSoundStream::Init(char const *)" (?Init@OpenALSoundStream@@QAE_NPBD@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @g_strdup@4 referenced in function "public: bool __thiscall OpenALSoundStream::Init(char const *)" (?Init@OpenALSoundStream@@QAE_NPBD@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @g_strrstr@8 referenced in function "public: bool __thiscall OpenALSoundStream::Init(char const *)" (?Init@OpenALSoundStream@@QAE_NPBD@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @g_filename_to_uri_utf8@12 referenced in function "public: bool __thiscall OpenALSoundStream::Init(char const *)" (?Init@OpenALSoundStream@@QAE_NPBD@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @g_path_is_absolute@4 referenced in function "public: bool __thiscall OpenALSoundStream::Init(char const *)" (?Init@OpenALSoundStream@@QAE_NPBD@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @g_signal_connect_data@24 referenced in function "public: bool __thiscall OpenALSoundStream::Init(bool (__fastcall*)(class SoundStream *,void *,int,void *),int,int,int,void *)" (?Init@OpenALSoundStream@@QAE_NP6I_NPAVSoundStream@@PAXH1@ZHHH1@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_object_ref@4 referenced in function "private: bool __thiscall Decoder::PipelineSetup(int,int)" (?PipelineSetup@Decoder@@AAE_NHH@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_caps_append_structure@8 referenced in function "private: bool __thiscall Decoder::PipelineSetup(int,int)" (?PipelineSetup@Decoder@@AAE_NHH@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_caps_new_empty@0 referenced in function "private: bool __thiscall Decoder::PipelineSetup(int,int)" (?PipelineSetup@Decoder@@AAE_NHH@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_message_parse_error@12 referenced in function "private: bool __thiscall Decoder::IsError(void)" (?IsError@Decoder@@AAE_NXZ)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_bus_pop_filtered@8 referenced in function "private: bool __thiscall Decoder::IsError(void)" (?IsError@Decoder@@AAE_NXZ)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_element_get_bus@4 referenced in function "private: bool __thiscall Decoder::IsError(void)" (?IsError@Decoder@@AAE_NXZ)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_buffer_new@0 referenced in function "private: static void __fastcall OpenALSoundStream::need_memdata(struct _GstAppSrc *,unsigned int,void *)" (?need_memdata@OpenALSoundStream@@CIXPAU_GstAppSrc@@IPAX@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_bus_pop@4 referenced in function "public: virtual bool __thiscall OpenALSoundStream::Play(bool,float)" (?Play@OpenALSoundStream@@UAE_N_NM@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_element_seek_simple@20 referenced in function "public: virtual void __thiscall OpenALSoundStream::Stop(void)" (?Stop@OpenALSoundStream@@UAEXXZ)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_element_get_state@20 referenced in function "public: virtual void __thiscall OpenALSoundStream::Stop(void)" (?Stop@OpenALSoundStream@@UAEXXZ)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_element_query_position@12 referenced in function "public: virtual unsigned int __thiscall OpenALSoundStream::GetPosition(void)" (?GetPosition@OpenALSoundStream@@UAEIXZ)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_app_sink_is_eos@4 referenced in function "public: bool __thiscall Decoder::Decode(void const *,unsigned int,int,int)" (?Decode@Decoder@@QAE_NPBXIHH@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_bus_timed_pop_filtered@16 referenced in function "public: bool __thiscall Decoder::Decode(void const *,unsigned int,int,int)" (?Decode@Decoder@@QAE_NPBXIHH@Z)
2>oalsound.obj : error LNK2019: unresolved external symbol @gst_init_check@12 referenced in function "public: __thiscall OpenALSoundRenderer::OpenALSoundRenderer(void)" (??0OpenALSoundRenderer@@QAE@XZ)
2>../zdoom.exe : fatal error LNK1120: 49 unresolved externals
2>Build log was saved at "file://c:\Users\Aroenai\SVN\zdoom - build\Release\BuildLog.htm"
2>zdoom - 50 error(s), 0 warning(s)
========== Build: 1 succeeded, 1 failed, 12 up-to-date, 0 skipped ==========
Attachments
oal-patch-2498.zip
(27.14 KiB) Downloaded 58 times
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: ZDoom with OpenAL

Post by Gez »

Chris hasn't been around for a while...
Aroenai
Posts: 20
Joined: Tue Jul 27, 2010 1:49 am

Re: ZDoom with OpenAL

Post by Aroenai »

Last visited June 27th, 2010 according to his profile, it hasn't been that long, it's just a little over a month. I said it more for reference anyway.
User avatar
Chris
Posts: 2983
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: ZDoom with OpenAL

Post by Chris »

Graf Zahl wrote:I don't think he ever tested on Windows, being a Linux user.

Anyway, take one guess why this code was never included into ZDoom officially and probably never will... ;)
I wouldn't mind doing cross-compiles using MinGW for testing compatibility (somewhat, at least). It's not too difficult to cross-compile a CMake project, but unfortunately, building ZDoom relies on being able to run some of the programs it builds.. which, obviously, won't work when the target system is different form the host (I once tried to hack the build system so it would run those apps under Wine, but I wasn't very successful).


Aroenai, what '#define's were needed? Those latest errors look like you're missing the glib/gstreamer import libs.
Blzut3
 
 
Posts: 3215
Joined: Wed Nov 24, 2004 12:59 pm
Operating System Version (Optional): Kubuntu
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Contact:

Re: ZDoom with OpenAL

Post by Blzut3 »

Chris wrote:building ZDoom relies on being able to run some of the programs it builds.. which, obviously, won't work when the target system is different form the host (I once tried to hack the build system so it would run those apps under Wine, but I wasn't very successful).
On Ubuntu at least if you have Wine installed you can do ./some.exe from the terminal and Wine will run it. I've successfully cross compiled my Wolfenstein 3D port which uses a portion of ZDoom's code including zipdir.
Aroenai
Posts: 20
Joined: Tue Jul 27, 2010 1:49 am

Re: ZDoom with OpenAL

Post by Aroenai »

Chris wrote:Aroenai, what '#define's were needed? Those latest errors look like you're missing the glib/gstreamer import libs.
From this post near the bottom of the log.

Code: Select all

2>.\src\sound\oalsound.cpp(1310) : error C2061: syntax error : identifier 'typeof'
What import libs am I missing still? I've already added OpenAL32.lib, gstapp-0.10.lib, gstreamer-0.10.lib, gthread-2.0.lib, gmodule-2.0.lib, gobject-2.0.lib, and glib-2.0.lib using src\CMakeLists.txt as a guide. My previous post has a patch with the changes I made attached.
User avatar
Chris
Posts: 2983
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: ZDoom with OpenAL

Post by Chris »

Aroenai wrote:
Chris wrote:Aroenai, what '#define's were needed? Those latest errors look like you're missing the glib/gstreamer import libs.
From this post near the bottom of the log.

Code: Select all

2>.\src\sound\oalsound.cpp(1310) : error C2061: syntax error : identifier 'typeof'
typeof() isn't standard, though I thought MSVC supported it, so

Code: Select all

x = reinterpret_cast<typeof(x)>(alGetProcAddress("x"));
fails. Those defines you added prevent the macro expansion that's supposed to happen (I'm surprised it even compiled), which would cause problems once the EFX functions are called. I thought of another way to handle it that avoids typeof, though, so I should be able to get that fixed.

MSVC's min/max issue really annoys me.

I think I got the DWORD issue resolved.

As for the import libs, can you double-check that the libs were added to the project? The Windows side doesn't properly disable the OpenAL backend if the GStreamer libs weren't found (which I'll fix up), they just don't get added to the linker. Of course, ideally Windows would use something other than GStreamer, but I don't know what is available that would be appropriate, and that I know how to use.
Blzut3 wrote:On Ubuntu at least if you have Wine installed you can do ./some.exe from the terminal and Wine will run it. I've successfully cross compiled my Wolfenstein 3D port which uses a portion of ZDoom's code including zipdir.
Hmm, right. Some systems set up a binfmt rule so PE executables are invoked with Wine. AFAIK, that's not recommended (partly because C# executables are also PE format and would be invoked with Wine instead of Mono), but Ubuntu isn't known for having proper system setups. Still, it is an option, I suppose.
Aroenai
Posts: 20
Joined: Tue Jul 27, 2010 1:49 am

Re: ZDoom with OpenAL

Post by Aroenai »

Never mind, generated new project files with cmake and it no longer has those linker errors and they are added to the project. I must have done something wrong when I added them manually. So I guess once those other issues are fixed it will compile fine then?
User avatar
Chris
Posts: 2983
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: ZDoom with OpenAL

Post by Chris »

Hopefully. How well does this patch work?
Attachments
oal-patch-2528.zip
(31.15 KiB) Downloaded 61 times
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ZDoom with OpenAL

Post by Graf Zahl »

I'm going to create an OpenAL branch so that this can finally be managed by SVN. I hope that will make things easier for you.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ZDoom with OpenAL

Post by Graf Zahl »

No idea what you did here but the patch does not work. Did you create this with GZDoom? The revision number seems to suggest so. Problem is, even in that case it's worthless because I can't safely backport the changes to the CMakeLists files. In addition I can't apply it because I still get inconsistencies.
User avatar
Chris
Posts: 2983
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: ZDoom with OpenAL

Post by Chris »

Graf Zahl wrote:No idea what you did here but the patch does not work. Did you create this with GZDoom?
The changes were made with GZDoom, but I made sure the patch applied to a clean ZDoom checkout (r2528). How about this one, diffed from a modified ZDoom r2530 tree?

I don't believe I have SVN access, but a branch I could write to would be rather useful. Thanks. :)
Attachments
oal-patch-2530.zip
(31.12 KiB) Downloaded 62 times
Aroenai
Posts: 20
Joined: Tue Jul 27, 2010 1:49 am

Re: ZDoom with OpenAL

Post by Aroenai »

Code: Select all

@@ -706,7 +708,7 @@
 
 	if (!ShowedBanner)
 	{
-		Printf("FMOD Sound System, copyright ɠFirelight Technologies Pty, Ltd., 1994-2009.\n");
+		Printf("FMOD Sound System, copyright © Firelight Technologies Pty, Ltd., 1994-2009.\n");
 		Printf("Loaded FMOD version %x.%02x.%02x\n", version >> 16, (version >> 8) & 255, version & 255);
 		ShowedBanner = true;
 	}
That part causes problems for me in all the patches he posts, I always have to delete it for the patch to apply. Hope that helps Graf ;)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ZDoom with OpenAL

Post by Graf Zahl »

Ok, that one worked - but I still had to modify it due to the problems with the copyright sign in fmodsound.cpp.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”