PulseAudio peeking doesn't work right: every app is faded to mute
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ear Candy |
New
|
Undecided
|
Unassigned |
Bug Description
PulseAudio.py:
...
def pa_stream_
...
pa_stream_
...
v = data[length / 4 -1] * 100
if (v < 0):
v = 0
if (v > 100):
v = 100
gobject.
This just doesn't work. The majority of the time while my music player (Clementine or Pithos) is playing music, (data[length / 4 -1] * 100) ends up nan or 0 or a very "large" negative number, so v = 0, and the client object is set to not active, so it's set to not primary, so it's faded to mute. The rest of the time, it's constantly fading up and down.
I've spent many hours now debugging the code to get to the culprit line (v = data[length / 4 -1] * 100). I tried removing "-1" and "/4" and even "*100", but it's still not stably detecting a level while music is playing. It just doesn't work.
I'm using Kubuntu Natty at the moment.
I'm pushing a branch with much, much debugging code added using the logging class. My branch is based on the "fixes" branch, rev81.
I don't know if anyone will ever find this bug...but right now it seems that all hope is lost for this feature. The only hope I can see, other than fixing the stream peeking, is to rely only upon whether a client has active sinks. But even that's not enough, because a client may leave a sink active while it's not using it (e.g. a paused or finished Flash video in plugin_container).
lp:~launchpad-alphapapa/earcandy/debug-907398
Maybe someone else can fix it. Good luck.