Menu

#317 libout123 cannot be build on UWP with CMake

1.28.x
closed-fixed
nobody
None
5
2021-07-12
2021-06-15
No

win32 module is completely unusable (mmsystem.h if unsupported).

win32_wasapi partially supported, unusable:

1>D:\source\repos\libmpg123\src\libout123\modules\win32_wasapi.c(135,53): warning C4013: 'IMMDeviceEnumerator_GetDefaultAudioEndpoint' undefined; assuming extern returning int
1>D:\source\repos\libmpg123\src\libout123\modules\win32_wasapi.c(135,80): error C2065: 'eRender': undeclared identifier
1>D:\source\repos\libmpg123\src\libout123\modules\win32_wasapi.c(135,90): error C2065: 'eConsole': undeclared identifier
1>D:\source\repos\libmpg123\src\libout123\modules\win32_wasapi.c(140,35): warning C4013: 'IMMDeviceActivator_Activate' undefined; assuming extern returning int
1>D:\source\repos\libmpg123\src\libout123\modules\win32_wasapi.c(190,56): warning C4244: '=': conversion from 'DWORD' to 'WORD', possible loss of data
1>D:\source\repos\libmpg123\src\libout123\modules\win32_wasapi.c(191,48): warning C4244: '=': conversion from 'DWORD' to 'WORD', possible loss of data
1>D:\source\repos\libmpg123\src\libout123\modules\win32_wasapi.c(325,49): warning C4013: 'AvSetMmThreadCharacteristicsW' undefined; assuming extern returning int
1>D:\source\repos\libmpg123\src\libout123\modules\win32_wasapi.c(325,82): warning C4047: '=': 'HANDLE' differs in levels of indirection from 'int'
1>D:\source\repos\libmpg123\src\libout123\modules\win32_wasapi.c(397,12): warning C4267: 'function': conversion from 'size_t' to 'UINT32', possible loss of data
1>D:\source\repos\libmpg123\src\libout123\modules\win32_wasapi.c(442,12): warning C4267: 'function': conversion from 'size_t' to 'UINT32', possible loss of data
1>D:\source\repos\libmpg123\src\libout123\modules\win32_wasapi.c(450,12): warning C4267: 'function': conversion from 'size_t' to 'UINT32', possible loss of data
1>D:\source\repos\libmpg123\src\libout123\modules\win32_wasapi.c(460,1): warning C4244: 'initializing': conversion from 'double' to 'DWORD', possible loss of data
1>D:\source\repos\libmpg123\src\libout123\modules\win32_wasapi.c(504,51): warning C4013: 'AvRevertMmThreadCharacteristics' undefined; assuming extern returning int
1>D:\source\repos\libmpg123\src\libout123\modules\win32_wasapi.c(505,53): warning C4013: 'IMMDeviceEnumerator_Release' undefined; assuming extern returning int
1>D:\source\repos\libmpg123\src\libout123\modules\win32_wasapi.c(506,39): warning C4013: 'IMMDevice_Release' undefined; assuming extern returning int
1>D:\source\repos\libmpg123\src\libout123\modules\win32_wasapi.c(528,45): warning C4013: 'IMMDeviceEnumerator_EnumAudioEndpoints' undefined; assuming extern returning int
1>D:\source\repos\libmpg123\src\libout123\modules\win32_wasapi.c(528,66): error C2065: 'eRender': undeclared identifier
1>D:\source\repos\libmpg123\src\libout123\modules\win32_wasapi.c(528,87): error C2065: 'DEVICE_STATE_ACTIVE': undeclared identifier
1>D:\source\repos\libmpg123\src\libout123\modules\win32_wasapi.c(530,35): warning C4013: 'IMMDeviceCollection_GetCount' undefined; assuming extern returning int
1>D:\source\repos\libmpg123\src\libout123\modules\win32_wasapi.c(535,32): warning C4013: 'IMMDeviceCollection_Item' undefined; assuming extern returning int
1>D:\source\repos\libmpg123\src\libout123\modules\win32_wasapi.c(537,23): warning C4013: 'IMMDevice_GetId' undefined; assuming extern returning int
1>D:\source\repos\libmpg123\src\libout123\modules\win32_wasapi.c(539,35): warning C4013: 'IMMDevice_OpenPropertyStore' undefined; assuming extern returning int
1>D:\source\repos\libmpg123\src\libout123\modules\win32_wasapi.c(573,29): warning C4013: 'IMMDeviceCollection_Release' undefined; assuming extern returning int

I guess the only simple way is to introduce option to disable liboout123 target, and set it to OFF for CMAKE_SYSTEM_NAME STREQUAL WindowsStore.

Discussion

  • Thomas Orgis

    Thomas Orgis - 2021-06-15

    Well, what would you use for audio output on UWP?

    Without libout123, you will have to disable mpg123 itself. You could also just limit the output module to dummy. WAV writing would still work.

    Otherwise, the build would be just for libmpg123 and libsyn123, wich might be enough for vcpkg purposes.

     
  • Evgeni Poberezhnikov

    Otherwise, the build would be just for libmpg123 and libsyn123, wich might be enough for vcpkg purposes.

    Yep. BTW The previous port, based on Visual Studio solution, only built libmpg123.

     
  • Evgeni Poberezhnikov

    Well, what would you use for audio output on UWP?

    I know very little about UWP, sorry.

     
  • Thomas Orgis

    Thomas Orgis - 2021-06-15

    Can you prepare the change to disable the other stuff on UWP, then? We'd need someone with interest in that platform to actually port an audio output.

     
  • Evgeni Poberezhnikov

    Here it is.

     
  • Evgeni Poberezhnikov

    Forgot about that one, here is complete, working patch.

    Not sure about two fixes in sample.h and resample.c.

    They produce errors:

    D:\source\repos\libmpg123\src\libsyn123\sampleconv.c(116,52): error C4146: unary minus operator applied to unsigned type, result still unsigned
    D:\source\repos\libmpg123\src\libsyn123\resample.c(2008,45): error C4146: unary minus operator applied to unsigned type, result still unsigned
    

    Is my fix correct?

     
  • Evgeni Poberezhnikov

    Last fix.

     
  • Evgeni Poberezhnikov

    The last. I swear.

     
  • Thomas Orgis

    Thomas Orgis - 2021-06-18

    Close. I tweaked the CMake changes to have the BUILD_LIBOUT123 flag also working on Unix.

    The part about the numbers … that's a bit differend. I did the sample.h one like aleady present for the very same reason to the (-biggest_unsigned -1) trick. The one in resample.c I fixed like you in the patch. I probably should define the arguments to muloffdiv() as signed integers, but the internals of that one actually rely on unsigned wrap behaviour.

     
  • Thomas Orgis

    Thomas Orgis - 2021-06-18

    Care to verify that current trunk is still good for you?

     
  • Evgeni Poberezhnikov

    Yes, i works:

    [build] [66/66  98% :: 7.746] Linking C shared library src\libsyn123\syn123.dll
    [build] [66/66 100% :: 8.197] Linking C shared library src\libmpg123\mpg123.dll
    [build] Build finished with exit code 0
    
     
  • Thomas Orgis

    Thomas Orgis - 2021-07-12
    • status: open --> closed-fixed
     

Log in to post a comment.