Author Topic: Rebuilds of MM Audio Pack  (Read 40303 times)

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2257
  • Karma: +175/-0
    • View Profile
Rebuilds of MM Audio Pack
« on: October 29, 2022, 09:55:38 am »
Hi All,

For some reason, something made me thing of the MM Audio Pack (http://r6.ca/MMAudioPak/)

I've rebuilt the 3x DLL's (mmiomp3.dll; mmioflac.dll; mmioogg.dll) with GCC 12.2.0 and to use the libc libraries - previously these were built with EMX and gcc 2.8.x.

I also updated the source libs used (where possible). Whilst mmiomp3 is still using madlib 0.15.0b (as it's the latest availabl), the others are now using the latest libraries.

Not sure if the source is in git anywhere, I'll likely add it to my git when I get a chance.  mmiomp3 and mmioogg were pretty trivial to build; for mmioflac needed some work to adapt to API changes.

I haven't been able to test these much right now (sound doesn't work real well in the VM on my linux laptop) - so they could do really bad things :)

However, on a VM with AC97 hardware, I found that opening a FLAC caused a WPS restart; opening an OGG seemed to open the file ok and start to play, but the timer didn't advance; and for some reason, an MP3 wasn't associated correctly :(

https://smedley.id.au/tmp/mmaudiopack-20221029.zip

Cheers,

Paul


Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5003
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Rebuilds of MM Audio Pack
« Reply #1 on: October 29, 2022, 04:19:57 pm »
Hi Paul

Thanks for recompiling this libraries.

I have this two repos on the collected source code on OS2World:
- https://github.com/OS2World/MM-SOUND-MMAudioPack
- https://github.com/OS2World/LIB-MM-libmad

Feel free to modify or update those or clone it. I had already give you access. You  know I don't know much about source code and compiling, but I hope it is helpful.

I will be trying you versions as soon as I get some time. This week I will be getting ready for Warpstock.

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

David McKenna

  • Hero Member
  • *****
  • Posts: 809
  • Karma: +25/-0
    • View Profile
Re: Rebuilds of MM Audio Pack
« Reply #2 on: October 29, 2022, 05:34:24 pm »
 Hey Paul,

  Thanks for working on this! I gave it a good test, and here is what I found:

Playback: MP3 and OGG work fine. FLA causes a WPS reset and POPUPLOG:

10-29-2022  16:34:57  SYS3184  PID 0023  TID 002c  Slot 0090
C:\OS2\PMSHELL.EXE
c000009b
1d85092b
EAX=00000000  EBX=00000000  ECX=00000000  EDX=00000000
ESI=18fd0459  EDI=18bc0420 
DS=0053  DSACC=d0f3  DSLIM=bfffffff 
ES=0053  ESACC=d0f3  ESLIM=bfffffff 
FS=150b  FSACC=00f3  FSLIM=00000030
GS=0000  GSACC=****  GSLIM=********
CS:EIP=005b:1d85092b  CSACC=d0df  CSLIM=bfffffff
SS:ESP=0053:06bdeca8  SSACC=d0f3  SSLIM=bfffffff
EBP=06bded60  FLG=00010246

MMIOFLAC.DLL 0001:0000092b

 I'm using your latest UniAud (6.0.3).

Convert: Converting MP3 and OGG to WAV works fine. Trying to convert anything to FLA results in a 0 length file. Trying to convert an FLA file to anything fails with a POPUPLOG:

10-29-2022  11:12:34  SYS3184  PID 0055  TID 0001  Slot 0016
C:\MMOS2\MMCLASS\BIN\AUDCONV.EXE
c000009b
1d87092b
EAX=00000000  EBX=00000000  ECX=00000000  EDX=00000000
ESI=0000000a  EDI=00047ba4 
DS=0053  DSACC=d0f3  DSLIM=bfffffff 
ES=0053  ESACC=d0f3  ESLIM=bfffffff 
FS=150b  FSACC=00f3  FSLIM=00000030
GS=0000  GSACC=****  GSLIM=********
CS:EIP=005b:1d87092b  CSACC=d0df  CSLIM=bfffffff
SS:ESP=0053:00047a40  SSACC=d0f3  SSLIM=bfffffff
EBP=00047af8  FLG=00010246

MMIOFLAC.DLL 0001:0000092b

 Trying to convert anything to OGG crashes the convert app, I lose sound and the 'Convert' menu item with a POPUPLOG:

10-29-2022  11:03:13  SYS3175  PID 0066  TID 0003  Slot 0049
C:\MMOS2\MMCLASS\BIN\AUDCONV.EXE
c0000005
bffe00e3
P1=00000002  P2=0285ffe8  P3=XXXXXXXX  P4=XXXXXXXX 
EAX=0005d130  EBX=02898338  ECX=0285ffe8  EDX=00000000
ESI=02898420  EDI=02898420 
DS=0053  DSACC=d0f3  DSLIM=bfffffff 
ES=0053  ESACC=d0f3  ESLIM=bfffffff 
FS=150b  FSACC=00f3  FSLIM=00000030
GS=0000  GSACC=****  GSLIM=********
CS:EIP=005b:bffe00e3  CSACC=d0df  CSLIM=bfffffff
SS:ESP=0053:0287efdc  SSACC=d0f3  SSLIM=bfffffff
EBP=0287f080  FLG=00010206

GCC1.DLL 0001:000000e3

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

10-29-2022  11:03:13  SYS3170  PID 0066  TID 0001  Slot 008d
C:\MMOS2\MMCLASS\BIN\AUDCONV.EXE
c0010002
1fa5f331
P1=00000003  P2=XXXXXXXX  P3=XXXXXXXX  P4=XXXXXXXX 
EAX=00074130  EBX=02898338  ECX=0003fd08  EDX=174604f0
ESI=00000000  EDI=02898308 
DS=0053  DSACC=d0f3  DSLIM=bfffffff 
ES=0053  ESACC=d0f3  ESLIM=bfffffff 
FS=150b  FSACC=00f3  FSLIM=00000030
GS=0000  GSACC=****  GSLIM=********
CS:EIP=005b:bffe00e3  CSACC=d0df  CSLIM=bfffffff
SS:ESP=0053:00047cfc  SSACC=d0f3  SSLIM=bfffffff
EBP=00047da0  FLG=00010202

PMMERGE.DLL 0004:000ff331

 then have to reboot to get sound back. There is no 'Convert' menu item for MP3. Would be nice to add that. With the original Russel O'Conner version from 2003 (I presume that is what you started with), everything works except can't convert MP3 or OGG to FLA (it just exits the convert app with no error, but not really a practical idea anyway).

 Maybe it would be a good idea to just compile the existing old libraries with the new compiler first so we can compare functionality to the original build?

Regards,
« Last Edit: October 29, 2022, 10:38:20 pm by David McKenna »

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2257
  • Karma: +175/-0
    • View Profile
Re: Rebuilds of MM Audio Pack
« Reply #3 on: October 30, 2022, 04:28:57 am »
Hi Dave,

https://smedley.id.au/tmp/mmaudiopack-20221030.zip has the minimal changes to work with the newer compiler. It used the libs that are included in the source, although I had to replace some missing files.

The problem with encoding MP3 is that the MAD library only does decoding..

I forked Martin's github and will checkin the code shortly.

Hopefully this one doesn't crash :)

Edit: https://github.com/psmedley/MM-SOUND-MMAudioPack is updated now

Cheers,

Paul
« Last Edit: October 30, 2022, 06:08:18 am by Paul Smedley »

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2257
  • Karma: +175/-0
    • View Profile
Re: Rebuilds of MM Audio Pack
« Reply #4 on: October 30, 2022, 05:43:59 am »
https://smedley.id.au/tmp/mmaudiopack-20221030b.zip fixes a couple of compiler warnings in mmioflac. I still can't get any flac to play - the ones I have don't seem to work with the original mmioflac.dll either...
« Last Edit: October 30, 2022, 07:00:10 am by Paul Smedley »

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2257
  • Karma: +175/-0
    • View Profile
Re: Rebuilds of MM Audio Pack
« Reply #5 on: October 30, 2022, 06:00:38 am »
« Last Edit: October 30, 2022, 07:00:00 am by Paul Smedley »

David McKenna

  • Hero Member
  • *****
  • Posts: 809
  • Karma: +25/-0
    • View Profile
Re: Rebuilds of MM Audio Pack
« Reply #6 on: October 30, 2022, 04:20:48 pm »
 Thanks Paul! I tried both 20221030b and 20221030c and they both work the same - the only difference from the 20221029 version is that now I can play FLA files, and convert FLA to WAV, and WAV to FLA. Everything else I have already mentioned is the same - even the POPUPLOGS are identical.

 So playback works for all 3 formats here now, converting MP3, OGG, and FLA to WAV works, and converting WAV to FLA works. Any other conversion attempt results in a POPUPLOG (as noted in my previous post).

 Seems OGG conversions have the most trouble in that they kill sound and part of the MMOS2 system so I need to reboot. How could a change of compiler do that?

Regards,

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2257
  • Karma: +175/-0
    • View Profile
Re: Rebuilds of MM Audio Pack
« Reply #7 on: October 30, 2022, 10:13:22 pm »
Hi Dave,

Thanks Paul! I tried both 20221030b and 20221030c and they both work the same - the only difference from the 20221029 version is that now I can play FLA files, and convert FLA to WAV, and WAV to FLA. Everything else I have already mentioned is the same - even the POPUPLOGS are identical.

 So playback works for all 3 formats here now, converting MP3, OGG, and FLA to WAV works, and converting WAV to FLA works. Any other conversion attempt results in a POPUPLOG (as noted in my previous post).

 Seems OGG conversions have the most trouble in that they kill sound and part of the MMOS2 system so I need to reboot. How could a change of compiler do that?

Thanks for testing. I have an updated build with latest OGG and FLAC libs which I ran out of time to package, as I discovered one of my SBC's hadn't come up after a reboot, so I had to spend an hour resurrecting that. Turns out that was a bad Armbian update which only affected RK3399 based boards.

In relation to OGG conversions killing sound and how a compiler could cause that, my best guess is that the 'improved' optimisation in the newer GCC is optimising away some code which is important :) I'll try rebuilding mmioogg with less optimisation tonight.

