Author Topic: Can aswitch.exe be used for always connected/attached usb speakers?  (Read 7998 times)

Pete

  • Hero Member
  • *****
  • Posts: 1343
  • Karma: +11/-0
    • View Profile
Re: Can aswitch.exe be used for always connected/attached usb speakers?
« Reply #15 on: October 04, 2024, 11:04:54 pm »
Hi Lars

I used the Programs -> Multimedia -> Multimedia Installer to select and Install both the Enhanced USB Audio packages from the ArcaOS5.1 iso file, mmpm2.ini looks fine with sections for WMBWAVEUSB01, WMBWAVE2USB01 and
[defaultnames]
 Waveaudio=WMBWAVEUSB01
 Ampmix=WMBAMPMIXUSB01


The lsusb output for this soundbar:-

Bus 002 Device 002: ID 413c:a510 Dell Computer Corp.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x413c Dell Computer Corp.
  idProduct          0xa510
  bcdDevice            2.06
  iManufacturer           3
  iProduct                1
  iSerial                 2
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0080
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          4 DELL Slim Soundbar SB521A
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      1 Control Device
      bInterfaceProtocol      0
      iInterface              6 DELL Slim Soundbar SB521A
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               1.00
        wTotalLength       0x003a
        bInCollection           1
        baInterfaceNr(0)        1
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID            14
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bNrChannels             2
        wChannelConfig     0x0003
          Left Front (L)
          Right Front (R)
        iChannelNames           0
        iTerminal              18 Speaker
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID            15
        wTerminalType      0x0301 Speaker
        bAssocTerminal         14
        bSourceID               4
        iTerminal               0
      AudioControl Interface Descriptor:
        bLength                13
        bDescriptorType        36
        bDescriptorSubtype      6 (FEATURE_UNIT)
        bUnitID                16
        bSourceID              14
        bControlSize            2
        bmaControls(0)     0x0003
          Mute Control
          Volume Control
        bmaControls(1)     0x0000
        bmaControls(2)     0x0000
        iFeature                0
      AudioControl Interface Descriptor:
        bLength                15
        bDescriptorType        36
        bDescriptorSubtype      8 (EXTENSION_UNIT)
        bUnitID                 4
        wExtensionCode     0x0bda
        bNrInPins               1
        baSourceID(0)          16
        bNrChannels             2
        wChannelConfig     0x0003
          Left Front (L)
          Right Front (R)
        iChannelNames           0
        bControlSize            1
        bmControls(0)        0x01
        iExtension              0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0
      iInterface              0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           1
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0
      iInterface              0
      AudioStreaming Interface Descriptor:
        bLength                 7
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink          14
        bDelay                  1 frames
        wFormatTag         0x0001 PCM
      AudioStreaming Interface Descriptor:
        bLength                11
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bNrChannels             2
        bSubframeSize           3
        bBitResolution         24
        bSamFreqType            1 Discrete
        tSamFreq[ 0]        48000
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x07  EP 7 OUT
        bmAttributes            9
          Transfer Type            Isochronous
          Synch Type               Adaptive
          Usage Type               Data
        wMaxPacketSize     0x0150  1x 336 bytes
        bInterval               4
        bRefresh                0
        bSynchAddress           0
        AudioStreaming Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x01
            Sampling Frequency
          bLockDelayUnits         0 Undefined
          wLockDelay         0x0000
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass          239 Miscellaneous Device
  bDeviceSubClass         2 ?
  bDeviceProtocol         1 Interface Association
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0000
  (Bus Powered)


Regards

Pete

Lars

  • Hero Member
  • *****
  • Posts: 1361
  • Karma: +70/-0
    • View Profile
Re: Can aswitch.exe be used for always connected/attached usb speakers?
« Reply #16 on: October 05, 2024, 09:08:54 am »
The audio control interface header says bcdADC = 1 so it's a class 1 device. You will need USBAUDIO.SYS.
If you post the complete MMPM2.INI I would be able to say if the install is complete. As I mentioned, not only the drivers need to be installed.
And as Rich said, you should use the "enhanced" package.
If you can hear sound at all, you should check if setting the volume works (it should). If the sound stops playing prematurely, try with a USB 2.x only port (a port connector not colored in blue) if you can find that on this PC or another. If that works without a problem, then I suspect that USB isochronous transfers do not work properly with USB 3.0 (USBXHCD.SYS).
The iso endpoint is of type "adaptive". I don't know if that's what my USB audio device uses. Ill need to check. Maybe that type needs special treatment not yet implemented.
By the way, UNIAUD and the on-board sound support have nothing to do with/no impact when using that soundbar. The audio HW is all contained in that soundbar. The audio HW itself only supports a sample rate of 48 kHz but USBAUDIO.SYS contains rate conversion to/from quite a few other standard sample rates.
« Last Edit: October 05, 2024, 09:30:51 am by Lars »

