Author Topic: recent developments for USB audio  (Read 1510 times)

Lars

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 20
  • Posts: 143
    • View Profile
recent developments for USB audio
« on: April 08, 2017, 10:22:54 am »
Hallo,

Wim Brul and me have made some significant progress in enhancing support for USB based audio:
1) we have fixed quite a few bugs in USBAUDIO.SYS so that finally it will work reliably
2) I have implemented on-the-fly sample rate conversion in an IOProc (USBWAV.DLL) for these conversions:
   target:
   16-bit signed PCM, stereo, 44100 Hz
   source:
   8-bit unsigned PCM, mono, 11025 Hz
   8-bit unsigned PCM, stereo, 11025 Hz
   8-bit unsigned PCM, mono, 22050 Hz
   8-bit unsigned PCM, stereo, 22050 Hz
   8-bit unsigned PCM, mono, 44100 Hz
   8-bit unsigned PCM, stereo, 44100 Hz
   16-bit signed PCM, mono, 11025 Hz
   16-bit signed PCM, stereo, 11025 Hz
   16-bit signed PCM, mono, 22050 Hz
   16-bit signed PCM, stereo, 22050 Hz
   16-bit signed PCM, mono, 44100 Hz
"on-the-fly" means you no longer have to manually convert audio files to the 16-bit signed PCM, stereo, 44100 Hz target format.
The IOProc will instead do that on the fly when you open an audio file (double click a WAV file under the Workplace Shell for example).
3) additionally I have added Codecs for A-Law and Mu-Law
4) for audio compressed files, I have added support to the IOProc to use any audio codecs that are installed to decompress audio from the compressed format to 16-bit PCM (if a suitable codec can be found)
5) Wim has picked up the functionality in the IOProc as listed in 2) and added the same to USBAUDIO.SYS. This is for those applications that use DART directly and bypass the MMIO file support. An example of direct DART use would be the "libkai" library.

This will greatly improve the usability of USB audio under OS/2. What's left to be done is to also support "48 kHz sampling rate only"  USB devices. However that will require additional effort.

Lars
« Last Edit: April 08, 2017, 10:30:56 am by Lars »



Neil Waldhauer

  • Sr. Member
  • ****
  • Thank You
  • -Given: 6
  • -Receive: 15
  • Posts: 274
    • View Profile
    • Blonde Guy
Re: recent developments for USB audio
« Reply #1 on: April 09, 2017, 09:35:16 pm »
 I am looking forward to try the results of your efforts.  I had good results with your 2.16 release,  but eventually I found stability bugs that made it difficult to live with.
Expert consulting for ArcaOS, OS/2 and eComStation
http://www.blondeguy.com

RBRi

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 18
    • View Profile
Re: recent developments for USB audio
« Reply #2 on: April 10, 2017, 08:03:14 pm »
Thanks a lot...

Lars

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 20
  • Posts: 143
    • View Profile
Re: recent developments for USB audio
« Reply #3 on: April 11, 2017, 10:50:09 am »
I am looking forward to try the results of your efforts.  I had good results with your 2.16 release,  but eventually I found stability bugs that made it difficult to live with.

It may well be possible that these issues are fixed. Unfortunately, we cannot rule out problems: the USBAUDIO sources from the DDK are in an "unknown" state, meaning, we don't know if they match the latest binary from IBM. What we DO know is that the latest USBAUDIO.SYS binary from IBM already traps on system bootup.
That tells a lot on how much testing has gone into the USBAUDIO.SYS driver ...

For the sample rate conversion: about 20 years ago, 11025 Hz (or even 8000 Hz) 8-bit PCM mono was standard (and the various other low sample rate formats). That's why the Audio HW implemented the matching D/A conversion in HW and everything was nice and shiny.
20 years later, in particular the USB Audio HW is almost always limited to either/and 16-bit PCM, stereo,44100 Hz or 16-bit PCM,stereo, 48000 Hz.
We have to live with that and give the HW the data in the form that it accepts ...

Wim has come up with a generalized sample rate converter which he already added to USBAUDIO.SYS.
If that works out alright I am also going to pick it up and use that in USBWAV.DLL instead of the fixed list of source sample rates that I have been given earlier.

Lars
« Last Edit: April 11, 2017, 10:55:29 am by Lars »

Lars

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 20
  • Posts: 143
    • View Profile
Re: recent developments for USB audio
« Reply #4 on: May 12, 2017, 08:07:38 pm »
I just released 10.217 on Hobbes. It contains loads of changes. In particular to USBAUDIO.SYS.
Plus it comes with IOProc and 2 Codecs ...

Dariusz Piatkowski

  • Full Member
  • ***
  • Thank You
  • -Given: 9
  • -Receive: 6
  • Posts: 226
    • View Profile
Re: recent developments for USB audio
« Reply #5 on: May 13, 2017, 03:05:50 pm »
Lars,

Can you explain the relationship between your USB releases and AN's?

I ask because part of my reason for the purchase of the "Drivers" subscription from AN was to keep some sort of continuity in my driver upgrades. My primary focus was on the ACPI stuff to get a stable SMP system, but I figured going to a single source would make that easier for other drivers as well.

Meanwhile, you are the definition of "cutting edge" in the OS/2 USB-land, and I find that AN has consistently fallen behind in their updates.

So can you elaborate on whether there is any sort of collaboration between you and AN? Should I simply dump AN stuff and revert back to your releases?

R.M. Klippstein

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 197
    • View Profile
Re: recent developments for USB audio
« Reply #6 on: May 13, 2017, 03:35:22 pm »
HI lars,

