Skip to content

Fixed audio webpage issues found testing #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

driechers
Copy link
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 <[email protected]>
@craigerl
Copy link
Owner

craigerl commented Feb 15, 2025

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
Owner

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

@craigerl
Copy link
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
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
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
Owner

yah, i renamed a few tags

@craigerl
Copy link
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
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
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
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?

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.

2 participants