Skip to contentSkip to conversation

pyalsa.alsamixer.Element.get_volume_dB returns error status instead of actual value

DISCUSSION GitHub issues - opened 1 participant 1 message Mar 15, 2025 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

alsa-project/alsa-python issue #16 was opened from tespent:

I am writing a status collector for my PC, and I noticed that pyalsa.alsamixer.Element.get_volume_dB always returns 0 in my test, which lead to invalid result for the collected status.

After digging into code I notice that the following code returns res instead of val as the result:
https://github.com/alsa-project/alsa-python/blob/f8f9260282eb9c97f53e4689e04182dc87a4810e/pyalsa/alsamixer.c#L983

I am able to workaround this issue by using elem.ask_volume_dB(elem.get_volume()) but this looks silly.

Btw, I'm willing to contribute and subscribed to alsa-devel mailing list but I didn't figure out exactly how. Can someone tell me?

Issue URL : https://github.com/alsa-project/alsa-python/issues/16
Repository URL: https://github.com/alsa-project/alsa-python