Dariusz has described the problem perfectly, that a lot of us are groping with, as we watch each of your new releases. Any suggestions you might have would be greatly appreciated.

klipp

Doug Bissett

  • Hero Member
  • *****
  • Thank You
  • -Given: 1
  • -Receive: 36
  • Posts: 916
    • View Profile
Re: recent developments for USB audio
« Reply #7 on: May 13, 2017, 06:24:42 pm »
Quote
Can you explain the relationship between your USB releases and AN's?

AN described it to me this way: Lars is doing experimental work, while the AN drivers are supposed to be considered as "stable", with no "experimental" stuff in them. I think that is probably a pretty good description of the differences. Which one to use, depends on exactly what you need to do. ArcaOS will, of course, have the AN version.

Dariusz Piatkowski

  • Full Member
  • ***
  • Thank You
  • -Given: 9
  • -Receive: 6
  • Posts: 226
    • View Profile
Re: recent developments for USB audio
« Reply #8 on: May 13, 2017, 06:38:57 pm »
Hi Doug,

...Which one to use, depends on exactly what you need to do. ArcaOS will, of course, have the AN version...

OK, fair enough...and so much I had assumed. However, the "AN Version" is precisely what??? Is it a fork off of the stuff Lars is working on? Is it a release of Lars's stuff once that's deemed non-experimental? Or is it an entirely different release altogether?

So here is the my bigger question: if I'm testing Lars' releases, can I safely assume that my feedback will ultimately make it to AN's stable release?

Right now this seems to be a big un-known.

Andreas Schnellbacher

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 15
  • Posts: 222
    • View Profile
Re: recent developments for USB audio
« Reply #9 on: May 13, 2017, 07:10:01 pm »
Both are parallel releases from the same code base. David's AN version is more "conservative" and not experimental. Lars' version contains newer code and releases come often.

Because the situation for OS/2 in USB hardware support is far from ready, one may have with different releases of both different experiences. Which one is working better depends on the hardware. IMO David's versions are not more stable than Lars' automatically, but the lower release cycle likely leads to less buggy releases, overall.

OS/2 drivers are all experimental since the days after Warp 3.0 ... 4.0, IMO. BTW, I consider the original IBM-licensed drivers as much more experimental than all the later versions.

Neil Waldhauer

  • Sr. Member
  • ****
  • Thank You
  • -Given: 6
  • -Receive: 15
  • Posts: 274
    • View Profile
    • Blonde Guy
Re: recent developments for USB audio
« Reply #10 on: May 14, 2017, 08:19:36 pm »
I have installed this on my new laptop, and sound does work. For those who want to try.

1. If uniaud is installed, uninstall it. Use uninstal.exe from an older uniaud release to remove it. uninstal.exe is not in more recent releases. reboot.
2. install USB 10.217. reboot
3. install usbaudio and usbwav using minstall. reboot

At this point, sound worked for me. I'm using the Trond device https://www.newegg.com/Product/Product.aspx?Item=9SIA8583987106 I still see some drop outs, and lost frames/stopped video on YouTube. The sound is pretty good.

For the thread on the laptop, see http://www.os2world.com/forum/index.php/topic,1160.0.html
« Last Edit: May 14, 2017, 08:24:13 pm by Neil Waldhauer »
Expert consulting for ArcaOS, OS/2 and eComStation
http://www.blondeguy.com

Lars

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 20
  • Posts: 143
    • View Profile
Re: recent developments for USB audio
« Reply #11 on: May 14, 2017, 08:36:56 pm »
ok,

1) if you want to report bugs to AN regarding use of USB drivers then you have to use the AN USB drivers.
2) AN's code and my code was forked off the same basis which is the USB source code from the latest DDK. My changes are all visible to David as we have access to the same USB SVN repo at Netlabs. However I am not sure if David has checked in all his changes.
3) USBAUDIO changes (and the one necessary change to USBEHCD that was done in 10.217) are currently only in my drivers, I presume. At least I have seen no changes by David checked in. USBWAV is definitely only in my set of drivers.
4) I believe that USBMSD.ADD with "large floppy" support, fixes in device geometry computation etc. are only available in my package. Unfortunately, multi-LUN support (USB card readers for example) functionality is missing as it was not in the DDK source code. I would think that for the time being AN delivers the original USBMSD.ADD from IBM (version 10.162 I think that was).

Roughly spoken, if you don't need USB audio support (because you have a working UNIAUD for example) and if you are happy with the original USDMSD.ADD then you might as well use the AN drivers.

Lars


Lars

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 20
  • Posts: 143
    • View Profile
Re: recent developments for USB audio
« Reply #12 on: May 16, 2017, 11:30:00 am »
I have installed this on my new laptop, and sound does work. For those who want to try.

1. If uniaud is installed, uninstall it. Use uninstal.exe from an older uniaud release to remove it. uninstal.exe is not in more recent releases. reboot.
2. install USB 10.217. reboot
3. install usbaudio and usbwav using minstall. reboot

At this point, sound worked for me. I'm using the Trond device https://www.newegg.com/Product/Product.aspx?Item=9SIA8583987106 I still see some drop outs, and lost frames/stopped video on YouTube. The sound is pretty good.

For the thread on the laptop, see http://www.os2world.com/forum/index.php/topic,1160.0.html

It would be interesting to know if These dropouts also occur with UNIAUD. I seem to remember that you still see the same Problem. I guess the DART subsystem (libkai uses DART) cannot keep up with the replay speed of the video (loss of synchronization).
One important thing: set the environment variable KAI_AUTOMODE=DART.
At least setting KAI_AUTOMODE=UNIAUD never worked for me.