Cheers,

Paul.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5044
  • Karma: +114/-1
    • View Profile
Re: Rebuilds of MM Audio Pack
« Reply #8 on: October 30, 2022, 10:32:42 pm »
If it is C++ code, it might be optimizing away memset()'s. For Mozilla the fix was,
Code: [Select]
-flifetime-dse=1 -fno-delete-null-pointer-checks -Wclass-memaccess

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2257
  • Karma: +175/-0
    • View Profile
Re: Rebuilds of MM Audio Pack
« Reply #9 on: October 31, 2022, 08:34:44 am »
Hey guys,

ok some more builds for testing...
https://smedley.id.au/tmp/mmaudiopack-20221031.zip updates to the latest ogg, vorbis and flac libraries - and uses GCC 12.2.0

Also - https://smedley.id.au/tmp/mmiovorbis-O0-20221031.zip is built with GCC 12.2.0 - but with Optimisation set to -O0 to minimise any optimisation.

I'll also try reproduce the C:\MMOS2\MMCLASS\BIN\AUDCONV.EXE crash locally.

Cheers,

Paul

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2257
  • Karma: +175/-0
    • View Profile
Re: Rebuilds of MM Audio Pack
« Reply #10 on: October 31, 2022, 09:56:56 am »
I'll also try reproduce the C:\MMOS2\MMCLASS\BIN\AUDCONV.EXE crash locally.

