Skip to contentSkip to conversation

: Capture Source Select sets incorrectly

ALSA - lib 0001610 [email protected] 1 participant 1 message Dec 2, 2005

lore
Share & tools
lore
#0 lore raw

The following issue has been RESOLVED.
======================================================================
<https://bugtrack.alsa-project.org/alsa-bug/view.php?id=1610>
======================================================================

Reported By:                psa
Assigned To:                tiwai
======================================================================
Project:                    ALSA - lib
Issue ID:                   1610
Category:                   simple mixer
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     resolved
Resolution:                 fixed
Fixed in Version:           
======================================================================
Date Submitted:             12-01-2005 22:29 CET
Last Modified:              12-02-2005 14:41 CET

======================================================================
Summary: Capture Source Select sets incorrectly
Description:
Simple mixer sets AC97 MX1A incorrectly: only left channel is updated.
Reason: capabilities include 'cswitch-joined', while in reality it's not joined.
This is caused by a feature bug in src/mixer/simple_none.c in selem_update() in capture joined analyses. SM_CAP_CSWITCH_JOIN is reset if CTL_CAPTURE_ROUTE or CTL_CAPTURE_SWITCH has more than one channels, but not if CTL_CAPTURE_SOURCE has more than one channels, as it should since SM_CAP_CSWITCH_JOIN is used in _snd_mixer_selem_set_switch() (called indirctly by snd_mixer_selem_set_capture_switch() called by amixer (or alsamixer)). If SM_CAP_CSWITCH_JOIN is set in _snd_mixer_selem_set_switch() channel is always set to 0. When tying to set right channel nothing is done since sw mask has 1 only for chnnel 1, but for channel 0.

Fix: in selem_update() add to the condition for reseting SM_CAP_CSWITCH_JOIN, CTL_CAPTURE_SOURCE.
diff (also enclosed):

-------------------------------------------------------------------
*** simple_none.c.myorg Fri Nov 25 02:21:54 2005
--- simple_none.c Thu Dec 1 23:13:54 2005
***************
*** 768,774 ****

        if (cchannels > 1) {
                if (simple->ctls[CTL_CAPTURE_ROUTE].elem ||
                    (simple->ctls[CTL_CAPTURE_SWITCH].elem &&
!                    simple->ctls[CTL_CAPTURE_SWITCH].values > 1)) {
                        caps &= ~SM_CAP_CSWITCH_JOIN;
                }
                if (simple->ctls[CTL_CAPTURE_VOLUME].elem &&
--- 768,776 ----
        if (cchannels > 1) {
                if (simple->ctls[CTL_CAPTURE_ROUTE].elem ||
                    (simple->ctls[CTL_CAPTURE_SWITCH].elem &&
!                    simple->ctls[CTL_CAPTURE_SWITCH].values > 1) ||
!                   (simple->ctls[CTL_CAPTURE_SOURCE].elem &&
!                    simple->ctls[CTL_CAPTURE_SOURCE].values > 1)) {
                        caps &= ~SM_CAP_CSWITCH_JOIN;
                }
                if (simple->ctls[CTL_CAPTURE_VOLUME].elem &&

---------------------------------------------------------------------

======================================================================

----------------------------------------------------------------------
tiwai - 12-02-05 14:41
----------------------------------------------------------------------
Nice catch. Applied to CVS tree.

The copyright is LGPL, as found in the source code and COPYRIGHT. The credit is usually recorded in the CVS changelog.

Issue History
Date Modified Username Field Change
======================================================================

12-01-05 22:29 psa            New Issue                                    
12-01-05 22:29 psa            File Added: simple_none.c.diff                    
12-02-05 14:41 tiwai          Status                   new => resolved     
12-02-05 14:41 tiwai          Resolution               open => fixed       
12-02-05 14:41 tiwai          Assigned To               => tiwai           
12-02-05 14:41 tiwai          Note Added: 0006889                          

======================================================================

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click