Pete

  • Hero Member
  • *****
  • Posts: 1343
  • Karma: +11/-0
    • View Profile
Re: Can aswitch.exe be used for always connected/attached usb speakers?
« Reply #17 on: October 06, 2024, 06:19:57 pm »
Hi Lars

Thanks for looking into this for me.

The MMPM2.INI file is attached as MMPM2.INI.txt for your perusal.

Current results with the Enhanced USB Audio packages installed is no sound output regardless of whether the soundbar is plugged into a usb3 or usb2 port. Opening System Setup -> Sound I can select a sound but clicking Play results in no noise.


Possibly of interest - simply because it shows sound should be possible:
If I delete the usbaudio.sys file and replace it with the version from USBAUDIO-12.16.exe following a reboot the Startup sound plays but does not complete and attempting to play any other sound results in various noises, system sounds play like they are "speeded up" and get worse with every attempt - timing problem maybe?

I rebooted with the soundbar plugged into a usb2 port. Startup sound does not complete, System Setup -> Sound plays the selected sound but Volume is stuck on 100% ie lowering the volume does not lower volume of sound.
I tried Klondike Solitaire which played a "dealing sound" for the 1st card then displayed "No connection found" for the rest, then hung until closed, Mahjongg works on 1st tile selected but displays "No connection found" when clicking on a matching tile then simply does not play sound or display the message again for further tile clicks - at least it does not hang.
Sound does not work in dosbox.
Sound does work with mplayer and vlc/2 - and volume control works with both apps.


So, with the Enhanced USB Audio packages installed but the usbaudio.sys file replaced by the usbaudio.sys file from USBAUDIO-12.16.exe we have some success.

However, if I Uninstall the Enhanced USB Audio packages and Install the USBAUDIO-12.16.exe files properly after a reboot there is no sound from either usb2 or usb3 ports with USB Wave selected.


Regards

Pete


Rich Walsh

  • Sr. Member
  • ****
  • Posts: 357
  • Karma: +24/-0
  • ONU! (OS/2 is NOT Unix!)
    • View Profile
Re: Can aswitch.exe be used for always connected/attached usb speakers?
« Reply #18 on: October 07, 2024, 05:09:53 am »
I notice that the USB interface descriptor for the speaker specifies a 48000 sample rate but under [WMBWAVEUSB01], it's configured for 44100:
 PARMSTRING=FORMAT=1,SAMPRATE=44100,BPS=16,CHANNELS=2,DIRECTION=PLAY

You may want to try changing SAMPRATE to 48000. After doing so, do NOT open MMSetup (stpm.exe) before you reboot - it always rewrites MMPM2.INI with the values currently in memory, wiping out any manual changes.

Lars

  • Hero Member
  • *****
  • Posts: 1361
  • Karma: +70/-0
    • View Profile
