Package: awn-applets-python-core
Version: 0.2.6-2

If for any reason the controlled audio channel recorded inside user
preferences is not available anymore, the volume control applet fails to
start. The error message is:

$ avant-window-navigator
[…]
Traceback (most recent call last):
  File "/usr/share/awn/applets/volume-control/volume-control.py", line 239,
in <module>
    VolumeApplet(applet)
  File "/usr/share/awn/applets/volume-control/volume-control.py", line 55,
in __init__
    self.awn.module.get("alsaaudio", {"Ubuntu": "python-alsaaudio"},
self.init2)
  File "/usr/lib/python2.5/site-packages/awn/extras/AWNLib.py", line 222, in
get
    return callback(module)
  File "/usr/share/awn/applets/volume-control/volume-control.py", line 68,
in init2
    self.drawMainDlog()
  File "/usr/share/awn/applets/volume-control/volume-control.py", line 83,
in drawMainDlog
    volume.set_value(self.backend.getVolume())
  File "/usr/share/awn/applets/volume-control/volume-control.py", line 212,
in getVolume
    return alsaaudio.Mixer(self.channel).getvolume()[0]
alsaaudio.ALSAAudioError: Unable to find mixer control 'LineOut',0

In my case 'LineOut' doesn't exist and should be replaced with 'Master'. I
solved the problem by catching the error in 'volume-control.py', method
'getVolume', this way:

class Backend:
    […]
    def getVolume(self):
        try:
          return alsaaudio.Mixer(self.channel).getvolume()[0]
        except:
          self.setChannel()
        return alsaaudio.Mixer(self.channel).getvolume()[0]

The wrong channel name is then automatically replaced with the default
(existing) one.

I'm using Debian Lenny.

Reply via email to