amixer sset volume: Left/Right race

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In my ~/.xbindkeysrc I have

"amixer set Master 1000+"
  XF86AudioRaiseVolume
"amixer set Master 1000-"
  XF86AudioLowerVolume

When I hold the "volume up" key on my keyboard, the left and right
channel volumes quickly get out of sync.

This is reproducible with this shell loop:

   for i in $(seq 20); do amixer sset Master 1000+ & done

But not with this loop:

   for i in $(seq 20); do amixer sset Master 1000+; done

It appears that xbindkeys invokes multiple amixer concurrently, like
the first shell loop, and that amixer/ALSA is somehow setting the
channel volumes one at a time, presumably in an unprotected
read-modify-update critical section. I'm not familiar with how this
works, and where the blame might lay.

However, pamixer
(https://github.com/cdemoulins/pamixer/blob/master/pulseaudio.cc) uses
/usr/include/pulse/pulseaudio.h and
pa_context_set_sink_volume_by_index() directly and does not have this
problem.

  for i in $(seq 20); do pamixer --increase 1 & done

Thanks.


P.S. The "Bug Tracker" link on the left of
http://alsa-project.org/main/index.php/Main_Page is broken.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux