Author Topic: USBAUDIO: now supports 24-bit and sample frequencies > 65535 Hz  (Read 29148 times)

Eugene Tucker

  • Sr. Member
  • ****
  • Posts: 368
  • Karma: +12/-0
    • View Profile
Re: USBAUDIO: now supports 24-bit and sample frequencies > 65535 Hz
« Reply #15 on: January 20, 2018, 05:44:16 pm »
It worked!!!!! Yay! Thank you so very much. You were correct in what was wrong.

David McKenna

  • Hero Member
  • *****
  • Posts: 742
  • Karma: +24/-0
    • View Profile
Re: USBAUDIO: now supports 24-bit and sample frequencies > 65535 Hz
« Reply #16 on: January 20, 2018, 05:52:38 pm »
 Hi Wim,

  Thanks for all the development you've been doing on USB Audio! And thanks for the tip about the [defaultnames] section of MMPM2.INI! I had UniAud installed and working and added USB audio, but could never get the USB sound working by switching the 'Default Waveaudio Device' setting in 'Multimedia Setup'. After reboot it would still use Uniaud, so I just uninstalled UniAud to get USB audio to work.

  After seeing your MMPM2.INI tip, I tried again and discovered that when you switch the 'Default Waveaudio Device' setting in 'Multimedia Setup', only the 'Waveaudio=....' line in the [defaultnames] section of MMPM2.INI is changed. Apparently that is not enough, an 'Ampmix=...' line corresponding to the 'Waveaudio=...' line is also needed. Once I added the Ampmix line and rebooted, USB audio worked.

  This seems like either a bug, or a setup problem with MMOS/2 as the Waveaudio device should be associated with the proper mixer automatically, no?

 

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: USBAUDIO: now supports 24-bit and sample frequencies > 65535 Hz
« Reply #17 on: January 22, 2018, 08:20:21 am »
Hi Wim,

  Thanks for all the development you've been doing on USB Audio! And thanks for the tip about the [defaultnames] section of MMPM2.INI! I had UniAud installed and working and added USB audio, but could never get the USB sound working by switching the 'Default Waveaudio Device' setting in 'Multimedia Setup'. After reboot it would still use Uniaud, so I just uninstalled UniAud to get USB audio to work.

  After seeing your MMPM2.INI tip, I tried again and discovered that when you switch the 'Default Waveaudio Device' setting in 'Multimedia Setup', only the 'Waveaudio=....' line in the [defaultnames] section of MMPM2.INI is changed. Apparently that is not enough, an 'Ampmix=...' line corresponding to the 'Waveaudio=...' line is also needed. Once I added the Ampmix line and rebooted, USB audio worked.

  This seems like either a bug, or a setup problem with MMOS/2 as the Waveaudio device should be associated with the proper mixer automatically, no?

I don't know if you can name it a bug. I rather think that WPS blindly uses the first audio device for audio playback instead of explicitely asking for the "default" audio device. The result is that if you double click on a sound file, the first audio device (which is the one appearing on the very left of the Waveaudio= and Ampmix= line in MMPM2.INI) will be used. I think the "default" setting is ignored by about any application and that's the problem.

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: USBAUDIO: now supports 24-bit and sample frequencies > 65535 Hz
« Reply #18 on: January 22, 2018, 08:23:20 am »
Then I suspect that we will have to wait for Lars to put the latest versions up on hobbes.

BTW, I asked that question because I have found in the past that people forget to put minstall into the directory with the files they are installing.

No need to put "minstall" into the directory where the installation files are located. What you have to do though is switch to that directory and run the installation from there by invoking "minstall /*".

David McKenna

  • Hero Member
  • *****
  • Posts: 742
  • Karma: +24/-0
    • View Profile
Re: USBAUDIO: now supports 24-bit and sample frequencies > 65535 Hz
« Reply #19 on: January 23, 2018, 01:06:40 pm »
 Hi Lars,

 

  This seems like either a bug, or a setup problem with MMOS/2 as the Waveaudio device should be associated with the proper mixer automatically, no?

I don't know if you can name it a bug. I rather think that WPS blindly uses the first audio device for audio playback instead of explicitely asking for the "default" audio device. The result is that if you double click on a sound file, the first audio device (which is the one appearing on the very left of the Waveaudio= and Ampmix= line in MMPM2.INI) will be used. I think the "default" setting is ignored by about any application and that's the problem.

  Further fiddling shows me that just by having the line 'Ampmix=....' in the [defaultnames] section is all that is needed to get sound where I want it. So this:

[defaultnames]
Ampmix=UNIAUDAMPMIX01

 gets sounds out of the soundcard (apps and double clicking files) and this:

[defaultnames]
Ampmix=WMBAMPMIXUSB01

 gets sounds out of the USB speakers.

 I can't believe this is how MMOS/2 is intended to work, since there are no 'Ampmix' tabs in the Multimedia Setup object. Something isn't quite right. Can you point me to any documents that describe the contents or creation of the MMPM2.INI file? Google doesn't get me anything useful....

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: USBAUDIO: now supports 24-bit and sample frequencies > 65535 Hz
« Reply #20 on: January 23, 2018, 03:24:53 pm »
Hi Lars,

  Further fiddling shows me that just by having the line 'Ampmix=....' in the [defaultnames] section is all that is needed to get sound where I want it. So this:

[defaultnames]
Ampmix=UNIAUDAMPMIX01

 gets sounds out of the soundcard (apps and double clicking files) and this:

[defaultnames]
Ampmix=WMBAMPMIXUSB01

 gets sounds out of the USB speakers.

 I can't believe this is how MMOS/2 is intended to work, since there are no 'Ampmix' tabs in the Multimedia Setup object. Something isn't quite right. Can you point me to any documents that describe the contents or creation of the MMPM2.INI file? Google doesn't get me anything useful....

No there is no documentation. It's all trial and error (as so often in OS/2). When I look at the DDK code for all the MMPM related stuff (drivers as well as MMPM subsystem) I have the strong impression that all this stuff was hastily hacked together to have something working. Adding "OS/2 for PowerPC" support to the code base made the souce code even more messy.

However, now that you found out, I am thinking about adding a page to the Multimedia Object to allow setting the "default" mixer. Or it could be done via USBAUDIF.DLL (the VSD replacement for AUDIOIF.DLL).
Of course it would be even better if the "USB WaveAudio" page in the Multimedia Objekt would change that setting along with setting the default WAVE device.
I am pretty sure there is an MCI API function that allows to set the default mixer and the change should then make it into MMPM2.INI. In the past I had written an uninstall utility for UNIAUD using the MCI functions and those would also modify the MMPM2.INI file where necessary.

David McKenna

  • Hero Member
  • *****
  • Posts: 742
  • Karma: +24/-0
    • View Profile
Re: USBAUDIO: now supports 24-bit and sample frequencies > 65535 Hz
« Reply #21 on: January 24, 2018, 10:14:31 pm »
Lars,

  Back in the ISA buss days, I had 2 sound cards with Warp4 and I could switch between them from the Multimedia Setup object, so at least it used to work. Maybe I'll dig up the drivers (one was a Crystal Semiconductor card and one was one of those IBM multifunction cards) and try installing to see what kind of entries are added to MMPM2.INI...

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: USBAUDIO: now supports 24-bit and sample frequencies > 65535 Hz
« Reply #22 on: January 26, 2018, 10:13:13 am »
Lars,

  Back in the ISA buss days, I had 2 sound cards with Warp4 and I could switch between them from the Multimedia Setup object, so at least it used to work. Maybe I'll dig up the drivers (one was a Crystal Semiconductor card and one was one of those IBM multifunction cards) and try installing to see what kind of entries are added to MMPM2.INI...

I have now written an installation DLL that is called during MINSTALL installation.
It does this for both, the WAVEAUDIO device as well as the AMPMIX device:
1) it scans the list of installed drivers in MMPM2.INI. If it finds it own install name (WMB....) it picks the first instance of itself (in theory there might be more than one USBAUDIO.SYS installed even though that is more or less impossible in practice)
2) it sets this first instance as the default device

Admittedly, that'll force USB use as a default even if you have UNIAUD installed in parallel.

I have never seen a configuration page to switch between different instances of AMPMIX devices. You can switch the default WAVEAUDIO device but strange enough that does not seem to have any effect.

I am open to suggestions. I suggest that once I get the USB driver set out of the door that you just rerun the USB audio installation. In order to see if it works or not, you can modify MMPM2.INI beforehand to list UNIAUD as the default device for WAVEAUDIO and AMPMIX. The USB installation should then change that to USB WAVEAUDIO/AMPMIX.




Rich Walsh

  • Sr. Member
  • ****
  • Posts: 331
  • Karma: +23/-0
  • ONU! (OS/2 is NOT Unix!)
    • View Profile
Re: USBAUDIO: now supports 24-bit and sample frequencies > 65535 Hz
« Reply #23 on: January 27, 2018, 02:28:51 am »
I have never seen a configuration page to switch between different instances of AMPMIX devices. You can switch the default WAVEAUDIO device but strange enough that does not seem to have any effect.

I spent most of today experimenting with UniAud, UsbAudio, and MMPM2.INI, and discovered some things that surprised me. Since I know nothing about the drivers' internals, I'm hoping you can confirm or refute my findings.

It appears that the WaveAudio and AmpMix components of a driver operate independently of one another or at least with minimal dependencies. Without changing the WaveAudio component, I found that I could switch the audio output from my built-in soundcard to my USB audio dongle simply by changing the default AmpMix, then rebooting. Conversely, I could switch between WaveAudio components and always have the output appear at the default AmpMix device.

To confirm that I could actually mix-and-match audio driver components, I wiped out all MMPM2.INI references to one driver's WaveAudio and the other driver's AmpMix so MMOS2 wouldn't (shouldn't?) be able to use them. After a reboot the results were identical to using [defaultnames] to set the components it should use. (Note: I did this multiple times in multiple ways and it always worked as expected.) However, while It was easy enough to confirm which AmpMix was in use, I didn't have a way to prove which WaveAudio was being used (e.g. playing a .WAV that UniAud can't handle but UsbAudio can).

If we can really mix-and-match driver components, then the enhancements you and Wim have made to UsbAudio's WaveAudio component can be enjoyed by everyone, not just those who have a USB audio adapter. Someone with a working UniAud setup could install UsbAudio, then make its WaveAudio component the default. Because of the deficiencies in 'STPM.EXE' (the "Multimedia Setup object"), UsbAudio's enhanced sound would still be routed through his soundcard by UniAud's AmpMix. For many users, it would be the best of both worlds.

BTW... to clear up some possible confusion: it appears that when two drivers are listed for a component, the first is always the default. You only need an entry under '[defaultnames]' if you want to use the second driver for that component. Alternately, you can just change the order of the driver names to change the default.

David McKenna

  • Hero Member
  • *****
  • Posts: 742
  • Karma: +24/-0
    • View Profile
Re: USBAUDIO: now supports 24-bit and sample frequencies > 65535 Hz
« Reply #24 on: January 27, 2018, 05:22:04 pm »
Hi Rich,

  Yes, that is exactly what I found too! Didn't think of the 'mix and match' aspect, but it's a great idea. Once Lars releases his new version I have some 24 bit WAV files to test with.

 I was getting ready to install old Crystal Semiconductor drivers to inspect MMOS2.INI file entries when I read the READ.ME and ran across this little tidbit:

3) OS/2 Version 4 and Multiple MIDI and Audio devices
-------------------------------------------------------------------------------
On OS/2 Warp Version 4, the operating system has a bug where
it always uses the MMPM/2 defined WaveAudio01 device for audio and
the Sequencer01 device for MIDI. 

If the machine has more than one WaveAudio device or more than
one Sequencer device, the WaveAudio02 and Sequencer02 devices
are NEVER used even if the user launches a "Digital Audio 2" application.

This problem applies to system sounds and all of the GUI based
applications that ship with the operating system. 

For more information, consult IBM OS/2 APAR:
   "JR10933 OS/2 Merlin MIDI player always uses MIDI1 device"

The system bug is a configuration issue where the workplace shell
associates ".WAV" and ".MID" file extensions expressly with the "01"
version of the WaveAudio and Sequencer devices.

There is no method to change the association and there is no facility
provided in the OS/2 shipped applets to select a different device.

NOTE: MMPM/2 is very capable of handling a multitude of devices.
This bug however limits the functionality.

The problem does not exist on OS/2 Warp version 3.
-------------------------------------------------------------------------------------------

 So my memory of multiple sound cards must have been from the Warp3 days. I wonder exactly where this bug resides? Would be nice to add an 'Ampmix' page to STPM as a workaround...

Regards,
« Last Edit: January 27, 2018, 05:24:11 pm by David McKenna »

Rich Walsh

  • Sr. Member
  • ****
  • Posts: 331
  • Karma: +23/-0
  • ONU! (OS/2 is NOT Unix!)
    • View Profile
Re: USBAUDIO: now supports 24-bit and sample frequencies > 65535 Hz
« Reply #25 on: January 27, 2018, 11:05:57 pm »
It looks like what I wrote in my last posting was wrong.

After a lot more experimentation, I found that the WaveAudio and AmpMix components do work together. Surprisingly, it's the AmpMix setting that controls which WaveAudio component will be used (i.e. its own). As Lars noted, changing the WaveAudio default has no effect.

Even more surprising, you can create a completely bogus WaveAudio device in MMPM2.INI, make it the _only_ WaveAudio device, and your sound will still work.

