Opened 2 years ago

Closed 2 years ago

#95 closed defect (fixed)

Extremely low volume with UAC2 device

Reported by: David McKenna Owned by: Lars Erdmann
Priority: major Component: USBAUDIO
Version: 10.244 Keywords:
Cc:

Description

I have a Behringer UMC202HD USB audio 2.0 device that only produces sound if I turn it up all the way and turn up OS/2 system volume past 50%. This is with the recent builds of USBAUD2.SYS (currently SVN2371). With the version from the USB package 10.244, sound volume is fine (although only works with USB2).

I am using the recent 12.14 test USB drivers from ArcaNoae.

Attachments (13)

usbaudio_SVN2371.zip (96.1 KB ) - added by Lars Erdmann 2 years ago.
checking for "Clock Valid" up to 10 times before sampling frequency is set
usbaudio_SVN2372.zip (96.1 KB ) - added by Lars Erdmann 2 years ago.
whenever a thread is woken up from blocking, boost its priority
usbaudio_SVN2374.zip (96.4 KB ) - added by Lars Erdmann 2 years ago.
spinlock protect access to global SetupPacket array
svn2374-usb3.zip (167.1 KB ) - added by David McKenna 2 years ago.
usbaudio_SVN2376.zip (96.4 KB ) - added by Lars Erdmann 2 years ago.
start streaming enpoint first, then start feedback endpoint (idea 3)
usbaudio_SVN2377.zip (96.4 KB ) - added by Lars Erdmann 2 years ago.
set unit control asynchronously, do not block
svn2376-usb3.zip (169.4 KB ) - added by David McKenna 2 years ago.
svn2377-usb3.zip (167.9 KB ) - added by David McKenna 2 years ago.
usbaudio_SVN2382.zip (95.5 KB ) - added by Lars Erdmann 2 years ago.
set volume/bass/treble from individual channels to master channel
svn2382-usb3.zip (170.5 KB ) - added by David McKenna 2 years ago.
MMPM2.INI (6.6 KB ) - added by David McKenna 2 years ago.
usbaudio_SVN2383.zip (95.6 KB ) - added by Lars Erdmann 2 years ago.
change volume/bass/treble to logarithmic scaling
usbaudio_SVN2388.zip (95.6 KB ) - added by Lars Erdmann 2 years ago.
applying balance setting to individual channels

Download all attachments as: .zip

Change History (40)

comment:1 by Lars Erdmann, 2 years ago

Component: basedrvUSBAUDIO

by Lars Erdmann, 2 years ago

Attachment: usbaudio_SVN2371.zip added

checking for "Clock Valid" up to 10 times before sampling frequency is set

comment:2 by Lars Erdmann, 2 years ago

https://youtu.be/QmyVOwtXtJIhttps://www.sweetwater.com/sweetcare/articles/behringer-audio-interface-setup-guide/

SW / firmware update: ​https://www.behringer.com/downloads.html

David, the Behringer USB device offers firmware update via USB. If you have Windows, I`d go and install the latest drivers. My hope would be that that will also lead to a firmware update.

Last edited 2 years ago by Lars Erdmann (previous) (diff)

by Lars Erdmann, 2 years ago

Attachment: usbaudio_SVN2372.zip added

whenever a thread is woken up from blocking, boost its priority

comment:3 by Lars Erdmann, 2 years ago

Owner: set to Lars Erdmann
Status: newassigned

comment:4 by David McKenna, 2 years ago

Lars,

I installed the new Behringer driver in Windows 10 on this computer - didn't say anything specifically about a firmware update but the unit was plugged in when I updated. It works well in Windows.

No change with SVN2372 - sound works with both USB3 and USB2, but I must turn the unit up all the way and system volume past 50% to hear anything.

comment:5 by Lars Erdmann, 2 years ago

Hallo David,

to be honest, the only way I see a possibility to fix this problem is for you to send the device to me and I will send it back when I found a solution (or not found a solution ...).
Unfortunately, that device costs 80 some $ and that is too much for me to invest just for debugging purposes.

I currently have no clue of why volume setting would not work. From what I can see in the trace, the volume is programmed correctly and the driver works perfectly with my own audio 2.0 device.

How are you using the device ? It does not have a speaker. Do you use it with headphones ? What application are you using to play a sound ? If you use PM123, have you ensured that the PM123 volume is set to maximum ? What other controls (HW knobs, whatever) exist and would influence volume ? Do you have headphones that have an integrated HW volume control in the cable ?

One difference between your device and mine is, that my audio device only supports master channel setting (that is, the common setting for all channels) while your device supports master channel setting plus individual settings for left and right channel.
The odd thing is, that initially, I had changed nothing of the code in 10.244 regarding volume setting. I cannot understand why it won`t work now.

