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 command output parser #591

Open
AvocadoStyle opened this issue Sep 12, 2024 · 4 comments · Fixed by #616
Open

amixer command output parser #591

AvocadoStyle opened this issue Sep 12, 2024 · 4 comments · Fixed by #616

Comments

@AvocadoStyle
Copy link
Contributor

What

As part of utilizing the Advanced Linux Sound Architecture (ALSA), there is a need to develop a parser for the amixer tool. This parser will process and interpret the output of the amixer command to analyze audio settings and states.

Why

The amixer command provides detailed information about sound settings and controls on a Linux system. By creating an output parser, you can automate the analysis and handling of this data, enabling you to:

  • Monitor Audio Levels: Track and log audio levels and settings.
  • Check Mute Status: Determine whether audio channels are muted or unmuted.
  • Automate Configuration: Adjust audio settings programmatically based on analysis.
  • Generate Reports: Create detailed reports of audio configurations and statuses.

For Which Commands output we'll create the parser

We'll run the amixer Command.

  1. Run the Command sget:
    amixer sget <control_name>
    The output for Example:
    $ amixer sget Master
    Simple mixer control 'Master',0
      Capabilities: pvolume pvolume-joined pswitch pswitch-joined
      Playback channels: Mono
      Limits: Playback 0 - 87
      Mono: Playback 87 [100%] [0.00dB] [on]
    
       ```
    
  2. And more commands such as amixer list-sources and amixer scontent and amixer scontrols...
@kellyjonbrazil
Copy link
Owner

Thank you for the parser suggestion! Looks like this could be a good parser for jc. I'll need more output samples to develop the parser and tests since I have not used this command before. Thanks!

@AvocadoStyle
Copy link
Contributor Author

@kellyjonbrazil Hey Kelly!
I’d love to take on developing the amixer parser if that works for you. It’s a great way for me to dive into this open-source project and contribute. Plus, working on this will help me build skills for creating more advanced parsers and improving the projects infrastructure in the future.

@kellyjonbrazil
Copy link
Owner

Absolutely! I welcome a PR. Please take a look at https://github.com/kellyjonbrazil/jc/blob/master/CONTRIBUTING.md

AvocadoStyle pushed a commit to AvocadoStyle/jc that referenced this issue Nov 22, 2024
kellyjonbrazil added a commit that referenced this issue Dec 20, 2024
* created the amixer first skeleton

* push testing and integrate this commit and branch with issue: #591

* #591 checks the input data with jc utils

* created the data parser of the sget control of the amixer sget <controller> command.

* test commit - just for tests

* another test commit

* another test commit

* created a dedicated pseudo algorithm for the amixer sget and tried various of strings.

* orginized the docstring with general explanation about the tool and the amixer tool output and algorithm of the input parsing and input examples.

* created raw implementation, but it's raw either or either.

* orginized the content inside the amixer parser

* removed endpoint name

* added amixer to the jc parser in lib

* more explanations

* added tests for the amixer sget

* added tests for the amixer sget

* fine versioning fix

* created docstring+another explanations seperated.

* created the amixer parser docu

* added the amixer in alphabet order to the json convert lib

* Fix PEP 8: E302 violation as part of boy scout principle

* deleted not necessary file

* fixed the spaces between sections in the amixer description

* resolved commits such as amixer module docstring and preperations for  parser for raw=False.

* Revert "Fix PEP 8: E302 violation as part of boy scout principle"

This reverts commit 241d1a1.

* created the dedicated _process for raw=False

* created the dedicated _process for raw=False

* added tests for the _process raw=False.

* changed keys to be lowercase snake-case - Change 'dB' to 'db'

* added more dB -> db changes and used int convertor of the jc utils

---------

Co-authored-by: EdenRafael <[email protected]>
Co-authored-by: Eden Refael <[email protected]>
Co-authored-by: Kelly Brazil <[email protected]>
@kellyjonbrazil
Copy link
Owner

This will be released in v1.25.5

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

Successfully merging a pull request may close this issue.

2 participants