OS2 World Community Forum

OS/2, eCS & ArcaOS - Technical => Multimedia => Topic started by: Paul Smedley on October 29, 2022, 09:55:38 am

Title: Rebuilds of MM Audio Pack
Post by: Paul Smedley 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

Title: Re: Rebuilds of MM Audio Pack
Post by: Martin Iturbide 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/MM-SOUND-MMAudioPack)
- https://github.com/OS2World/LIB-MM-libmad (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
Title: Re: Rebuilds of MM Audio Pack
Post by: David McKenna 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,
Title: Re: Rebuilds of MM Audio Pack
Post by: Paul Smedley 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
Title: Re: Rebuilds of MM Audio Pack
Post by: Paul Smedley 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...
Title: Re: Rebuilds of MM Audio Pack
Post by: Paul Smedley on October 30, 2022, 06:00:38 am
https://smedley.id.au/tmp/mmaudiopack-20221030c.zip updates mmiomp3.dll *only* and uses libmad-0.16.3 from https://github.com/tenacityteam/libmad
Title: Re: Rebuilds of MM Audio Pack
Post by: David McKenna 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,
Title: Re: Rebuilds of MM Audio Pack
Post by: Paul Smedley 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.
Title: Re: Rebuilds of MM Audio Pack
Post by: Dave Yeo 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
Title: Re: Rebuilds of MM Audio Pack
Post by: Paul Smedley 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
Title: Re: Rebuilds of MM Audio Pack
Post by: Paul Smedley 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....
Title: Re: Rebuilds of MM Audio Pack
Post by: David McKenna 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,
Title: Re: Rebuilds of MM Audio Pack
Post by: Paul Smedley 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 :)
Title: Re: Rebuilds of MM Audio Pack
Post by: Dave Yeo 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?
Title: Re: Rebuilds of MM Audio Pack
Post by: David McKenna 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,
Title: Re: Rebuilds of MM Audio Pack
Post by: Paul Smedley on November 01, 2022, 01:20:26 am
I had to set the test programs, especially the pipe tests, to use binary mode with flac.
Does the audio pack support AIFF?

Yeah as a quick kludge I might just link with -Zbin-files and see if it fixes it...
Title: Re: Rebuilds of MM Audio Pack
Post by: Paul Smedley on November 01, 2022, 01:21:29 am
Hey Dave,

Does the audio pack support AIFF?

Is there an open source library that supports AIFF?

Cheers,

Paul.
Title: Re: Rebuilds of MM Audio Pack
Post by: Dave Yeo on November 01, 2022, 01:32:11 am
I was thinking of Flac. Of course there is libavcodec (FFmpeg) that supports most anything, though last I checked, not encoding to MP3.
In flac/test are some example aiff 's, also wave 64.
Title: Re: Rebuilds of MM Audio Pack
Post by: Paul Smedley on November 01, 2022, 09:14:29 am
OK -Zbin-files didn't help... I did change to linking with -static-libgcc, and now see that the first exception in audconv.exe is now in mmiovorb.dll - the map file should help understand where it's trapping, and I can also enable debug logging.

Will do this on another day, feeling a bit sore tonight after having a couple of biopsies taken from some moles on my back!
Title: Re: Rebuilds of MM Audio Pack
Post by: Dave Yeo on November 01, 2022, 03:31:21 pm
OK -Zbin-files didn't help... I did change to linking with -static-libgcc, and now see that the first exception in audconv.exe is now in mmiovorb.dll - the map file should help understand where it's trapping, and I can also enable debug logging.

Perhaps try linking against libcx?

Quote
Will do this on another day, feeling a bit sore tonight after having a couple of biopsies taken from some moles on my back!

Sounds painful, part of living in Australia I guess. Hopefully they're just regular moles. Good luck.
Title: Re: Rebuilds of MM Audio Pack
Post by: Remy on November 03, 2022, 11:15:56 pm
Hey Dave,

Does the audio pack support AIFF?

Is there an open source library that supports AIFF?

Cheers,

Paul.

You can use same as for WAV
It is PCM.
Title: Re: Rebuilds of MM Audio Pack
Post by: Lars on November 05, 2022, 02:13:28 pm
OS/2 already contains an IOProc for AIFF as well as IFF, it's implemented in aiffproc.dll.
Title: Re: Rebuilds of MM Audio Pack
Post by: Martin Iturbide on November 11, 2022, 05:34:39 pm
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.

Hi

I finally got some time to test this packages. I'm starting with "mmaudiopack-20221031.zip"

Here is the install with MINSTALL, I think that everything went normal.
Code: [Select]
MINSTALL - Multimedia Installer (CLI/CID) - by Kiewitz

Active package is : 'MMAudio Pak 2'

1 - 'MMIOFLAC' (Selected)
2 - 'MMIOVorbis' (Selected)
3 - 'MMIOMP3' (Selected)

Please select/deselect group(s), ENTER to install or ESC to exit

Are you sure to install this package? (ENTER to confirm)
 -> C:\MMOS2\DLL\mmiomp3.dll
 -> C:\MMOS2\DLL\mmiovorb.dll
 -> C:\MMOS2\DLL\mmioflac.dll
Custom-Terminate-API: Thread opened
Custom-Terminate-API: Thread closed
Return-Code FE00 (CID: Success, system should reboot)

[C:\HOME\DESKTOP\MMAUDIOPACK-20221031]

- Rebooted

Now I want to know what will be some usefull testing procedure.
- I grabbed and MP3, OGG and FLAC test files from the internet.
- WPS Play: OGG and FLAC tested fine with "WPS Play" (double click). MP3 is not register by default on the WPS, gotta check on that.
- MPPM.EXE: The MP3, OGG and FLAC test files reproduced fine on MMPM.EXE.

What other tests do you suggest for it ? I have no problems to report for the moment.

Regards
Title: Re: Rebuilds of MM Audio Pack
Post by: Paul Smedley on November 11, 2022, 09:39:41 pm
Hey Martin, thanks for testing. You could test audio conversion, but suspect you'll see the same issues David reported. I need to get around to investigating that !!
Title: Re: Rebuilds of MM Audio Pack
Post by: Remy on December 02, 2022, 04:35:19 am
Hi,

May it be possible to have WAV (24bits - 44100 as well 24bits 48000) supported by mmaudiopack ?

Regards
Rémy
Title: Re: Rebuilds of MM Audio Pack
Post by: Lars on December 02, 2022, 07:26:19 am
That is already supported with installing USBAUDIO package. It adds the necessary SPI info so that MMPM can understand this new Samplerate/numchannels/bit depth format.

Here is a list of what formats have been added by now:


Code: [Select]
/* additional Subtypes for DATATYPE_WAVEFORM:*/
#define    WAVE_FORMAT_32M16        0x0011L   /*  32.0kHz  , Mono, 16-bit*/
#define    WAVE_FORMAT_48M16        0x0012L   /*  48.0kHz  , Mono, 16-bit*/
#define    WAVE_FORMAT_64M16        0x0013L   /*  64.0kHz  , Mono, 16-bit*/
#define    WAVE_FORMAT_882M16       0x0014L   /*  88.2kHz  , Mono, 16-bit*/
#define    WAVE_FORMAT_96M16        0x0015L   /*  96.0kHz  , Mono, 16-bit*/
#define    WAVE_FORMAT_1764M16      0x0016L   /* 176.4kHz  , Mono, 16-bit*/
#define    WAVE_FORMAT_192M16       0x0017L   /* 192.0kHz  , Mono, 16-bit*/
#define    WAVE_FORMAT_3528M16      0x0018L   /* 352.8kHz  , Mono, 16-bit*/
#define    WAVE_FORMAT_384M16       0x0019L   /* 384.0kHz  , Mono, 16-bit*/

