Reverse-engineering my speakers' API to get reasonable volume control
James Vaughan is reverse-engineering powered speakers' API to create a custom volume control solution, as their excessive volume levels complicate adjustments. He plans to build a physical volume knob using an ESP32 board.
Read original articleJames Vaughan discusses his experience with new powered speakers that have excessive volume levels, making it challenging to achieve precise volume control. He typically uses only about 10% of the speakers' volume range, leading to difficulties when adjusting volume through standard controls on devices like his phone or computer. To address this, he is reverse-engineering the speakers' API to create a custom volume control solution.
After discovering the speakers have an undocumented HTTP API, Vaughan explored their web interface and found endpoints for reading and writing volume levels. Despite his efforts, he was unable to locate a setting to adjust the maximum volume directly. Instead, he decided to build a custom web page with a slider that allows him to control the volume within a more manageable range. He set up a small server using Bun to handle requests and ensure the volume does not exceed a safe level.
Vaughan's current solution works but he aims to create a physical volume knob for more convenient control. He plans to use an ESP32 board with a rotary encoder for this project, incorporating features like haptic feedback for a better user experience. He expresses enthusiasm for returning to hardware electronics projects as he develops this new volume control system.
Related
Creating My Own Linux-Based Smart TV
Carl Riis introduces "EarlGreyTV," a Linux-based Smart TV project using an old laptop with Debian Linux and Sway. He details hardware setup, remote control options, content casting, and highlights customization benefits for tailored TV experiences.
Dear. Android – Leave. The. Power. Button. Alone
The author criticizes the changing functionalities of smartphone power buttons, causing confusion among users. Different brands like Google, Samsung, Apple, realme, and HONOR complicate tasks, urging a return to simpler operations.
Hacking a BMD Speed Editor keypad into an X11 macropad [video]
The YouTube video discusses a specialized controller for Da Vinci Resolve obtained through YouTube earnings. It offers tailored features but lacks multicamera editing compatibility. The speaker explores intercepting USB communication and firmware enhancement possibilities.
Building a Galaksija
Vlado Vince recreates a Galaksija 8-bit computer, facing challenges with parts and troubleshooting. His journey reflects dedication to retro tech, blending nostalgia and technical expertise in preserving computing history.
The Linux audio stack demystified
The article explores the Linux audio stack, detailing sound properties, digital audio sampling, and components like ALSA and PulseAudio, providing a comprehensive guide to audio processing in Linux systems.
- Many users experience issues with excessive volume levels on their devices, leading to frustration and the need for alternative volume control methods.
- Several commenters suggest exploring existing open-source projects or products that could enhance the volume control experience.
- There is a preference for passive speakers and separate amplifiers over active speakers due to concerns about e-waste and flexibility in upgrading components.
- Some users express interest in the technical aspects of integrating physical controls with digital systems, highlighting the potential for innovative solutions.
- Concerns about security in IoT devices and the complexity of modern audio systems are also raised, indicating a desire for better user control and understanding.
https://github.com/scottbez1/smartknob
Video demo here: https://www.youtube.com/watch?v=ip641WmY4pA&t=1s
When I was buying speakers for my apartment some time ago, I was similarly considering going for the all-in-one options like this, but I’m glad I didn’t. I prefer the “dumb passive speaker + networked amp”, as it allows you to pick / replace / upgrade the separate components. Went for the KEF LS50, and for the amp Lyngdorf TDAI-1120. And that’s despite KEF having the all-in-one active version of those speakers. Very happy with my choices!
Volume controls need to be logarithmic, not linear.
To a first degree approximation, everybody gets this wrong.
This works because function.toString() in modern runtimes gives you back fully parse-able input source.
You need to make sure you don’t reference anything outside the function, but it’s generally nicer overall than JS-in-string.
Then you treat it as an IIFE. Example:
function globalJS() { document.write('hi') }
const html = `<script>(${globalJS})()</script>`
I use this technique for calling AppleScript-flavored-JS from NodeJS too. With that system, I could set the amplifier’s analog volume knob such that the max volume out of the streamer corresponded to my actual maximum preferred listening volume, giving me access to the full range of Spotify or AirPlay’s volume controls.
Assuming an analog input, this might result in a noticable quality reduction at low volumes.A rotary knob with an integrated esp32.
https://shop.m5stack.com/products/m5stack-dial-esp32-s3-smar...
There's a reason why local web applications aren't a collection of HTML and JS files, and are instead full copies of the Chromium browser.
Weird you can't limit digital output. I also listen mostly at low volumes and have the same issue. Part of the reason I chose Sonos is this is built in across all products, alongside an effective loudness toggle. This has been particularly helpful with some little Genelec 8010s I use as desktop speakers plugged into a Sonos Port.
Hope this person segmented this device away from other devices. The lack of basic security in the IoT space is astounding to me.
My favorite "smart" speaker in the house is a very old (~20 years) Altec Lansing 2.1 speaker kit that has a (sadly now discontinued) Chromecast audio plugged into it's headphone in.
Edit: found this which looks to fit the bill - https://github.com/balena-io-experimental/balena-sound
Is the sound quality better when not approaching to maximum volume?
The kid in me thinks there could also be a way perhaps to transmit audio through this (or another) API? (very low chance, but…)
// Yes, this is JavaScript embedded in HTML embedded in TypeScript.
// I only recently learned that you can reference elements by ID this way.
// It's kind of horrible but also I love it on tiny pages like this.
You have to kind of embrace the duality of every moment. -Spencer Dinwiddie
Although I don't use USB for audio (rather buggy) the control interface works perfectly.
I duly created a websockets API that allows me to remotely control the volume over wifi via a phsyical rotary controller. Allows me to conceal all the hifi equipment in a cupboard upstairs but remotely control it from a knob downstairs in the kitchen.
Like the OP I also implemented volume limits to prevent accidental damage to the speakers (primarily from twiddles by little fingers)....works a treat!
So, instead of using the Spotify alexa skill, I have to use my phone and connect it via bluetooth, so I can turn down the volume on my phone in addition to using the quietest volume on the Echo.
Sonos volume control remains broken in their new (forced) app update, “reasonable control” on the roadmap for two months out
Why do they do this? The problem is so obvious that you'd reckon they're doing it to deliberately annoy users.
The problem doesn't stop there, the lack of gain with Bluetooth is notorious. Almost every Bluetooth device I own has insufficient gain, franky it's a damn nuisance. The audio in the two sound bars that I own is so low on some audio material that I'm thinking of pulling them apart to see if I can find an op amp and increase its feedback resistor to obtain more gain. I should NOT have to do this.
Let me give you an example, the audio levels on many YouTube videos can be all over the place. Often the audio can be 6 to 10 dB below what it ought to be, thus it's impossible to listen on a laptop's speakers, especially so when one is listening in a location where the background noise is high.
What's wrong with the designers who design this digital stuff, don't they ever use the equipment themselves?
Haven't they ever seen a traditional radio or HiFi where the volume potentiometer is off at the 7 o'clock position, 12 noon is the maximum volume with a nominal one volt input signal or a radio station that's using normal levels of modulation, and the reserve gain is the range from the noon position to the 5PM one?
Do I have to say it again? The reserve gain is for when the input signal is lower that it ought to be. The world is not ideal, audio signals can be far from ideal—even from high tech companies like Google.
Occasionally help comes along, VLC has settings that allow the gain to be set to over 100℅ but I've often had situations where even VLC hasn't had the necessary reserve.
I've come to the conclusion the designers and programmers of this digital equipment haven't a clue about how ordinary amplifiers work. Or they have never taken the trouble to find out. They just assume a 16-bit input has 65536 levels and that's the range. Full stop! They never give consideration to what happens when the peak audio input covers perhaps less than one third that range of bits.
To get enough volume I've even had to use the audio equalizer, that's when one has been available, and often there is not. To get the extra gain I slide all sliders to maximum. Having to do this frequently is an ergonomic nightmare.
This is what happens when the arrogant digital world is too prowd to take a leaf out of the analog world—the world that managed to get these issues right about a century or more ago.
BOM: a halfway nice powered speaker with an integral amp and a single board computer. mount the sbc onto the speaker. then use a audio server to ship the sound around. I am a huge obsd fanboy so I would use sndiod but the linux ones(pipewire?) would probably be better for the task.
The main thing stopping me from doing it is that it turns out I dislike dumping sound into the atmosphere, nothing wrong with it, I just don't enjoy blasting music. so I just stick to my headphones, and think about it once in a while.
Your Father and Mother must be very proud of you.
Marty DiBergi: Oh, I see. And most amps go up to ten?
Nigel Tufnel: Exactly.
Marty DiBergi: Does that mean it's louder? Is it any louder?
Nigel Tufnel: Well, it's one louder, isn't it? It's not ten. You see, most blokes, you know, will be playing at ten. You're on ten here, all the way up, all the way up, all the way up, you're on ten on your guitar. Where can you go from there? Where?
Marty DiBergi: I don't know.
Nigel Tufnel: Nowhere. Exactly. What we do is, if we need that extra push over the cliff, you know what we do?
Marty DiBergi: Put it up to eleven.
Nigel Tufnel: Eleven. Exactly. One louder.
Marty DiBergi: Why don't you just make ten louder and make ten be the top number and make that a little louder?
Nigel Tufnel: [pause] These go to eleven.
- This Is Spinal Tap (1984)
Related
Creating My Own Linux-Based Smart TV
Carl Riis introduces "EarlGreyTV," a Linux-based Smart TV project using an old laptop with Debian Linux and Sway. He details hardware setup, remote control options, content casting, and highlights customization benefits for tailored TV experiences.
Dear. Android – Leave. The. Power. Button. Alone
The author criticizes the changing functionalities of smartphone power buttons, causing confusion among users. Different brands like Google, Samsung, Apple, realme, and HONOR complicate tasks, urging a return to simpler operations.
Hacking a BMD Speed Editor keypad into an X11 macropad [video]
The YouTube video discusses a specialized controller for Da Vinci Resolve obtained through YouTube earnings. It offers tailored features but lacks multicamera editing compatibility. The speaker explores intercepting USB communication and firmware enhancement possibilities.
Building a Galaksija
Vlado Vince recreates a Galaksija 8-bit computer, facing challenges with parts and troubleshooting. His journey reflects dedication to retro tech, blending nostalgia and technical expertise in preserving computing history.
The Linux audio stack demystified
The article explores the Linux audio stack, detailing sound properties, digital audio sampling, and components like ALSA and PulseAudio, providing a comprehensive guide to audio processing in Linux systems.