Last edited 2 years ago by Lars Erdmann (previous) (diff)

by Lars Erdmann, 2 years ago

Attachment: usbaudio_SVN2374.zip added

spinlock protect access to global SetupPacket array

comment:6 by Lars Erdmann, 2 years ago

Please try out and take trace.

comment:7 by David McKenna, 2 years ago

Lars,

Tried SVN2374 - same result as 2372, both USB2 and USB3 work with reduced volume. I'll attach the trace.

Just to be sure, I tried using the files from 10.244 again and indeed on the USB2 port it works with normal volume.

I use headphones (no volume control on them) with the Behringer turned all the way up and PM123 turned all the way up. System volume ends up around 65-70%. With 10.244, system volume stays at 50% (where it normally is for system sounds), the Behringer at ~50% and PM123 turned all the way up.

I really appreciate whet you have done with this driver and understand if you are tired of working on it - it is after all usable as-is. I don't see any sense in sending you my unit, but I am willing to purchase one for you if you really think it will help (and you want one :-). Contact me at davidmckenna -at- comcast -dot- net if that can work.

by David McKenna, 2 years ago

Attachment: svn2374-usb3.zip added

comment:8 by Lars Erdmann, 2 years ago

Hi David,

I have 2 new ideas:

1) your device cannot only set master volume but also individual per-channel (left/right) volume. Maybe as a "largest common denominator" I can change the driver to ONLY set the master volume and leave the per-channel setting untouched (normally, all volume settings are cranked up to the maximum as a default). I`ll try this first.

2) found this: https://lkml.kernel.org/stable/20220815180429.656661393@linuxfoundation.org/raw

It talks about a Linux "quirk" flag QUIRK_FLAG_PLAYBACK_FIRST for the UMC202HD device.
I cannot find documented what exactly that quirk flag is for, but I am beginning to suspect that maybe that means that the stream has to start playing/recording BEFORE you do volume or other settings.
Unfortunately, the OS/2 MMPM subsystem asks for setting of volume/bass/treble/balance/gain before a stream is actually started.
That makes sense (you don't want to blare out with max. volume just because you don't know what volume setting the user wants) but maybe the Behringer does not like that. Maybe it needs a few samples taken to measure noise floor,whatever.
I'll add some code that delays any such setting request until a stream has actually started playing. Let's see if I can get that done.

Last edited 2 years ago by Lars Erdmann (previous) (diff)

comment:9 by Lars Erdmann, 2 years ago

Forgot: can you try the lasest usb audio driver with MY USB driver set under USB2 ?

I just want to see if the rest of the USB stack (the AN drivers) have a repercussion on the problem.

comment:10 by Lars Erdmann, 2 years ago

Another idea (note to myself):

3) https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/sound/usb/usbaudio.h?id=f443e374ae131c168a065ea1748feac6b2e76613#n127

QUIRK_FLAG_PLAYBACK_FIRST: Potentially, the stream has to start playing BEFORE starting listening on the feedback endpoint.

http://trac.netlabs.org/usb/browser/basedrv/branches/lars/usbaud2/audiodd.c, "StartProcessing":
reverse calling "ISOGetFeedback" and "ISOSendBuffer"

Last edited 2 years ago by Lars Erdmann (previous) (diff)

by Lars Erdmann, 2 years ago

Attachment: usbaudio_SVN2376.zip added

start streaming enpoint first, then start feedback endpoint (idea 3)

comment:11 by Lars Erdmann, 2 years ago

Try usbaudio_SVN2376.zip. Take trace.

by Lars Erdmann, 2 years ago

Attachment: usbaudio_SVN2377.zip added

set unit control asynchronously, do not block

comment:12 by Lars Erdmann, 2 years ago

Then, try usbaudio_SVN2377.zip. Take trace.

comment:13 by David McKenna, 2 years ago

Lars,

I tried your usb driver set (10.244) with the svn2374 UAC2 driver on a USB2 port and it works, but low volume. Put in the UAC2 driver from 10.244, and volume is 'normal'.

Put back the AN 12.14 test usb drivers and installed svn2376. Low volume on both USB2 and USB3. svn2376-usb3.zip

Tried svn2377 UAC2 driver - also low volume. svn2377-usb3.zip

Last edited 2 years ago by David McKenna (previous) (diff)

by David McKenna, 2 years ago

Attachment: svn2376-usb3.zip added

by David McKenna, 2 years ago

Attachment: svn2377-usb3.zip added

by Lars Erdmann, 2 years ago

Attachment: usbaudio_SVN2382.zip added

set volume/bass/treble from individual channels to master channel

comment:14 by Lars Erdmann, 2 years ago

Try usbaudio_SVN2382.zip. Take trace.

comment:15 by Lars Erdmann, 2 years ago

Can you also attach your current MMPM2.INI ?

comment:16 by David McKenna, 2 years ago

This one is a little different in that I have to turn up system volume past 75% to hear anything (like earlier builds). svn2382-usb3.zip. I'll also upload my MMPM2.INI.

Last edited 2 years ago by David McKenna (previous) (diff)

by David McKenna, 2 years ago

Attachment: svn2382-usb3.zip added

by David McKenna, 2 years ago

Attachment: MMPM2.INI added

comment:17 by Lars Erdmann, 2 years ago

What you are describing proves that all volume controls do work and the observation could also be expected. Just like in 10.244, for SVN2382 I am setting master Volume and individual channel volumes to the very same value, which means if you crank up volume to 80% you will end up with a combined value (for an individual channel) of 64%. So you will need to increase master volume to hear anything.
What drives me crazy is that you said that in 10.244 it was much louder overall.

Also I see in your MMPM2.INI that default device is set to UNIAUD.
Can you change that to the USB audio 2 driver? You can either use my defdev.dll (default device applet) or set it manually.

Last edited 2 years ago by Lars Erdmann (previous) (diff)

comment:18 by Lars Erdmann, 2 years ago

To install my default device applet, just dump USBAUDIO.zip into a temporary dir and run "minstall /*". It will offer you installation of the applet, so confirm that with yes.

That will get you a new page in the Multimedia Object from where you can set the default device.

comment:19 by Lars Erdmann, 2 years ago

... or you can set it manually. In MMPM2.INI, in section [defaultnames], change to:

 Waveaudio=WMBWAVE2USB01
 Ampmix=WMBAMPMIX2USB01

comment:20 by Lars Erdmann, 2 years ago

Forgot to ask: is there a sufficiently loud volume if you crank up EVERYTHING to 100 % ?

I am beginning to understand: the MMPM/2 subsystem passes the volume as a linear value:
max val = max volume
half val = half of volume
0 = silent

However, the USB volume control is defined as a logarithmic value (in dB attenuation from some reference value) and that is also how the human listening works.

In short, to have some decent volume when the volume is turned low, that linear value needs to be recomputed into a logarithmic value. That will increase the value for small input values and will decrease the value for high input values. I`ll try that next. However, that will only help if the MAXIMUM volume at least leads to very loud output: a little from nothing is still nothing ...