#define    WAVE_FORMAT_32S16        0x001AL   /*  32.0kHz  , Stereo, 16-bit*/
#define    WAVE_FORMAT_48S16        0x001BL   /*  48.0kHz  , Stereo, 16-bit*/
#define    WAVE_FORMAT_64S16        0x001CL   /*  64.0kHz  , Stereo, 16-bit*/
#define    WAVE_FORMAT_882S16       0x001DL   /*  88.2kHz  , Stereo, 16-bit*/
#define    WAVE_FORMAT_96S16        0x001EL   /*  96.0kHz  , Stereo, 16-bit*/
#define    WAVE_FORMAT_1764S16      0x001FL   /* 176.4kHz  , Stereo, 16-bit*/
#define    WAVE_FORMAT_192S16       0x0020L   /* 192.0kHz  , Stereo, 16-bit*/
#define    WAVE_FORMAT_3528S16      0x0021L   /* 352.8kHz  , Stereo, 16-bit*/
#define    WAVE_FORMAT_384S16       0x0022L   /* 384.0kHz  , Stereo, 16-bit*/

#define    WAVE_FORMAT_32M24        0x0023L   /*  32.0kHz  , Mono, 24-bit*/
#define    WAVE_FORMAT_4M24         0x0024L   /*  44.1kHz  , Mono, 24-bit*/
#define    WAVE_FORMAT_48M24        0x0025L   /*  48.0kHz  , Mono, 24-bit*/
#define    WAVE_FORMAT_64M24        0x0026L   /*  64.0kHz  , Mono, 24-bit*/
#define    WAVE_FORMAT_882M24       0x0027L   /*  88.2kHz  , Mono, 24-bit*/
#define    WAVE_FORMAT_96M24        0x0028L   /*  96.0kHz  , Mono, 24-bit*/
#define    WAVE_FORMAT_1764M24      0x0029L   /* 176.4kHz  , Mono, 24-bit*/
#define    WAVE_FORMAT_192M24       0x002AL   /* 192.0kHz  , Mono, 24-bit*/
#define    WAVE_FORMAT_3528M24      0x002BL   /* 352.8kHz  , Mono, 24-bit*/
#define    WAVE_FORMAT_384M24       0x002CL   /* 384.0kHz  , Mono, 24-bit*/

#define    WAVE_FORMAT_32S24        0x002DL   /*  32.0kHz  , Stereo, 24-bit*/
#define    WAVE_FORMAT_4S24         0x002EL   /*  44.1kHz  , Stereo, 24-bit*/
#define    WAVE_FORMAT_48S24        0x002FL   /*  48.0kHz  , Stereo, 24-bit*/
#define    WAVE_FORMAT_64S24        0x0030L   /*  64.0kHz  , Stereo, 24-bit*/
#define    WAVE_FORMAT_882S24       0x0031L   /*  88.2kHz  , Stereo, 24-bit*/
#define    WAVE_FORMAT_96S24        0x0032L   /*  96.0kHz  , Stereo, 24-bit*/
#define    WAVE_FORMAT_1764S24      0x0033L   /* 176.4kHz  , Stereo, 24-bit*/
#define    WAVE_FORMAT_192S24       0x0034L   /* 192.0kHz  , Stereo, 24-bit*/
#define    WAVE_FORMAT_3528S24      0x0035L   /* 352.8kHz  , Stereo, 24-bit*/
#define    WAVE_FORMAT_384S24       0x0036L   /* 384.0kHz  , Stereo, 24-bit*/

#define    WAVE_FORMAT_32M32        0x0037L   /*  32.0kHz  , Mono, 32-bit*/
#define    WAVE_FORMAT_4M32         0x0038L   /*  44.1kHz  , Mono, 32-bit*/
#define    WAVE_FORMAT_48M32        0x0039L   /*  48.0kHz  , Mono, 32-bit*/
#define    WAVE_FORMAT_64M32        0x003AL   /*  64.0kHz  , Mono, 32-bit*/
#define    WAVE_FORMAT_882M32       0x003BL   /*  88.2kHz  , Mono, 32-bit*/
#define    WAVE_FORMAT_96M32        0x003CL   /*  96.0kHz  , Mono, 32-bit*/
#define    WAVE_FORMAT_1764M32      0x003DL   /* 176.4kHz  , Mono, 32-bit*/
#define    WAVE_FORMAT_192M32       0x003EL   /* 192.0kHz  , Mono, 32-bit*/
#define    WAVE_FORMAT_3528M32      0x003FL   /* 352.8kHz  , Mono, 32-bit*/
#define    WAVE_FORMAT_384M32       0x0040L   /* 384.0kHz  , Mono, 32-bit*/

