Bug 229969

Summary: mixer_info modify_counter is not incremented when changes are made to the mixer
Product: Base System Reporter: Ali Abdallah <ali.abdallah>
Component: kernAssignee: Hans Petter Selasky <hselasky>
Status: Closed FIXED    
Severity: Affects Many People CC: hselasky
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Increment the modify_counter when mixer_set is called. none

Description Ali Abdallah 2018-07-22 19:50:05 UTC
Created attachment 195378 [details]
Increment the modify_counter when mixer_set is called.

From  sys/dev/sound/pcm/mixer.c:70
/**
  * Counter is incremented when applications change any of this
  * mixer's controls.  A change in value indicates that persistent
  * mixer applications should update their displays.
  */

But reading the code, it is clear that this is not the case, and the counter remains 0. It is enough to call m->modify_counter++ in mixer_set on line 327 for example to make persistent mixer applications work correctly. Currently they have to poll for all mixer controls, even if no changes were made to the mixer. 

The attached patch solves the problem.
Comment 1 commit-hook freebsd_committer freebsd_triage 2018-07-23 09:17:12 UTC
A commit references this bug:

Author: hselasky
Date: Mon Jul 23 09:16:24 UTC 2018
New revision: 336632
URL: https://svnweb.freebsd.org/changeset/base/336632

Log:
  Update modify counter when setting a mixer control.

  PR:		229969
  MFC after:	1 week

Changes:
  head/sys/dev/sound/pcm/mixer.c
Comment 2 commit-hook freebsd_committer freebsd_triage 2018-07-30 09:26:25 UTC
A commit references this bug:

Author: hselasky
Date: Mon Jul 30 09:25:57 UTC 2018
New revision: 336889
URL: https://svnweb.freebsd.org/changeset/base/336889

Log:
  MFC r336632:
  Update modify counter when setting a mixer control.

  PR:		229969

Changes:
_U  stable/11/
  stable/11/sys/dev/sound/pcm/mixer.c
Comment 3 commit-hook freebsd_committer freebsd_triage 2018-07-30 09:28:28 UTC
A commit references this bug:

Author: hselasky
Date: Mon Jul 30 09:28:01 UTC 2018
New revision: 336890
URL: https://svnweb.freebsd.org/changeset/base/336890

Log:
  MFC r336632:
  Update modify counter when setting a mixer control.

  PR:		229969

Changes:
_U  stable/10/
  stable/10/sys/dev/sound/pcm/mixer.c
Comment 4 commit-hook freebsd_committer freebsd_triage 2018-07-30 09:30:32 UTC
A commit references this bug:

Author: hselasky
Date: Mon Jul 30 09:29:32 UTC 2018
New revision: 336891
URL: https://svnweb.freebsd.org/changeset/base/336891

Log:
  MFC r336632:
  Update modify counter when setting a mixer control.

  PR:		229969

Changes:
_U  stable/9/sys/
  stable/9/sys/dev/sound/pcm/mixer.c