Re: Can aswitch.exe be used for always connected/attached usb speakers?
« Reply #19 on: October 07, 2024, 09:25:39 am »
That setting is mostly irrelevant. AMPMXMCD.DLL (or was it USBAUDIF.DLL ?) reads it but effectively never uses it (it just uses these settings as a first/inital check if that sample rate/number of channels/data format/replay capability is supported but won't fail for good if not).
« Last Edit: October 07, 2024, 09:28:28 am by Lars »

Lars

  • Hero Member
  • *****
  • Posts: 1361
  • Karma: +70/-0
    • View Profile
Re: Can aswitch.exe be used for always connected/attached usb speakers?
« Reply #20 on: October 07, 2024, 09:29:52 am »
I'll prepare a new USBDRVxxx.zip. Then you can pull the audio stuff from it and replace with that.
I do not know exactly what version AN delivered.

For the time being, pull the audio stuff from this package:
https://trac.netlabs.org/usb/raw-attachment/ticket/96/usbdrv251_2024_08_04.zip
« Last Edit: October 07, 2024, 09:34:26 am by Lars »

Lars

  • Hero Member
  • *****
  • Posts: 1361
  • Karma: +70/-0
    • View Profile
Re: Can aswitch.exe be used for always connected/attached usb speakers?
« Reply #21 on: October 07, 2024, 09:48:37 am »
I rebooted with the soundbar plugged into a usb2 port. Startup sound does not complete, System Setup -> Sound plays the selected sound but Volume is stuck on 100% ie lowering the volume does not lower volume of sound.

Pete

I remember that there was this sound fix that needed to be added to config.sys so that startup sounds will play. Do you have that in config.sys ?

RUN=C:\MMOS2\mmfix.exe
« Last Edit: October 07, 2024, 10:05:20 am by Lars »

Pete

  • Hero Member
  • *****
  • Posts: 1343
  • Karma: +11/-0
    • View Profile
Re: Can aswitch.exe be used for always connected/attached usb speakers?
« Reply #22 on: October 09, 2024, 01:39:44 am »
Hi Lars

The AN build is

 ::::::@@USB Audio Driver (c) 2024 Arca Noae LLC
Vendor:          Arca Noae LLC
Revision:        12.16
Date/Time:       15 Jul 2024 12:50:13


Progress report on soundbar and your latest USB audio packages:-

I uninstalled both USB Enhanced packages and the AN driver.

Installed the audio packages from usbdrv251_2024_08_04.zip

Rebooted with soundbar plugged into a usb3 port which had the same sort of results as when trying the AN driver package - startup sound did not complete and other system sounds were wrong.

Plugging the soundbar into a usb2 port (via usb2 extension lead) results in sound working properly - except startup sound which I discovered over several reboots sometimes plays OK but usually it is truncated. Yes, the mmfix.exe line is in config.sys.

System sounds play OK, volume adjustments work OK in both Sound and Volume apps

Sound seems to be working well with the apps I have tried: vlc/2, (s)mplayer, "os/2 games"

Sound no longer works from dos games running in dosbox which "fakes" a soundblaster (sb16) for dos games to use which has always worked well when using the uniaud driver.
Anyone know if dos games can output sound in a standard (os/2 supplied/installed) dos environment using a usb soundbar? - don't have dos/win16 installed here.


So, happy to report your latest usb audio driver packages work well when usb soundbar is plugged into a usb2 port except for the startup sound. Not sure if sound from dos games running in dosbox should work with the usb soundbar and driver packages...


Thanks

Pete


Dave Yeo

  • Hero Member
  • *****
  • Posts: 5029
  • Karma: +113/-1
    • View Profile
Re: Can aswitch.exe be used for always connected/attached usb speakers?
« Reply #23 on: October 09, 2024, 02:44:54 am »
Hi Pete, as far as I know, no sound in DOS now a days, hasn't been since basically ISA days.
Does DosBox give you any other sound driver choices? If so, try them.
At least sound is now working for you, shame only on USB2, which is getting rare in computers. I know I only have USB3 on this box.
You could consider opening an issue with Arca Noae, sounds like their USB sound could be updated and who knows, perhaps USB3 could be fixed.

Lars

  • Hero Member
  • *****
  • Posts: 1361
  • Karma: +70/-0
    • View Profile
Re: Can aswitch.exe be used for always connected/attached usb speakers?
« Reply #24 on: October 09, 2024, 02:04:35 pm »
Hi Pete, as far as I know, no sound in DOS now a days, hasn't been since basically ISA days.
Does DosBox give you any other sound driver choices? If so, try them.
At least sound is now working for you, shame only on USB2, which is getting rare in computers. I know I only have USB3 on this box.
You could consider opening an issue with Arca Noae, sounds like their USB sound could be updated and who knows, perhaps USB3 could be fixed.

AN did fixes to USB isochronous audio with 12.16 (I am talking about USBXHCD.SYS). However, it seems that there is enough of a difference between for example Intel chipsets (and their USB 3.x support) and other chipsets (and their USB 3.x support) that sometimes isochronous audio (at least replay) works decently well for Intel but still won't work for those others.

Look here: https://trac.netlabs.org/usb/ticket/96

I don't think that this can be solved in USBAUDIO.SYS / USBAUD2.SYS. This is something that needs to be fixed in the USBXHCD.SYS as seemingly USB 2.x works ok (with the very same USB audio drivers). But I think USB audio has no priority for AN (an industry customer won't care for sure).

DOS box sound support: I have no clue of how audio gets passed over from DOS to the native OS/2 sound driver. It is possible that DOS will only ever use the very first sound device listed in MMPM2.INI (I am just guessing).
In that case, what you could do is change the sequence of devices in this section of MMPM2.INI:

[Drivers]
 Digitalvideo=IBMDIGVIDPLAYER01,IBMMPEGPLAYER01
 Speaker=SPEAKER
 Headphone=HEADPHONE
 Microphone=MICROPHONE
 Filter=IBMFILTER01,IBMFILTER02,IBMFILTER03
 Waveaudio=UNIAUDWAVE01,WMBWAVEUSB01,WMBWAVE2USB01
 Ampmix=UNIAUDAMPMIX01,WMBAMPMIXUSB01,WMBAMPMIX2USB01
 CDaudio=IBMCDAUDIO01,IBMCDAUDIO02
 Sequencer=