#define    WAVE_FORMAT_32S32        0x0041L   /*  32.0kHz  , Stereo, 32-bit*/
#define    WAVE_FORMAT_4S32         0x0042L   /*  44.1kHz  , Stereo, 32-bit*/
#define    WAVE_FORMAT_48S32        0x0043L   /*  48.0kHz  , Stereo, 32-bit*/
#define    WAVE_FORMAT_64S32        0x0044L   /*  64.0kHz  , Stereo, 32-bit*/
#define    WAVE_FORMAT_882S32       0x0045L   /*  88.2kHz  , Stereo, 32-bit*/
#define    WAVE_FORMAT_96S32        0x0046L   /*  96.0kHz  , Stereo, 32-bit*/
#define    WAVE_FORMAT_1764S32      0x0047L   /* 176.4kHz  , Stereo, 32-bit*/
#define    WAVE_FORMAT_192S32       0x0048L   /* 192.0kHz  , Stereo, 32-bit*/
#define    WAVE_FORMAT_3528S32      0x0049L   /* 352.8kHz  , Stereo, 32-bit*/
#define    WAVE_FORMAT_384S32       0x004AL   /* 384.0kHz  , Stereo, 32-bit*/

#define    WAVE_FORMAT_12M16        0x004BL   /*  12.0kHz  , Mono, 16-bit*/
#define    WAVE_FORMAT_16M16        0x004CL   /*  16.0kHz  , Mono, 16-bit*/
#define    WAVE_FORMAT_24M16        0x004DL   /*  24.0kHz  , Mono, 16-bit*/

#define    WAVE_FORMAT_12S16        0x004EL   /*  12.0kHz  , Stereo, 16-bit*/
#define    WAVE_FORMAT_16S16        0x004FL   /*  16.0kHz  , Stereo, 16-bit*/
#define    WAVE_FORMAT_24S16        0x0050L   /*  24.0kHz  , Stereo, 16-bit*/

#define    WAVE_FORMAT_8M24         0x0051L   /*   8.0kHz  , Mono,   24-bit*/
#define    WAVE_FORMAT_8S24         0x0052L   /*   8.0kHz  , Stereo, 24-bit*/
#define    WAVE_FORMAT_8M32         0x0053L   /*   8.0kHz  , Mono,   32-bit*/
#define    WAVE_FORMAT_8S32         0x0054L   /*   8.0kHz  , Stereo, 32-bit*/

Additionally, of course, the sound driver has to understand the format. For the USB audio drivers, Wim implemented a (lengthy) routine to convert sample rate/num channels/bit depth to the closest match of what the USB audio HW supports. Works perfectly.
As far as I can tell UNIAUD typically supports 8000 Hz, 11025 Hz, 22050 Hz, 44100 Hz, 48000 Hz (cannot remember what bit depths are typically supported). The support depends on the actual audio HW as UNIAUD is a generic driver covering all sorts of different audio HW.
Title: Re: Rebuilds of MM Audio Pack
Post by: Remy on December 03, 2022, 01:30:14 am
Nice to know.
Title: Re: Rebuilds of MM Audio Pack
Post by: Dariusz Piatkowski on December 09, 2022, 02:43:11 am
That is already supported with installing USBAUDIO package. It adds the necessary SPI info so that MMPM can understand this new Samplerate/numchannels/bit depth format....

...even if I'm not using a USB based audio device?
Title: Re: Rebuilds of MM Audio Pack
Post by: Martin Iturbide on December 09, 2022, 01:00:47 pm
Hi Dariuz

Lar's told me on some email time ago.

"Even though the name implies something different, USBWAV.DLL has no direct relationship to USBAUDIO.
It is a standalone DLL containing multiple IO Procs and codecs that work on any OS/2 system with MMPM.
The name is a leftover due to historical reasons."

I think it does not depends on USB.

Regards
Title: Re: Rebuilds of MM Audio Pack
Post by: Lars on December 09, 2022, 04:05:20 pm
That is already supported with installing USBAUDIO package. It adds the necessary SPI info so that MMPM can understand this new Samplerate/numchannels/bit depth format....

...even if I'm not using a USB based audio device?

Yes. The addition of new data subtypes (samplerate/numchannels/bit depth combination) to MMPM (done via SPI.INI) is independent of any specific audio driver but is a necessary precondition to use that combination at all.
But of course, the audio driver also has to support that sample rate/bit depth/numchannels combination.

In short, the update package to SPI.INI contained in USBAUDIO will satisfy the prerequisites so that for example UNIAUD could use those new subtypes.

Title: Re: Rebuilds of MM Audio Pack
Post by: Martin Iturbide on December 10, 2022, 05:20:14 pm
Hey Martin, thanks for testing. You could test audio conversion, but suspect you'll see the same issues David reported. I need to get around to investigating that !!

Hi

Simple question here.
How are you testing the audio conversion? Do you record a audio file and save it in the different formats supported by the CODEC? Which tools are you using?

Regards
Title: Re: Rebuilds of MM Audio Pack
Post by: David McKenna on December 11, 2022, 04:53:52 pm
Hi Martin,

  Just right click on any audio file, there should be a 'Convert to' choice in the menu. Click the arrow to the right and you get a menu of choices to convert to.  Pick one, then see if you can play the file that was created.

Regards,
Title: Re: Rebuilds of MM Audio Pack
Post by: David McKenna on December 11, 2022, 05:08:24 pm
Hi Lars,

That is already supported with installing USBAUDIO package. It adds the necessary SPI info so that MMPM can understand this new Samplerate/numchannels/bit depth format....

...even if I'm not using a USB based audio device?

Yes. The addition of new data subtypes (samplerate/numchannels/bit depth combination) to MMPM (done via SPI.INI) is independent of any specific audio driver but is a necessary precondition to use that combination at all.
But of course, the audio driver also has to support that sample rate/bit depth/numchannels combination.

In short, the update package to SPI.INI contained in USBAUDIO will satisfy the prerequisites so that for example UNIAUD could use those new subtypes.

 I'm able to play 24 bit, 48khz files here from the WPS using the USBAudio/USBWav driver, but not when using UniAud, even though the hardware supports it. I guess the UniAud driver does not support 24 bit files? Tried several versions of UniAud but no go.

 However, I can play 24 bit files up to 192khz in dooble at this web page: https://www.msbtechnology.com/support/bit-perfect-testing/ . If I download one of these files, then double click on it in the WPS, it does not play.

 I'm wondering if anyone has been able to play 24 bit or higher res files directly from the WPS using UniAud when they have the USBWav driver installed too...

Regards,

P.S. The new AIFF codec works well, thanks!, but only with 16 bit files too.
Title: Re: Rebuilds of MM Audio Pack
Post by: Remy on December 11, 2022, 08:03:35 pm
Hi Lars,

That is already supported with installing USBAUDIO package. It adds the necessary SPI info so that MMPM can understand this new Samplerate/numchannels/bit depth format....

...even if I'm not using a USB based audio device?

Yes. The addition of new data subtypes (samplerate/numchannels/bit depth combination) to MMPM (done via SPI.INI) is independent of any specific audio driver but is a necessary precondition to use that combination at all.
But of course, the audio driver also has to support that sample rate/bit depth/numchannels combination.

In short, the update package to SPI.INI contained in USBAUDIO will satisfy the prerequisites so that for example UNIAUD could use those new subtypes.

 I'm able to play 24 bit, 48khz files here from the WPS using the USBAudio/USBWav driver, but not when using UniAud, even though the hardware supports it. I guess the UniAud driver does not support 24 bit files? Tried several versions of UniAud but no go.

 However, I can play 24 bit files up to 192khz in dooble at this web page: https://www.msbtechnology.com/support/bit-perfect-testing/ . If I download one of these files, then double click on it in the WPS, it does not play.

 I'm wondering if anyone has been able to play 24 bit or higher res files directly from the WPS using UniAud when they have the USBWav driver installed too...

