JiriSko / amixer-webui

Web application for control ALSA volume
MIT License
53 stars 21 forks source link

Crashes when using Hifiberry amp+ #14

Open J-u-n-o opened 5 years ago

J-u-n-o commented 5 years ago

Due to array ranges out of ranges and unexpected empty strings. Already have a fix available. Also have to figure out how to enable the equalizer: Maybe parse asound.conf? Maybe will add some logging.

dreamcat4 commented 2 years ago

hi @J-u-n-o can you give fix for array index error?

as I am seeing the following error:

127.0.0.1 - - [02/Jul/2022 10:51:25] "GET /controls/?1656755485496 HTTP/1.1" 200 -
127.0.0.1 - - [02/Jul/2022 10:51:31] "PUT /card/1/ HTTP/1.1" 200 -
[2022-07-02 10:51:31,149] ERROR in app: Exception on /controls/ [GET]
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/flask/app.py", line 2070, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1515, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1513, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1499, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/home/id/.app/amixer-webui/./alsamixer_webui.py", line 235, in get_controls
    data = json.dumps(app.__get_controls__())
  File "/home/id/.app/amixer-webui/./alsamixer_webui.py", line 145, in __get_controls__
    channel_desc = self.__get_channel_name__(amixer_chandesc, interface["name"], i)
  File "/home/id/.app/amixer-webui/./alsamixer_webui.py", line 61, in __get_channel_name__
    if name.split(" ")[-2] in line:
IndexError: list index out of range