What you could try is to change that to:
[Drivers]
 Digitalvideo=IBMDIGVIDPLAYER01,IBMMPEGPLAYER01
 Speaker=SPEAKER
 Headphone=HEADPHONE
 Microphone=MICROPHONE
 Filter=IBMFILTER01,IBMFILTER02,IBMFILTER03
 Waveaudio=WMBWAVEUSB01,UNIAUDWAVE01,WMBWAVE2USB01
 Ampmix=WMBAMPMIXUSB01,UNIAUDAMPMIX01,WMBAMPMIX2USB01
 CDaudio=IBMCDAUDIO01,IBMCDAUDIO02
 Sequencer=

but as I said this is just guessing.



« Last Edit: October 09, 2024, 02:09:01 pm by Lars »

Lars

  • Hero Member
  • *****
  • Posts: 1361
  • Karma: +70/-0
    • View Profile
Re: Can aswitch.exe be used for always connected/attached usb speakers?
« Reply #25 on: October 11, 2024, 05:52:55 pm »
Pete, can you tell me if my proposition helped?
If not, I would have another idea but that would mean to update the drivers and I would need a "guinea pig" to test...

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5029
  • Karma: +113/-1
    • View Profile
Re: Can aswitch.exe be used for always connected/attached usb speakers?
« Reply #26 on: October 11, 2024, 06:12:02 pm »
Hi Lars. Dosbox is an emulator, uses SDL or SDL2 for video, sound etc to emulate a DOS environment, so nothing to do with a DOS VDM.

Pete

  • Hero Member
  • *****
  • Posts: 1343
  • Karma: +11/-0
    • View Profile
Re: Can aswitch.exe be used for always connected/attached usb speakers?
« Reply #27 on: October 11, 2024, 11:43:52 pm »
Hi Lars

I tried the mmpm2.ini change you suggested but, sorry to say, it made no difference.

Happy to do the "guinea pig" bit but, as Dave says, dosbox is not a dos vdm which may make you rethink your idea(s).

I have emailed Jochen - dosbox porter - to get his input but I think dosbox "fakes" a soundcard then routes any sound to the host os sound driver for processing. Hopefully Jochen will clarify the way it works.


@Dave
Still have my last ISA soundcard boxed somewhere: AWE32 P'n'P which I seem to recall had drivers/software for DOS, Win16/95 and OS/2 - including midi - and worked very well.
The end of ISA was when I stopped bothering installing DOS/Win16 support - only needed it to play a few games which play better with sound support - dosbox and uniaud to the rescue  :-)


Regards

Pete



Dave Yeo

  • Hero Member
  • *****
  • Posts: 5029
  • Karma: +113/-1
    • View Profile
Re: Can aswitch.exe be used for always connected/attached usb speakers?
« Reply #28 on: October 12, 2024, 01:27:21 am »

@Dave
Still have my last ISA soundcard boxed somewhere: AWE32 P'n'P which I seem to recall had drivers/software for DOS, Win16/95 and OS/2 - including midi - and worked very well.
The end of ISA was when I stopped bothering installing DOS/Win16 support - only needed it to play a few games which play better with sound support - dosbox and uniaud to the rescue  :-)


Yes I still have my ProAudio Spectrum card laying around, which worked very well under OS/2 and DOS, it included a Sound Blaster clone so it was like having 2 sound cards, one for WinOS2 and one for OS/2. Also the odd game like Simcity2000 (DOS version) could use both.
Like you, once ISA went away I didn't play many DOS games though I did have a MB (Athlon) where the BIOS emulated a sound driver along with the included OS/2 sound driver. That was the last MB I had that had any OS/2 drivers.
Wish there was a cheap simple adapter so could still use an ISA card.

Lars

  • Hero Member
  • *****
  • Posts: 1361
  • Karma: +70/-0
    • View Profile
Re: Can aswitch.exe be used for always connected/attached usb speakers?
« Reply #29 on: October 12, 2024, 09:18:45 am »
Hi Lars. Dosbox is an emulator, uses SDL or SDL2 for video, sound etc to emulate a DOS environment, so nothing to do with a DOS VDM.

That is really odd. I helped Jochen to implement correct default device selection and also recording capability in SDL2. And I used the SDL2 test programs and they worked ok. Maybe that did not make it into the SDL2 provided by BWW?

From SDL2 I know that it uses DART. But that should work just fine with the USB audio drivers. At least it does here.