Regards,

P.S. The new AIFF codec works well, thanks!, but only with 16 bit files too.

I installed USBAUDIO driver but 24bits do no play under WPS but are ok under PM123 kike DSF64 1bits are played too under PM123!
It looks like the maximum I could play are 16 bits 48Khz audio files.
Title: Re: Rebuilds of MM Audio Pack
Post by: Martin Iturbide on December 12, 2022, 01:12:57 am
Hi Martin,

  Just right click on any audio file, there should be a 'Convert to' choice in the menu. Click the arrow to the right and you get a menu of choices to convert to.  Pick one, then see if you can play the file that was created.

Regards,

Thanks for the feedback.

I grabbed Aplause.wav and convert it to OGG. It was fine and I was able to reproduce the converted file.
What it didn't work was to convert it to FLAC. I also did the "Convert To", but this time, when I press the convert button, the bar will not progress, the error sound will chime and the audconv.exe program will be unresponsive and I require to kill the process. It generates a 0 bytes FLAC file that of course don't work.

Any other conversion testing that can be done?

Regards
Title: Re: Rebuilds of MM Audio Pack
Post by: Lars on December 12, 2022, 03:21:00 pm
Hi Lars,

That is already supported with installing USBAUDIO package. It adds the necessary SPI info so that MMPM can understand this new Samplerate/numchannels/bit depth format....

...even if I'm not using a USB based audio device?

Yes. The addition of new data subtypes (samplerate/numchannels/bit depth combination) to MMPM (done via SPI.INI) is independent of any specific audio driver but is a necessary precondition to use that combination at all.
But of course, the audio driver also has to support that sample rate/bit depth/numchannels combination.

In short, the update package to SPI.INI contained in USBAUDIO will satisfy the prerequisites so that for example UNIAUD could use those new subtypes.

 I'm able to play 24 bit, 48khz files here from the WPS using the USBAudio/USBWav driver, but not when using UniAud, even though the hardware supports it. I guess the UniAud driver does not support 24 bit files? Tried several versions of UniAud but no go.

 However, I can play 24 bit files up to 192khz in dooble at this web page: https://www.msbtechnology.com/support/bit-perfect-testing/ . If I download one of these files, then double click on it in the WPS, it does not play.

 I'm wondering if anyone has been able to play 24 bit or higher res files directly from the WPS using UniAud when they have the USBWav driver installed too...

Regards,

P.S. The new AIFF codec works well, thanks!, but only with 16 bit files too.

I installed USBAUDIO driver but 24bits do no play under WPS but are ok under PM123 kike DSF64 1bits are played too under PM123!
It looks like the maximum I could play are 16 bits 48Khz audio files.

1) as a prerequisite, SPI needs to be told what formats it can expect: combination of numchannels/bitdepth/samplerate, each combination is represented by a "subtype" number value

2) then the audio driver has to actively support a combination. The driver gets told the combination and then, it has to return the proper "subtype" number value. There are two ways that an audio driver can query and return the proper "subtype" number value: it either has a hard coded table in the driver itself (that is what USBAUDIO.SYS and USBAUD2.SYS have) or it can query a resource table that is located in AUDIOIF.DLL (this is done by USBAUDIO.SYS and USBAUD2.SYS as a fallback and is also the reason why I have create USBAUDIF.DLL as a replacement to AUDIOIF.DLL: AUDIOIF.DLL is "crippled" and therefore cannot handle samplerates >= 65536 Hz and also has a few bugs that might prevent it from finding the proper table entry).

3) finally, the audio HW has to support the combination

So, don't expect it to work with UNIAUD out of the box. You would need to tweak UNIAUD16.SYS and/or AUDIOIF.DLL to do the right thing.