OK I can reproduce this.... not sure why it's happening....

David McKenna

  • Hero Member
  • *****
  • Posts: 809
  • Karma: +25/-0
    • View Profile
Re: Rebuilds of MM Audio Pack
« Reply #11 on: October 31, 2022, 04:30:07 pm »
 Thanks again Paul! Version 20221031 can play all formats, but cannot convert anything to FLA (which the previous version could convert WAV only). The convert program hangs and creates a 0 length file (needs to be killed), but no Popuplog. Still can convert all formats to WAV, but can't convert anything to OGG and lose sound and MMOS2 when I try, requiring a reboot. Same with the unoptimized mmioVorb.dll file too.

 So a small backward step in that we lost converting WAV -> FLA.

Regards,

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2257
  • Karma: +175/-0
    • View Profile
Re: Rebuilds of MM Audio Pack
« Reply #12 on: October 31, 2022, 08:52:58 pm »
Thanks Dave - I have some ideas on the failed conversion. I'm guessing (haven't searched the code yet) that the mkstemp may be used by the libraries, which requires the generated fd to be set to binary with klibc. Just a guess til I search the code this evening, but recording the WAG here before I forget :)

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5044
  • Karma: +114/-1
    • View Profile
Re: Rebuilds of MM Audio Pack
« Reply #13 on: October 31, 2022, 10:52:25 pm »
I had to set the test programs, especially the pipe tests, to use binary mode with flac.
Does the audio pack support AIFF?

David McKenna

  • Hero Member
  • *****
  • Posts: 809
  • Karma: +25/-0
    • View Profile
Re: Rebuilds of MM Audio Pack
« Reply #14 on: October 31, 2022, 11:10:36 pm »
 AFAIK the MM AudioPak does not support AIFF, but I don't have an AIFF file to test with. I'm pretty sure PM123 does though. Would be great to add...

Regards,