In MMPM2.INI, under [Drivers], I changed 'Waveaudio' to "Waveaudio=JOEBLOWAVE01". I then made a copy of the three [UNIAUDWAVE01] sections and changed all references in them from UNIAUD to JOEBLO. With no [defaultnames] entries, UniAud's AmpMix was in control and sound came from my built-in Intel HD audio. With [defaultnames] set to use UsbAudio's AmpMix, sound was routed through my USB audio dongle. Even after deleting both UniAud and UsbAudio's [*WAVE*] sections, it still worked so those specific entries clearly weren't needed.

Finally, I deleted the "Waveaudio=" line under [Drivers] and rebooted. PM wouldn't start. It appears that the system needs (or at least wants) some of the info in the WaveAudio sections, but entries you'd think were important, like "PDDNAME=JOEBLO1$" are ignored.

All this suggests that Crystal and/or IBM's analysis of the problem was incorrect. The system uses whichever WaveAudio device is associated with the AmpMix device currently in use. It also suggests that my mix-and-match idea probably won't work: to get the benefits of UsbAudio's WaveAudio enhancements, you'll need a USB audio adapter.

P.S. All of my tests were conducted using only the two audio drivers mentioned. Other sound drivers may behave differently.
« Last Edit: January 27, 2018, 11:11:48 pm by Rich Walsh »

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: USBAUDIO: now supports 24-bit and sample frequencies > 65535 Hz
« Reply #26 on: January 28, 2018, 10:08:07 am »
If mix and match do not work the solution is still very easy:

modify UNIAUD CARDINFO.DLL to also use a new VSD driver for its WaveAudio, Midi, Ampmix respectively.
This new VSD could be a straight copy of USBAUDIF.DLL (or a source code copy, recompiled to another name) renamed to something different like UNIAUDIF.DLL. This is still necessary as our new USBAUDIF.DLL will finally allow to use sample rates > 65535 Hz.

For the matter of not completely confusing the user, it would be helpful to repack the whole UNIAUD installation to also install the necessary SPI.INI update (even though the result will be identical to what USBAUDIO installation needs) and to modify my new USBUPDT.DLL installation DLL (which explicitely sets default WAVEAUDIO and AMPMIX device) by renaming it and to set the defaults to the UNIAUD driver instead of the USB driver in order to help the user so that he does not have to fumble with MMPM2.INI

This is close to no rework at all. As always all the code that I have written can be found in the Netlabs USB repository. I still need to tweak it a little (brush up) but we are close to completion.
« Last Edit: January 29, 2018, 03:14:05 am by Lars »

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: USBAUDIO: now supports 24-bit and sample frequencies > 65535 Hz
« Reply #27 on: February 05, 2018, 04:31:22 pm »
I now uploaded USB 10.221 to Hobbes. I changed the USBAUDIO installation to no longer install a Sequencer (MIDI) device as USBAUDIO.SYS does not support MIDI. But I changed the installation so that the Ampmixer will now get its own page in the Multimedia Setup Object. That allows to not only select default WAVEAUDIO but now also default AMPMIX device and consequently it should now be possible to force WAVE play/record via USB audio.


Eugene Tucker

  • Sr. Member
  • ****
  • Posts: 368
  • Karma: +12/-0
    • View Profile
Re: USBAUDIO: now supports 24-bit and sample frequencies > 65535 Hz
« Reply #28 on: February 05, 2018, 05:12:04 pm »
Thank you Lars. The driver(s) work fine on my machine.

David McKenna

  • Hero Member
  • *****
  • Posts: 742
  • Karma: +24/-0
    • View Profile
Re: USBAUDIO: now supports 24-bit and sample frequencies > 65535 Hz
« Reply #29 on: February 05, 2018, 07:24:46 pm »
 Thanks Lars! This seems to work with regular MP3 and WAV files, but I can't play any 24 bit WAV files (by double-clicking on them). I get an error saying 'The device driver cannot be opened or the required hardware is missing (rc=5006)'. Files are 24bit, 48KHz, 2 channel and are properly recognized if I right click on it and choose 'Open as..' -> 'Wavefile Info'. Far as I can tell the USBWAV codec is installed (using listprocs). Is this a limitation of the OS/2 player? What do you or Wim use to play 24 bit files?

 Still can't switch back and forth from Uniaud to USBWav, probably because there is no AmpMix page for UniAud. Unchecking the 'Default Device' under the USB Ampmix page doesn't stick for some reason. Once checked, USB is all I get until I go into MMPM2.INI and remove it from the [defaultnames] section. Can the Ampmix page for UniAud be added manually by tweaking MMPM2.INI? I'll play around with that...

 One other thing that seems obvious in retrospect... I uninstalled the old USB audio stuff using this package before re-installing, but the USB sequencer stuff was not removed (because it doesn't install it!). Have to use the last package (USBDrv220) to do it right.

Regards,