With USBAUDIO.SYS and USBAUD2.SYS I can play all combinations (subtypes) that I posted earlier and including the ones that were already defined 25 years ago. If that does not work with USB audio, then you are missing the SPI update and/or the USBAUDIF.DLL update.
Title: Re: Rebuilds of MM Audio Pack
Post by: Lars on December 12, 2022, 03:33:49 pm
Forgot one thing: the CWMMClasses have the unfortunate behaviour of caching numchannels/bitdepth/samplerate into EAs. And as far as I can tell, the CWMMClasses will then use these cached values whenever there is a need to report these values to the MM subsystem.

But with the default IOProc implemented in WAVEPROC.DLL, you are limited to 16-bits (it just will incorrectly report bitdepth for anything > 16).

And therefore you need to do two things:
1) install USBWAV.DLL. That replaces WAVEPROC.DLL with its own IOProc and will fix the error along the way. For AIFF and AIFC it will always properly report what it reads from the sound file but my SPI updates will only support bitdepths 8-bit,16-bit,24-bit,32-bit (with the stated numchannels/samplerates) but not 12-bit (for example)
2) use eautil to strip off any EAs from all sound files and have CWMMClasses recreate the EAs. CWMMClasses will use the IOProc to query the settings, that's the one you installed in 1) ...
Title: Re: Rebuilds of MM Audio Pack
Post by: David McKenna on December 12, 2022, 10:07:14 pm
Hi Martin,

  Your results are exactly what I saw too. You could also try MP3 -> OGG and MP3 -> FLA and OGG -> FLA, but none of those worked for me either...

Regards,
Title: Re: Rebuilds of MM Audio Pack
Post by: David McKenna on December 12, 2022, 10:15:09 pm
 Lars,

  Thanks for the explanation. To be clear: on both of my test systems, the USB devices (both USBAudio 1 and 2) worked perfectly with different bit resolutions from the WPS. It was UniAud I was testing that did not work with 24 bit files, I was hoping to get to work. I tried replacing AUDIOIF with USBAUDIF in MMOS2.INI, but that didn't work (just got silence).

  So the obvious question is: can the code used in USBAUDIF be used to upgrade AUDIOIF so it can be used by UNIAud (or any other driver that uses AUDIOIF)? Clearly UniAud supports higher bit resolution (works with PM apps), so it must be AUDIOIF that is blocking the WPS from using higher bit resolutions?

Regards,
Title: Re: Rebuilds of MM Audio Pack
Post by: Paul Smedley on December 12, 2022, 10:26:40 pm
What it didn't work was to convert it to FLAC. I also did the "Convert To", but this time, when I press the convert button, the bar will not progress, the error sound will chime and the audconv.exe program will be unresponsive and I require to kill the process. It generates a 0 bytes FLAC file that of course don't work.
Regards

You probably also have an entry in popuplog.os2 - I need to get around to debugging this....
Title: Re: Rebuilds of MM Audio Pack
Post by: Dave Yeo on December 12, 2022, 11:28:29 pm
What it didn't work was to convert it to FLAC. I also did the "Convert To", but this time, when I press the convert button, the bar will not progress, the error sound will chime and the audconv.exe program will be unresponsive and I require to kill the process. It generates a 0 bytes FLAC file that of course don't work.
Regards

You probably also have an entry in popuplog.os2 - I need to get around to debugging this....

Using the old mmioflac.dll does work. It's kind of surprising that any of the rebuilt DLLs work with audconv built with EMX and some VACPP object files. Wish that cwmm was buildable but it seems to be missing stuff.
Title: Re: Rebuilds of MM Audio Pack
Post by: David McKenna on December 13, 2022, 12:47:49 am
Hey Dave,

  I was looking at the source of CWMM at Netlabs and saw this in a readme:

How the Trunk was Built
3   
4   2017-07-12 SHL Baseline
5   
6   The trunk was built from the contents of the zip files stashed in
7   tags/imported-zips.
8   
9   The zip files are dirty in the sense that they contain a combination of
10   build sources, backup files, build products and some other cruft.
11   
12   This initial import was a best efforts to import a buildable set of files.
13   However, it is not unlikely that some files were missed.  If so, they should
14   be found in one of the zip files and should be "svn added" to the trunk.
15   
16   It is also likely that some build products where committed to the trunk.  If
17   so, they should be "svn removed" from the trunk.
18   
19   Have fun
20   
21   Steven

 Did you check out the zip files mentioned?