comment:21 by David McKenna, 2 years ago

Lars,

You might be on to something... turning the system volume all the way up when using the UAC2 device was far too loud to listen to, and seemed about as loud as UniAud when turned all the way up. So the linear vs. logarithmic idea fits the evidence.

I added the default device switcher and it works, but has no impact on the volume of the UAC2 device - still have to turn the system volume up past 75% to hear it.

comment:22 by Lars Erdmann, 2 years ago

ok, I just hacked a linear to logarithmic rescaling and that goes into the proper direction. Still need to find the proper formula, it almost blew my ears away when I cranked it up to 20% ...

by Lars Erdmann, 2 years ago

Attachment: usbaudio_SVN2383.zip added

change volume/bass/treble to logarithmic scaling

comment:23 by Lars Erdmann, 2 years ago

Hi David,

try usbaudio_SVN2383.zip. That now uses logarithmic scaling instead of linear scaling for volume/bass/treble setting. There should be a fairly massive increase of volume from 0% to 40%, it should already be pretty loud at 50% and then slowly diminishing in effect up to 100%.

What I still need to do for your device is to only set master setting to the volume control value, but to set individual channels to max value. But nonetheless, the logarithmic increase should already have a significant effect.

Last edited 2 years ago by Lars Erdmann (previous) (diff)

comment:24 by David McKenna, 2 years ago

Lars,

Wow - thanks! This works just as you say... it seems to have a 'normal' increase from 0 - 100, instaed of nothing until 50%, then increasing to 100. Fantastic work!

by Lars Erdmann, 2 years ago

Attachment: usbaudio_SVN2388.zip added

applying balance setting to individual channels

comment:25 by Lars Erdmann, 2 years ago

Hi David,

good to hear ! By now, I am also applying the balancing setting to the individual "left" and "right" channels that the Behringer device supports.

You can test this way: in MMPM2.INI find for the UAC2 device the "BALANCE=50" line. Modify that to say "BALANCE=10" for emphasis on left channel or to say "BALANCE=90" for emphasis on right channel.

You should then hear left and right channels with different volume.

If everything works ok, I'd close the bug.

Version 0, edited 2 years ago by Lars Erdmann (next)

comment:26 by David McKenna, 2 years ago

Lars,

SVN2388 is perfect. I tried the balance thing and that works too - would be great if the system volume could be enhanced with a balance slider. Always wondered why it didn't have that - I guess stereo was still a novelty when Warp came out... :-).

comment:27 by David McKenna, 2 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.