Volume control (digital attenuator) for USB

That is 0.1% clock difference is no problem when both have analog in/out.
The same difference in digital domain is costly regards to computer power to mittigate.
Can also be mitigated with the right master slave configuration inside the box but in reality not all spdif in/out boxes are configured the «right» way
 
Yes, yesterday I confirmed Pano's observation. My loudest to softest listening is about 15 dB. And when music is just soft background, no need to achieve great sound quality.

So an attenuator in the digital line between the laptop source and the Behringer DSP would not lose enough digits to fret about. For loud music, all the digits are used (call it "full bandwidth"). But back to the question how to attenuate near my chair?

As torgeirs has posted, I now think Raspberry Pi kit makes DIY sense, if I have the perseverance to program it. There are off-the-shelf alternatives but rather expensive for my liking.

B.
 
Last edited:
BMC-2, again price and feature over-kill. But it does offer SPDIF/coax input and output.

But Amazon does list a variety of inexpensive gizmos with remotes that does similar tasks. Having a remote hand control would be a great feature. Except I haven't yet found one that has the right set of inputs and outputs for me.

My music (and REW) source is USB output. I'm keen to stick to digital and therefore use the Behringer DSP with AES (AKA SPDIF/coax) input. For now, there's a USB to SPDIF/coax converter in them middle.

So a good variable attenuator device (with a remote, if possible) could have:

USB to SPDIF/coax
USB to USB
SPDIF/coax to SPDIF/coax
or
SPDIF/fiber to SPDIF/coax

Anybody know one?
Thanks.
B.
 
Last edited:
Rummaging about yesterday, I found an IR remote control for my 2010 MacBook laptop - soon to become my dedicated music computer. How nice!

It controls the volume on my FileMaker DB music server, QuickTime, etc. Great solution?

Unfortunately, this nice remote works no differently than the inherent Mac OS in that it obeys the current dictate of not tampering with the loudness of devices connected by USB. So it does not (yet) control the loudness of the USB feed to my SPDIF/coax converter.

So, as much as I hesitate to install apps that are disdained by Apple Corp (such as those kindly named in this thread).... would some of those apps likely work with this IR remote?