Regards,
Title: Re: Rebuilds of MM Audio Pack
Post by: Dave Yeo on December 13, 2022, 01:16:27 am
Yes, Arca Noae asked me at one point to try to compile them with the goal of fixing the cdplayer to use digitial transfer. Unluckily it seems Chris had dependencies on other files on his system so the SOM stuff was unbuildable.
Title: Re: Rebuilds of MM Audio Pack
Post by: David McKenna on December 13, 2022, 01:31:37 am
 Ahhh.. that really is too bad - would be nice to add the digital transfer.

Regards,
Title: Re: Rebuilds of MM Audio Pack
Post by: Lars on December 13, 2022, 07:33:50 am
Lars,

  Thanks for the explanation. To be clear: on both of my test systems, the USB devices (both USBAudio 1 and 2) worked perfectly with different bit resolutions from the WPS. It was UniAud I was testing that did not work with 24 bit files, I was hoping to get to work. I tried replacing AUDIOIF with USBAUDIF in MMOS2.INI, but that didn't work (just got silence).

  So the obvious question is: can the code used in USBAUDIF be used to upgrade AUDIOIF so it can be used by UNIAud (or any other driver that uses AUDIOIF)? Clearly UniAud supports higher bit resolution (works with PM apps), so it must be AUDIOIF that is blocking the WPS from using higher bit resolutions?

Regards,

In principle, yes. You could even use USBAUDIF.DLL verbatim (even though its name might imply something different). Unfortunately, there is an interaction between AUDIOIF.DLL/USBAUDIF.DLL and UNIAUD16.SYS (or any other audio driver that communicates with it. The connection is set up by MMPM2.INI, just look at the "VSDDRIVER" keyword). That is, AUDIOIF.DLL calls into UNIAUD16.SYS and expects a certain kind of responses. UNIAUD16.SYS would have to be adapted to USBAUDIF.DLL.
The reason why I created USBAUDIF.DLL in the first place was, because AUDIOIF.DLL was buggy and did not do the things it should. But that also meant to adapt USBAUDIO.SYS and USBAUD2.SYS to return the info that was necessary (but using only the documented interfaces, no special stuff).
Title: Re: Rebuilds of MM Audio Pack
Post by: Andi B. on December 13, 2022, 09:48:55 am
Ahhh.. that really is too bad - would be nice to add the digital transfer.

Regards,
Digital transfer from CD you mean? Or what. We had CD digital out the last time I used it. Something about 10-20 years ago. But I hardly can imagine someone needs that today anymore.
Title: Re: Rebuilds of MM Audio Pack
Post by: Martin Iturbide on December 13, 2022, 02:24:28 pm
What it didn't work was to convert it to FLAC. I also did the "Convert To", but this time, when I press the convert button, the bar will not progress, the error sound will chime and the audconv.exe program will be unresponsive and I require to kill the process. It generates a 0 bytes FLAC file that of course don't work.
Regards

You probably also have an entry in popuplog.os2 - I need to get around to debugging this....

Hi Paul.

I had checked and it does not produces an error in popuplog.os2 when converting a WAV to FLAC. Audconv.exe hangs and gets unresponsive, I kill it with a right click the xcenter using "Kill process..".

Regards
Title: Re: Rebuilds of MM Audio Pack
Post by: Dave Yeo on December 13, 2022, 04:29:19 pm
Ahhh.. that really is too bad - would be nice to add the digital transfer.

Regards,
Digital transfer from CD you mean? Or what. We had CD digital out the last time I used it. Something about 10-20 years ago. But I hardly can imagine someone needs that today anymore.

The mediafolders CD player does not have working digital transfer and I haven't noticed anywhere to plug an analogue cable in for sound in computers in a long time so if you want to listen to a CD, you have to use a different CD player such as the old default classic one .