sagide86 / android-notifier

Automatically exported from code.google.com/p/android-notifier
0 stars 0 forks source link

Linux client - wrong module - alsa audio #26

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. download the svn
2. run the lindroidnotifier.py

What is the expected output? What do you see instead?
boot of the program, error and exit

What version of the product are you using? On what operating system?
Latest, svn from today on Ubuntu 10.04 with python 2.6.5

Please provide any additional information below.

junke@junke-eee:~/lindroid/android-notifier-read-only/LinDroidNotifier/androidno
tifier$ python lindroidnotifier.py 
Traceback (most recent call last):
  File "lindroidnotifier.py", line 13, in <module>
    from manager import NotificationManager
  File "/home/junke/lindroid/android-notifier-read-only/LinDroidNotifier/androidnotifier/manager.py", line 16, in <module>
    from actions.mute import MuteAction
  File "/home/junke/lindroid/android-notifier-read-only/LinDroidNotifier/androidnotifier/actions/mute.py", line 6, in <module>
    import alsaaudio
ImportError: No module named alsaaudio

Original issue reported on code.google.com by pat.vdl...@gmail.com on 25 Jun 2010 at 4:33

GoogleCodeExporter commented 8 years ago
nvm, sudo apt-get install python-alsaaudio fixed it!

Original comment by pat.vdl...@gmail.com on 25 Jun 2010 at 4:34

GoogleCodeExporter commented 8 years ago
William, please see if this should be fixed in some way (e.g. handling the 
failure to load the module and just disabling the functionality, or exisitng 
with a nicer message)

Original comment by rdamazio@gmail.com on 25 Jun 2010 at 5:22

GoogleCodeExporter commented 8 years ago
Right, the Linux client now depends on python-alsaaudio for the mute sounds 
action. If there's a better way to mute audio on Linux, I'd like to know!

This shouldn't be a problem once I make a .deb that includes dependency 
information. Maybe there's a better way to handle the ImportError for people 
installing from source though...

Original comment by wcauch...@gmail.com on 25 Jun 2010 at 6:28

GoogleCodeExporter commented 8 years ago
the mute action doesn't work, I'll see if I can find why. Btw wouldn't it be 
handy to create a deb instead of svn and make it depend on python-alsaaudio?

Original comment by pat.vdl...@gmail.com on 25 Jun 2010 at 6:31

GoogleCodeExporter commented 8 years ago
Hmm, I was worried that the method using alsaaudio wouldn't be portable. I 
wasn't sure what the best way to mute audio programmatically was. Can you tell 
me anything about your Linux system? I tested using Ubuntu 10.04.

Making a .deb is exactly what I plan on doing :). Thanks for being brave and 
checking out the bleeding edge source code!

Original comment by wcauch...@gmail.com on 25 Jun 2010 at 6:37

GoogleCodeExporter commented 8 years ago
This seems to work for the sound,

amixer set Master mute

I'm running on a pretty default 10.04 with build-essentials, running on a asus 
eee 1000h.

Original comment by pat.vdl...@gmail.com on 25 Jun 2010 at 6:54

GoogleCodeExporter commented 8 years ago
how about something like this:

    def handle_notification_unmute(self, notification):
        f=os.popen("amixer set Master unmute > /dev/null")

    def handle_notification_mute(self, notification):
        f=os.popen("amixer set Master mute > /dev/null")

    def handle_notification_toggle(self, notification):
        f=os.popen("amixer set Master toggle > /dev/null")

Don't know if this is correct, my python isn't that great. Anyway, this way you 
don't need the alsaaudio lib.

Original comment by pat.vdl...@gmail.com on 25 Jun 2010 at 10:30

GoogleCodeExporter commented 8 years ago
Many modern Linux distros ship with PulseAudio for application-level audio. 
Might be prudent to determine if there's a better way to mute audio as iirc, PA 
doesn't like it when you mess with ALSA directly.

Off the top of my head, it would make sense to depend on the PA library and 
fall-back to ALSA if it doesn't exist.

Original comment by nick.tel...@gmail.com on 10 Sep 2010 at 8:43