All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Degert <ad@papyrus-gmbh.de>
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de
Subject: hdsp driver broken for Multiface II Rev 35
Date: Mon, 14 Jan 2008 02:21:42 +0100	[thread overview]
Message-ID: <20080114022142.51d6ae44@pluto.noname> (raw)

Hi folks,

changeset 5326 from 2007/08/31 broke the driver for this card revision.
There was an older thread about this problem which didn't seem to come
to a conclusion.

ioctl SNDRV_HDSP_IOCTL_GET_VERSION returns

io_type = 1 (Multiface)
firmware_rev = 0x35

which is correct. The old code for hdsp_playback_to_output_key looks
like this:

static int hdsp_playback_to_output_key (struct hdsp *hdsp, int in, int out)
{
        switch (hdsp->firmware_rev) {
        case 0xa:
                return (64 * out) + (32 + (in));
        case 0x96:
        case 0x97:
                return (32 * out) + (16 + (in));
        default:
                return (52 * out) + (26 + (in));
        }
}

For my card the result is "(52 * out) + (26 + (in))". The new code
looks like this:

static int hdsp_playback_to_output_key (struct hdsp *hdsp, int in, int out)
{
        switch (hdsp->io_type) {
        case Multiface:
        case Digiface:
        default:
                return (64 * out) + (32 + (in));
        case H9632:
                return (32 * out) + (16 + (in));
        case H9652:
                return (52 * out) + (26 + (in));
        }
}

which gives the wrong result "(64 * out) + (32 + (in))". The old code
returns this when firmware_rev == 0xa, which might be the revision of
the older Multiface (not Multiface II). I changed the code to

static int hdsp_playback_to_output_key (struct hdsp *hdsp, int in, int out)
{
        switch (hdsp->io_type) {
        case Multiface:
        case Digiface:
        default:
                if (hdsp->firmware_rev == 0xa)
                        return (64 * out) + (32 + (in));
                else
                        return (52 * out) + (26 + (in));
        case H9632:
                return (32 * out) + (16 + (in));
        case H9652:
                return (52 * out) + (26 + (in));
        }
}

Another possibility would be to go back to the old version of the code
and only make changes for io_type H9632/H9652 with new firmware
revisions:

static int hdsp_playback_to_output_key (struct hdsp *hdsp, int in, int out)
{
        switch (hdsp->firmware_rev) {
        case 0xa:
                return (64 * out) + (32 + (in));
        case 0x96:
        case 0x97:
                return (32 * out) + (16 + (in));
        }
        switch (hdsp->io_type) {
        case H9632:
                return (32 * out) + (16 + (in));
        case Multiface:
        case H9652:
                return (52 * out) + (26 + (in));
        case Digiface:
		??? is there a Digiface with revision != 0xa ???
        default:
		??? HDSP_IO_Type Undefined ???
        }
}

Similar changes must be made to hdsp_input_to_output_key. Does anyone
know which firmware revision exist for which card (io_type) ?

thank you
Andreas Degert

             reply	other threads:[~2008-01-14  1:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-14  1:21 Andreas Degert [this message]
2008-01-14 11:00 ` hdsp driver broken for Multiface II Rev 35 Takashi Iwai
2008-01-15 19:42   ` Andreas Degert
2008-01-15 21:28     ` Christian Schumann
2008-01-16 15:00     ` Takashi Iwai
  -- strict thread matches above, loose matches on Subject: below --
2008-01-16 22:43 Jean Batrel

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=20080114022142.51d6ae44@pluto.noname \
    --to=ad@papyrus-gmbh.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=tiwai@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.