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

Download all attachments as: .zip

Change History (40)

comment:1 Changed 19 months ago by Lars Erdmann

Component: basedrvUSBAUDIO

Changed 19 months ago by Lars Erdmann

Attachment: usbaudio_SVN2371.zip added

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

comment:2 Changed 19 months ago by Lars Erdmann

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 19 months ago by Lars Erdmann (previous) (diff)

Changed 19 months ago by Lars Erdmann

Attachment: usbaudio_SVN2372.zip added

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

comment:3 Changed 19 months ago by Lars Erdmann

Owner: set to Lars Erdmann
Status: newassigned

comment:4 Changed 19 months ago by David McKenna

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 Changed 19 months ago by Lars Erdmann

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 19 months ago by Lars Erdmann (previous) (diff)

Changed 19 months ago by Lars Erdmann

Attachment: usbaudio_SVN2374.zip added

spinlock protect access to global SetupPacket? array

comment:6 Changed 19 months ago by Lars Erdmann

Please try out and take trace.

comment:7 Changed 19 months ago by David McKenna

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.

Changed 19 months ago by David McKenna

Attachment: svn2374-usb3.zip added

comment:8 Changed 19 months ago by Lars Erdmann

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 19 months ago by Lars Erdmann (previous) (diff)

comment:9 Changed 19 months ago by Lars Erdmann

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 Changed 19 months ago by Lars Erdmann

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 19 months ago by Lars Erdmann (previous) (diff)

Changed 19 months ago by Lars Erdmann

Attachment: usbaudio_SVN2376.zip added

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

comment:11 Changed 19 months ago by Lars Erdmann

Try usbaudio_SVN2376.zip. Take trace.

Changed 19 months ago by Lars Erdmann

Attachment: usbaudio_SVN2377.zip added

set unit control asynchronously, do not block

comment:12 Changed 19 months ago by Lars Erdmann

Then, try usbaudio_SVN2377.zip. Take trace.

comment:13 Changed 19 months ago by David McKenna

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 19 months ago by David McKenna (previous) (diff)

Changed 19 months ago by David McKenna

Attachment: svn2376-usb3.zip added

Changed 19 months ago by David McKenna

Attachment: svn2377-usb3.zip added

Changed 19 months ago by Lars Erdmann

Attachment: usbaudio_SVN2382.zip added

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

comment:14 Changed 19 months ago by Lars Erdmann

Try usbaudio_SVN2382.zip. Take trace.

comment:15 Changed 19 months ago by Lars Erdmann

Can you also attach your current MMPM2.INI ?

comment:16 Changed 19 months ago by David McKenna

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 19 months ago by David McKenna (previous) (diff)

Changed 19 months ago by David McKenna

Attachment: svn2382-usb3.zip added

Changed 19 months ago by David McKenna

Attachment: MMPM2.INI added

comment:17 Changed 19 months ago by Lars Erdmann

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 19 months ago by Lars Erdmann (previous) (diff)

comment:18 Changed 19 months ago by Lars Erdmann

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 Changed 19 months ago by Lars Erdmann

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

 Waveaudio=WMBWAVE2USB01
 Ampmix=WMBAMPMIX2USB01

comment:20 Changed 19 months ago by Lars Erdmann

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 Changed 19 months ago by David McKenna

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 Changed 19 months ago by Lars Erdmann

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% ...

Changed 19 months ago by Lars Erdmann

Attachment: usbaudio_SVN2383.zip added

change volume/bass/treble to logarithmic scaling

comment:23 Changed 19 months ago by Lars Erdmann

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 19 months ago by Lars Erdmann (previous) (diff)

comment:24 Changed 19 months ago by David McKenna

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!

Changed 19 months ago by Lars Erdmann

Attachment: usbaudio_SVN2388.zip added

applying balance setting to individual channels

comment:25 Changed 19 months ago by Lars Erdmann

Hi David,

good to hear ! Thanks !

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.
Of course, what it would take is a GUI that can modify the balance value. That GUI is not yet written but would be easy to write. I thought it would be handy if the driver supported that.

You should then hear left and right channels with different volume. The volume knob will still go against the master channel and therefore remains to be the overall volume control.

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

Last edited 19 months ago by Lars Erdmann (previous) (diff)

comment:26 Changed 19 months ago by David McKenna

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 Changed 19 months ago by David McKenna

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