Bug 229969 - mixer_info modify_counter is not incremented when changes are made to the mixer
Summary: mixer_info modify_counter is not incremented when changes are made to the mixer
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: Hans Petter Selasky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-22 19:50 UTC by Ali Abdallah
Modified: 2018-07-30 09:30 UTC (History)
1 user (show)

See Also:


Attachments
Increment the modify_counter when mixer_set is called. (264 bytes, patch)
2018-07-22 19:50 UTC, Ali Abdallah
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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