alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Adrian Knoth <adi@drcomp.erfurt.thur.de>
To: patch@alsa-project.org
Cc: Adrian Knoth <adi@drcomp.erfurt.thur.de>, alsa-devel@alsa-project.org
Subject: [PATCH 3/4] hdspmixer: Recall 1st preset on all cards, not just on the first
Date: Mon,  4 Apr 2011 14:34:29 +0200	[thread overview]
Message-ID: <1301920470-4615-4-git-send-email-adi@drcomp.erfurt.thur.de> (raw)
In-Reply-To: <1301920470-4615-1-git-send-email-adi@drcomp.erfurt.thur.de>

With the new "store current settings to the virtual 9th preset" before
switching cards code, one needs to make sure the actual mixer state is
loaded with sane values, either from the preset file or a generic
builtin preset.

Calling preset_change(1) is sufficient, setting all the required data.
However, in case of more than one RME card in the system, one needs to
call this function for each card, otherwise, some of the cards store
uninitialized data to the 9th preset, resulting in a weird mixer state
afterwards.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
---
 hdspmixer/src/HDSPMixerWindow.cxx |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/hdspmixer/src/HDSPMixerWindow.cxx b/hdspmixer/src/HDSPMixerWindow.cxx
index 7848190..5a7dac0 100644
--- a/hdspmixer/src/HDSPMixerWindow.cxx
+++ b/hdspmixer/src/HDSPMixerWindow.cxx
@@ -877,9 +877,10 @@ HDSPMixerWindow::HDSPMixerWindow(int x, int y, int w, int h, const char *label,
 	printf("Initializing default presets\n");
 	i = 0;
 	while (i < MAX_CARDS && cards[i] != NULL) {
+	    current_card = i;
 	    restoreDefaults(i++);
+	    inputs->buttons->presets->preset_change(1);
 	}
-	inputs->buttons->presets->preset_change(1);
     }
     Fl::atclose = atclose_cb;
     Fl::add_handler(handler_cb);
-- 
1.7.4.1

  parent reply	other threads:[~2011-04-04 12:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-04 12:34 [PATCH 0/4] hdspmixer: rescue current mixer settings when switching cards Adrian Knoth
2011-04-04 12:34 ` [PATCH 1/4] hdspmixer: Add a 9th pseudo preset Adrian Knoth
2011-04-04 12:34 ` [PATCH 2/4] hdspmixer: Save preset before switching cards Adrian Knoth
2011-04-04 12:34 ` Adrian Knoth [this message]
2011-04-04 12:34 ` [PATCH 4/4] hdspmixer: Initialize headphones out in presets Adrian Knoth
2011-04-06  6:28 ` [PATCH 0/4] hdspmixer: rescue current mixer settings when switching cards Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1301920470-4615-4-git-send-email-adi@drcomp.erfurt.thur.de \
    --to=adi@drcomp.erfurt.thur.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=patch@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).