Maato / volumeicon

Volume Icon aims to be a lightweight volume control that sits in your systray.
http://nullwise.com/volumeicon.html
GNU General Public License v3.0
183 stars 45 forks source link

Can't unmute after unmuting #11

Closed zhemao closed 9 years ago

zhemao commented 12 years ago

There's a bug with the mute / unmute functionality. After muting, you cannot unmute. Volumeicon indicates that the channel is unmuted, but there is no audio and opening alsamixer shows that the channel is still muted.

jcadam commented 11 years ago

I have exactly the same problem here with pulseaudio Master channel. However, I am not sure if it is the issue in volumeicon. It might be some tricky issue/configuration in pulseaudio-alsa extension.

The set_mute() function in ALSA backend will do nothing for unmuting if there were no audio switch control available. That means pulseaudio-alsa might be mute by alsa_set_volume(0) but the volume could not be resumed again.

I can confirm that the MASTER channel on my Intel HDA card could be mute/unmute by this function.

jcadam commented 11 years ago

I just gave a shot on the latest version. It seems this issue has been fixed.

Please close it.

zhemao commented 11 years ago

I have confirmed that the latest version in git is working. However, I am using the version in my distribution's official repo. Could you make a new official release? That way I can ask the package maintainers to upgrade to the working version.

jcadam commented 11 years ago

Hi, Zhemao

It seems the problem could be reproduced after rebooting, even if you had the latest version installed. Could you please give a double-check on this?

jcadam commented 11 years ago

I am afraid the problem was an issue in my system configuration rather than in volumeicon itself. Here are some sequences I got to avoid/reproduce this issue.

avoid this issue

$ killall pulseaudio $ killall volumeicon $ (sleep 1s && start-pulseaudio-x11 && sleep 2s && volumeicon) &

reproduce it

$ killall pulseaudio $ killall volumeicon $ (sleep 1s && volumeicon && sleep 10s && start-pulseaudio-x11) &

Since in my configuration, pulseaudio is started in /etc/xdg/autostart/ but volumeicon is started by openbox after that. It is hard to tell which one would finish their initialization first. To fix/workaround this issue, I just disabled pulseaudio autostart in Xdg and make sure volueicon will be started after the initialization of pulseaudio.

I still think that there should be a good way to avoid this issue by choosing sound card correctly. For example, in my Linux box there are several sound cards. And, one of there are created by pulseaudio

┌───── Sound Card ──────┐ │- (default) │ │0 HDA Intel PCH │ └───────────────────────┘

If volumeicon chose HDA Intel PCH MASTER channl instead of 'default' card, the problem would not happen definitely.

SmilingHorse commented 11 years ago

FIX: In ~/.config/volumeicon make sure the card is set to default and not hw:0.

e.g.: NOT: [Alsa] card=hw:0 channel=Master

YES: [Alsa] card=default channel=Master

Note: I'm using a personal fork of 0.4.6 with a some backported fixes (April 28th with 25c56f1567aa5fac3fbc061a79308a506a52e60a) since I had bad luck compiling later code.

alejandro-perez commented 11 years ago

Hi,

I found the problem. When volumeicon starts and pulseaudio hasn't started yet, volumeicon is linked to ALSA's physical device. When pulseaudio finally starts, "default" changed to point to pulseaudio, but that's too late since volumeicon has already started.

The solution, as commented before, is insure somehow that volumeicon is started after pulseaudio, but this is a little bit tricky.

Then I discovered that if you set "card" option to "pulse" instead of "default", it tries to connect to pulseaudio or nothing, giving an error. Other applications like pnmixer, show a different behaviour: pulseaudio is statarted upon this request. Then, why is this not happening with volumeicon?The problem was that in volumeicon.c, function main(), SIGCHILD signal is ignored, something required by ALSA to automatically start pulseaudio when an application requests for "pulse" device.

Thus, removing that line ignoring SIG_CHILD, and setting card to "pulse" in config file does the trick.

I created a package in AUR, https://aur.archlinux.org/packages/volumeicon-pulsefix/, and you can find the patch here:http://dl.dropbox.com/u/293875/volumeicon-pulseaudio-fix.patch

landorg commented 11 years ago

Patch works great for me! thanks

android-808 commented 11 years ago

Anyone made any further progress here? Merging patch or modifying code to handle pulseaudio as a special case.

Rovanion commented 10 years ago

Sleeping 1 second before starting volumeicon in my login script gave pulse enough time to start before volumeicon starts.

Photon89 commented 10 years ago

I think, there should be a checkbox in the settings like "Use Pulseaudio" which, being checked, results in periodically verifying whether pulseaudio already started on volumeicon start and actually starting it only after the verification returned that pulseaudio is already started.

gandalf3 commented 8 years ago

This is still occurring for me, and the patch/AUR package supplied no longer applies to master.

alejandro-perez commented 8 years ago

Use this https://aur.archlinux.org/packages/xfce4-pulseaudio-plugin/

It works better.

El 15/07/16 a las 04:19, gandalf3 escribió:

This is still occurring for me, and the patch/AUR package supplied no longer applies.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Maato/volumeicon/issues/11#issuecomment-232843903, or mute the thread https://github.com/notifications/unsubscribe-auth/AB_G6IB1G7f_3B_yhIwPYkYe3ysJx-V4ks5qVu4bgaJpZM4ACo0B.

gandalf3 commented 8 years ago

@alejandro-perez Thanks, but I'm not sure how to use that with a non-xfce panel (I'm using tint2).

gandalf3 commented 8 years ago

Just in case it helps, here are the versions I'm running: pulseaudio 9.0 Volume Icon 0.5.1

I ended up disabling the mute shortcut in volumeicon, and setting up a separate mute shortcut with pulseaudio-ctl.

Now it works well enough for me, though unmuting by clicking on volumeicon still doesn't work of course.