Skip to contentSkip to conversation

hdsp driver broken for Multiface II Rev 35

DISCUSSION Applied Andreas Degert 3 participants 5 messages Jan 14, 2008 – Jan 16, 2008

lore
Share & tools
lore
#0 lore 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

#1 lore raw

At Mon, 14 Jan 2008 02:21:42 +0100,

Quoted 50 lines · Andreas Degert

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)

Quoted 15 lines
{
        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));
        }
}

This looks OK. Could you prepare a patch (with a proper changelog and your sing-off)?

Quoted 3 lines

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:

It's a wrong approach in general when the driver supports multiple hardwares. The firmware is basically strongly bound with the hardware model, so checking only the revision is dangerous as well.

Thanks,

Takashi

#2 lore raw

On Mon, 14 Jan 2008 12:00:10 +0100
Takashi Iwai <[email protected]> wrote:

[...]

Quoted 18 lines
Quoted 17 lines

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));
        }
}
Quoted 2 lines

This looks OK. Could you prepare a patch (with a proper changelog and your sing-off)?

ok, here it is:

hdsp: make Multiface II work again

This device has io_type == 1 (Multiface) and firmware_rev > 0xa (fixes regression from changeset 5326)

pci/rme9652/hdsp.c +8 -2
diff -r 1f9fd3d3cb12 -r d06a33481e0d pci/rme9652/hdsp.c
@@ -607,7 +607,10 @@ static int hdsp_playback_to_output_key (
 	case Multiface:
 	case Digiface:
 	default:
-		return (64 * out) + (32 + (in));
+		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:
@@ -621,7 +624,10 @@ static int hdsp_input_to_output_key (str
 	case Multiface:
 	case Digiface:
 	default:
-		return (64 * out) + in;
+		if (hdsp->firmware_rev == 0xa)
+			return (64 * out) + in;
+		else
+			return (52 * out) + in;
 	case H9632:
 		return (32 * out) + in;
 	case H9652:

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#3 lore raw

Hi Andreas,

Quoted 9 lines · Andreas Degert

ok, here it is:

hdsp: make Multiface II work again

This device has io_type == 1 (Multiface) and firmware_rev > 0xa (fixes regression from changeset 5326)

[..]

I was one of the Digiface users with problems with the new driver revisions. Although I don't know to which tree to apply your patch, I edited alsa-drver-1.0.15 by hand, and so far after a quick test I can confirm that it's working with my Digiface. Thank you very much.

Best regards
Christian

Signature · 8 lines
------------------------------------------------------------------------
Dipl.-Phys. Christian Schumann   |Technische Universitaet Kaiserslautern
Mail: [email protected]  |           Fachbereich Physik
Tel.: 0631/205-4842 (Office)     |     http://www.physik.uni-kl.de 
Tel.: 0631/205-4843 (Lab)        |
Fax.: 0631/205-3902              |    
Post: Erwin-Schroedinger-Strasse, D-67663 Kaiserslautern
-------------------------------------------------------------------------
Applied
#4 lore raw
In reply to Andreas Degert

At Tue, 15 Jan 2008 20:42:15 +0100,

Quoted 26 lines · Andreas Degert

On Mon, 14 Jan 2008 12:00:10 +0100
Takashi Iwai <[email protected]> wrote:

[...]

Quoted 18 lines
Quoted 17 lines

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));
        }
}
Quoted 2 lines

This looks OK. Could you prepare a patch (with a proper changelog and your sing-off)?

Quoted 8 lines

ok, here it is:

hdsp: make Multiface II work again

This device has io_type == 1 (Multiface) and firmware_rev > 0xa (fixes regression from changeset 5326)

Applied to HG tree now. Thanks!

Takashi