(BTW, as an Apple user since 1979, I am cautious about installing and removing apps just to experiment, esp those not from the Apple wagon. So, I'd like opinions first, please.

B.
 
Last edited:
miniDSP SHD Studio is a good option although if you don't need Dirac it is rather expensive.

I also like the CamillaDSP option, I haven't built anything with a knob but I do have working remote control via a FLIRC USB IR receiver and have also programmed a small OLED display to work with CamillaDSP. You can change the volume via the CamillaDSP GUI on your phone or use the remote and both update the display. Would be more than happy to share my code if you are interested.

Michael
 

Attachments

  • IMG_7221.jpeg
    IMG_7221.jpeg
    421.1 KB · Views: 127
New stuff I've found for Mac OS X for controlling USB output devices before the DSP:

"VLC app" is a freeware successor to Quick Time (non-Pro). Luckily for me, it can adjust sound level and do a variety of other function with the IR remote control. Just a matter of setting the default app for MP4a to VLC (instead of iTunes) and accessing the file ID using FileMaker. Almost all I hoped to achieve.

iTunes does not meddle with USB device sound level but remote does have some other functionality.

Quick Time app does meddle with USB device sound level and remote has some functionality but not for loudness.

Which still leaves (1) my music database/server, FileMaker (with a Quick Time extension built in) and (2) web music (using Safari) needing sound level control. I installed "Black Hole 2ch" successor to Sound Flower (basic app).

I installed Black Hole with "Audio Midi Setup" app and experimented with Aggregate and Multi-Output virtual "devices". But, so far, no success getting Black Hole to control sound level or be otherwise helpful.

Advice?

B.
 
Last edited:
Ok; having done some low level Mac sound development:

OSX volume control is centrally controlled with the kernel of the operating system, and that framework has it’s dB hard coded along with the human perception filter dB. To make that worse; everything in the kernel works only on 32bit linear PCM. All your other formats are then transcoded to PCM before volume control is applied and then the PCM is played to the audio hardware device via PWM.

If you want native DSD playback or native format volume.. you’re on your own and have to write everything inclusing the GUI, human interaction, keyboard handlers, any dB modelling, and finally then you’re free… however if you want to use any Apple code you’ll be converting to PCM first the converting back to the format you’re using..

Open source apps have typically implemented all the required audio work, otherwise supporting features over the different operating systems becomes a exercise i futility. Only need to look at OpenGL or OpenCL as an example outside of audio..
 
Last edited:
Thanks for "insider" update.

You relate all the format conversions that happen. But are there sound quality losses in the process? Or is digital always perfect, within the limits of jittering?

My music library was produced on a Mac and saved in a lossless format (MP4a which also designates formats which do have losses, oddly enough). So can I expect fewer conversions and jittering?

I remain at a loss to assess the quality of digital processes or to find illuminating specs. The old measures usually come out quite golden with REW-type assessment of freq, harmonic distortion, and noise. But sometimes I think some ordinary EQ badly skews the measurements without affecting the sound quality. I just don't know.
 
My experience was looking at options for DSD support essentially could you add it into the opening system. Short answer is is yes, as long as it goes via PCM. Then you have the fun of a USB audio stream (a supported by the OS) being generated by the OS as PCM.. only way to get DSD as a stream it as a generic bit stream yourself..

In terms of jitter that depends on the OS, interrupts.. operating systems are notoriously bad for timing. (My degree, 20+ years ago, is partly todo with concurrency and real-time).

It would be better to transfer the bytes/bits to a non OS system like a FPGA with ram or some other non OS embedded system then stream from that.

Better think of OS X as a trash compactor or audio. Any audio package worthy of note will not be using it’s audio..
 
Last edited:
"Ok; having done some low level Mac sound development..."

NickKUK -

Can you lead what is no doubt a lot of Mac end-users here on setting up Audio Midi Setup to have a volume control when outputting to a USB device (monitor or DSP...) - esp with something like Black Hole?

Thanks.
B.

I did try midi years ago - I was writing an app for my Roland vdrums kit (via a midi FireWire interface) I into the Mac. The idea was to develop an app to play along. Apple dropped FireWire and I lost interest playing catch-up in recoding at apple’s whim. I had the same issues with OpenGL and OpenCL I was using for FFT processing. Apple just decided to discontinue support in favour of their own non-portable and horrendously flawed implementations.

I’d need to look at the midi documentation but it could be possible to make a midi user-level device driver that can take midi volume commands and output to usb. IIRC midi was operating simply as 8Bit but some of the parameters were 16bit. 255 levels would be usable for volume.

I did a usb block driver implementation when I ported a cypress-based usb astronomy camera to the Mac. That downloaded the cypress firmware on connection, then exposed the cypress ports (groups of interface pins) as USB endpoints. It’s probably easier to simply use one of the usb standard “profile” and if the Mac supports it - one may have a volume set operation.

It would be user-level driver, rather than kernel level. This then reduces both stability and security issues. One mistake in a kernel driver and the Mac will “blue screen” or hang with a beachball.
 
Last edited:
This example has volume: Apple Developer Documentation

You could then simply drop the “stream” and send a command through usb.

I see the OS supports conversion between different formats and PCM by stating the required framing, bits/sample etc. However I suspect all the transcoding and and digital audio work may also be possible to write plugins for.. but still not portable and at the whim of Apple.
Better to make it as simple as possible and the Apple specific portion as lightweight as possible.
 
miniDSP SHD Studio is a good option although if you don't need Dirac it is rather expensive.

I also like the CamillaDSP option, I haven't built anything with a knob but I do have working remote control via a FLIRC USB IR receiver and have also programmed a small OLED display to work with CamillaDSP. You can change the volume via the CamillaDSP GUI on your phone or use the remote and both update the display. Would be more than happy to share my code if you are interested.

Michael

Yes please share it. On what hardware does it run?
 
I am a visitor to this forum from the crude mechanical world of folks who build loudspeakers and solder cross-overs.

So while many members here are benefiting from the in-depth discussion and terminology, I hope visitors like myself who are just "end-users" and plug-and-play DSP buyers can also find help which they are capable of implementing.

Thanks.
Ben
 
Administrator
Joined 2004
Paid Member
And when music is just soft background, no need to achieve great sound quality.
Good point!

...as an Apple user since 1979
Oh, you are one of those, eh? Back in '79 we were in the Palm Beach County Computer Club. We had a Commadore PET, and there were Tandy TRS-80 users, Atari and some others. Then there were the Apple users, they mostly stuck together and were kinda weird. :D I didn't start using Apple until about 1986.
 
This is not a plug and play, but post it anyway.
An STM32 nucleoboard could be configured for SPDIF in/out
Electrical app note
https://www.st.com/resource/en/appl...the-stm32f4f7h7-series-stmicroelectronics.pdf

Datastream app note
https://www.st.com/content/ccc/reso...ilips_Digital_Interface_Receiver_SPDIF-RX.pdf

Not so easy to get it right wit the STM32F series, but the STM32H series can adjust the audio clock with higher precision so that is much better when no input master clock is present.