SettingsGUI on Freerunner

ritz khadgaray at gmail.com
Sun Jul 27 14:08:21 CEST 2008


On Sun, 2008-07-27 at 10:28 +0530, sparky mat wrote:
> Has someone tried the SettingsGUI on the Freerunner? I keep getting
> the following error:
> 
> valueError: invalid literal for int() with base 10: 'on\n'

root at om-gta02:~# DISPLAY=:0.0 settings
0.1: 0.129661083221
0.2: 0.785246133804
0.3: 1.2897901535
1: 1.29346108437
2: 1.383934021
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/settingsgui/SettingsGUI.py",
line 107, in create_UI
    self.add_notebook_page(AudioPanel(), "moko-speaker")
  File "/usr/lib/python2.5/site-packages/settingsgui/AudioPanel.py",
line 35, in __init__
    self.create_notebook_page()
  File "/usr/lib/python2.5/site-packages/settingsgui/AudioPanel.py",
line 143, in create_notebook_page
    init_volume = self.get_volume(channel[1])
  File "/usr/lib/python2.5/site-packages/settingsgui/AudioPanel.py",
line 99, in get_volume
    return int(amix_out.split('=')[1])
ValueError: invalid literal for int() with base 10: 'on\n'

seems that we are using amixer to control the volume settings in a
rather hackish manner. The easiest (hack) workaround would be to comment
out line 98 and 99. This will disable volume control.

    def get_volume(self, chan_id):                                        
        amix_ostream = os.popen("%s  cget numid=%d" %(ALSA_AMIXER, chan_id))
        # ToDo - parse everything!                            
        amix_out = amix_ostream.readline()
        amix_out = amix_ostream.readline()
        amix_out = amix_ostream.readline()
   ##     if amix_out.find("value") >= 0: 
   ##         return int(amix_out.split('=')[1])
        return 0; 



A better alternative would be to push for python-alsa into OM.

As a temporary workaround, use alsamixer once sound module has been
disabled from settings app.

  $ alsamixer

> 
> I am python-illiterate, so looking at the code won't help me :-(
> 
> _______________________________________________
> support mailing list
> support at lists.openmoko.org
> https://lists.openmoko.org/mailman/listinfo/support
-- 
Ritesh Khadgaray
Ph: +919970164885
Desktop LinuX N Stuff, RHCE
Software Maintenance Engineer, Pune, Red Hat
ॐ मणि पद्मे हूँ
Eat Right, Exercise, Die Anyway.






More information about the support mailing list