Skip to content

Fixed audio webpage issues found testing - #16

Open
driechers wants to merge 1 commit into
craigerl:mainfrom
driechers:bugfix_audio
Open

driechers wants to merge 1 commit into
craigerl:mainfrom
driechers:bugfix_audio

Conversation

@driechers

Copy link
Copy Markdown
Contributor

After testing with DRA-PI-zero hat I found a few issues.

Audio levels did not allways match percentage. Fixed by adding -M Enum controls were not supported
volume controls (neither cvolume nor pvolume) were not supported fixed whitespace issue
Fixed copy paste error in capture regex

I'm happy to make any changes perform additional testing. I have now tested with digipi hat and dra-pi-zero

73
KF0NRV

After testing with DRA-PI-zero hat I found a few issues.

Audio levels did not allways match percentage. Fixed by adding -M
Enum controls were not supported
volume controls (neither cvolume nor pvolume) were not supported
fixed whitespace issue
Fixed copy paste error in capture regex

Signed-off-by: Daniel Riechers <driechers101@gmail.com>
@craigerl

craigerl commented Feb 15, 2025 •

Copy link
Copy Markdown
Owner

So, this isn't working exactly for the fe-pi audio board. it has a dozen capture and a dozen output controls.

The one show stopper is the displayed "Capture" slider doesn't have a check mark, even though it is active. when the user hits submit, it effectively mutes the Capture audio without (the user) changing anything on the page.

@craigerl

Copy link
Copy Markdown
Owner

unchecked-capture
screenshot of active capture, but no checked checkbox displayed

@craigerl

Copy link
Copy Markdown
Owner

additionally, you can see many controls are missing, Mic for example. I haven't looked closely at the code yet, but are these being filtered somehow?

@driechers

Copy link
Copy Markdown
Contributor Author

It’s not super clean code. It’s mostly regex scraping command line utils. It isn’t exactly filtering but I’ve learned through this experience with alsa that not all cards behave as I would have assumed. What have you tested on? Id be happy to order a board/boards to reproduce and fix my end.

@driechers

Copy link
Copy Markdown
Contributor Author

It also looks from your screenshot you may be running my original code because the url says alsa and not audio

@craigerl

Copy link
Copy Markdown
Owner

yah, i renamed a few tags

@craigerl

Copy link
Copy Markdown
Owner

I haven't taken a close look at your code yet, it might be something silly. I just wanted to run it by you to see if it was something obvious, why the html shows an unchecked box for a device that has CAPTURE enabled.... and why many/most controls are missing. It'd be cool to do some filtering, as many/most controls are useless/confusing. line/pcm/volume/mic/capture.

The board in question is an fe-pi audio board, in common use. Bud Churchward sells them now.

I was just doing some regression testing, getting ready for a new release, but I can't release the Audio stuff if it generates tickets.

thanks again - great stuff,
-craig

@craigerl

Copy link
Copy Markdown
Owner

It looks like it might be a bug in "amixer scontrols"

Simple mixer control 'Headphone',0
Simple mixer control 'Headphone Mux',0
Simple mixer control 'Headphone Playback ZC',0
Simple mixer control 'PCM',0
Simple mixer control 'Lineout',0
Simple mixer control 'Mic',0
Simple mixer control 'Capture',0
Simple mixer control 'Capture Attenuate Switch (-6dB)',0
Simple mixer control 'Capture Mux',0
Simple mixer control 'Capture ZC',0
Simple mixer control 'AVC',0
Simple mixer control 'AVC Hard Limiter',0
Simple mixer control 'AVC Integrator Response',0
Simple mixer control 'AVC Max Gain',0
Simple mixer control 'AVC Threshold',0
Simple mixer control 'BASS 0',0
Simple mixer control 'BASS 1',0
Simple mixer control 'BASS 2',0
Simple mixer control 'BASS 3',0
Simple mixer control 'BASS 4',0
Simple mixer control 'DAP MIX Mux',0
Simple mixer control 'DAP Main channel',0
Simple mixer control 'DAP Mix channel',0
Simple mixer control 'DAP Mux',0
Simple mixer control 'Digital Input Mux',0

capture

@craigerl

Copy link
Copy Markdown
Owner

pi@digipi4:~ $ sudo amixer controls | grep Capt
numid=3,iface=MIXER,name='Capture Attenuate Switch (-6dB)'
numid=24,iface=MIXER,name='Capture Mux'
numid=4,iface=MIXER,name='Capture ZC Switch'
numid=5,iface=MIXER,name='Capture Switch'
numid=2,iface=MIXER,name='Capture Volume'

@craigerl

Copy link
Copy Markdown
Owner

And you can enable the CAPTURE switch on the Capture device with

amixer set "Capture" cap

But it doesn't appear to be possible to detect which device has CAPTURE switched on. If alsa is this bad, we might want to disable the switching, and just present sliders?

@gmeader

gmeader commented Sep 16, 2026

Copy link
Copy Markdown

The ideal audio control panel would have bargraph meters showing the real-time level of audio for each relevant input and output. That way you could see if the levels are too high or not. Even better would be the ability to monitor the audio (played in the browser) of a selected channel to see if it is distorted or whatever.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants