Skip to content
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

amixer: needs sget/cget support in stdin mode #135

Open
nick87720z opened this issue Jan 7, 2022 · 4 comments
Open

amixer: needs sget/cget support in stdin mode #135

nick87720z opened this issue Jan 7, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@nick87720z
Copy link

I used alsactl and amixer to implement highly effective volume control applet executor. At least it's able to keep pace at touchpad, which sends 1000 scroll events in only 18 to 12 seconds.

amixer --stdin handles control events, while alsactl monitor is even source for applet display part (it's tint2 executor). But in order to get values to display - this display part has to run alsactl sget per request. Can't these commands be supported in stdin mode? From first look - expected lines number doesn't look unpredictable: for sget it depends on number of channels, and for cget - probably fixed.

Even controls command also could be supported, since it lists channel from biggest ID to 1, so moment of numid=1 could be understood as end of list.

@perexg
Copy link
Member

perexg commented Jan 9, 2022

alsactl monitor = amixer events

It would probably make sense to send an end-of-output line in stdin mode (like ---END---) - using a new amixer argument. The numid=1 as the last line is not guaranteed for amixer controls.

@nick87720z
Copy link
Author

alsactl monitor = amixer events

This looks more convenient than using alsactl. Using alsactl monitor, single amixer controls run is still necessary just to get proper channel ID to manage, while this gives all necessary info from start.
Though at least in alsa-utils 1.2.4 it's indocumented (though imho, program help should usually be updated first). Although I just use gentoo's stable version (last version, keyworded as experimental, is 1.2.6).

@perexg
Copy link
Member

perexg commented Mar 15, 2022

Though at least in alsa-utils 1.2.4 it's indocumented (though imho, program help should usually be updated first).

Fixed in 68473a4 .

@perexg perexg added the enhancement New feature or request label May 16, 2022
@nick87720z
Copy link
Author

It would probably make sense to send an end-of-output line in stdin mode (like ---END---) - using a new amixer argument. The numid=1 as the last line is not guaranteed for amixer controls.

This starts to look like conventional shell with prompt string. I remember most cases they had it like % or > (not system shells, but rather command line utilities). There could be option command line option for user-supplied prompt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants