Skip to contentSkip to conversation

DSP2000 Midi In - Not a correct fix??

DISCUSSION Applied Alan Horstmann 4 participants 6 messages Jan 29, 2008 – Feb 6, 2008

lore
Share & tools
lore
#0 lore raw

I think it is time to post my investigations so far...

re: Hoontech DSP2000 Midi In non-functional

see : https://bugtrack.alsa-project.org/alsa-bug/view.php?id=55

             https://bugtrack.alsa-project.org/alsa-bug/view.php?id=1161
             https://bugtrack.alsa-project.org/alsa-bug/view.php?id=1846

I missed a fix patch in March 07 for this as it was put on a later duplicate of the bug report I had contributed to. However I noticed JK closing -> resolved these in Jan 08, so tried the patch:

    http://hg.alsa-project.org/alsa-kernel/rev/319688a93b6e
Quoted 1 line

From my testing, it seems the only part necessary is:-

- for (box = 0; box < 4; box++) {
+ for (box = 0; box < 1; box++) {

as it is successful without the rest.

However I feel this is not really a correct fix, preventing use of multiple boxes in code that originally allowed it. The code is a little strange and has taken me a while to approximately grasp. What seems to be going wrong is that when a second box is configured (ie box = 1) the function

	snd_ice1712_stdsp24_box_midi(...)

switches the midi input off box[0]. If box[1] has ICE1712_STDSP24_BOX_MIDI1 set in it's config, then midi in and out can work on box[1] instead of box[0], but otherwise it is just stopped on box[0]. After many hours/days of tests I still can't propose a definite way to fix this function to provide correct configuration to all 4 allowed boxes, as I really don't understand why the code does all the gpio writes that it does. Unfortunately I do not have any circuit information either. In some way it seems to be latching some of the configuration data, but not all.

Clemens, can you remember anything about this change:

	http://hg.alsa-project.org/alsa-kernel/rev/a42043505e46

-was it someone else's patch or did you work on this?

I am hoping that someone can contribute enough of an idea about this to help formulate a proper fix. Unfortunately, as the bugs are closed, I can not continue the discussions there.

Alan

#1 lore raw
Quoted 16 lines · Alan Horstmann

I think it is time to post my investigations so far...

re: Hoontech DSP2000 Midi In non-functional

   see :  https://bugtrack.alsa-project.org/alsa-bug/view.php?id=55
             https://bugtrack.alsa-project.org/alsa-bug/view.php?id=1161
             https://bugtrack.alsa-project.org/alsa-bug/view.php?id=1846

I missed a fix patch in March 07 for this as it was put on a later duplicate of the bug report I had contributed to. However I noticed JK closing -> resolved these in Jan 08, so tried the patch:

    http://hg.alsa-project.org/alsa-kernel/rev/319688a93b6e

From my testing, it seems the only part necessary is:-

Quoted 7 lines

- for (box = 0; box < 4; box++) {
+ for (box = 0; box < 1; box++) {

as it is successful without the rest.

However I feel this is not really a correct fix, preventing use of multiple boxes in code that originally allowed it. The code is a little strange and

Do you have configuration with mutiple boxes? If yes, we can continue to work on a proper fix. Othewise, I would just keep a working configuration for single box only.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.

#2 lore raw
Quoted 13 lines · Jaroslav Kysela
Quoted 12 lines · Alan Horstmann

re: Hoontech DSP2000 Midi In non-functional

   see :  https://bugtrack.alsa-project.org/alsa-bug/view.php?id=55
             https://bugtrack.alsa-project.org/alsa-bug/view.php?id=1161
             https://bugtrack.alsa-project.org/alsa-bug/view.php?id=1846

From my testing, it seems the only part necessary is:-

- for (box = 0; box < 4; box++) {
+ for (box = 0; box < 1; box++) {

Quoted 8 lines
Quoted 4 lines

as it is successful without the rest.

However I feel this is not really a correct fix, preventing use of multiple boxes in code that originally allowed it.

Do you have configuration with mutiple boxes? If yes, we can continue to work on a proper fix. Othewise, I would just keep a working configuration for single box only.

I can understand your sentiment and it is true I have only a single box (which can be set to any of box[0] to [3]), but it seems a regression to prevent correct configuring of audio on multiple boxes (which has worked fine in the past) just because of a problem in the Midi part. The next better step than the patch on 1.0.16rc1 is to only allow midi config on box[0] with

	 if (box == 0)
in front of
	 snd_ice1712_stdsp24_box_midi(..)

However, things have moved on here, in that I do now have a proposed alternative. One step on from the above approach is to call this function only if

	ICE1712_STDSP24_BOX_MIDI1

is set for that particular box, rather than setting the parameter 'activate'. This approach does create a complete and effective solution, which I have tested here, being able (using the boxconfigs) to set channels and Midi In on any box designated 0-3, and Midi out 1 & 2 are active for all boxes once set on any.

Soon I will put this together into a patch for review, so that there is at least something definite to discuss.

And

Quoted 9 lines · Clemens Ladisch
Quoted 5 lines · Alan Horstmann

Clemens, can you remember anything about this change:

	http://hg.alsa-project.org/alsa-kernel/rev/a42043505e46

-was it someone else's patch or did you work on this?

That change is based on the Windows driver source code (which I no longer have) and some guesswork; I never had the hardware.

Thanks Clemens, that is useful to know.

Alan

#3 lore raw
Quoted 4 lines · Alan Horstmann

However, things have moved on here, in that I do now have a proposed alternative. One step on from the above approach is to call this function only if

	ICE1712_STDSP24_BOX_MIDI1
Quoted 8 lines

is set for that particular box, rather than setting the parameter 'activate'. This approach does create a complete and effective solution, which I have tested here, being able (using the boxconfigs) to set channels and Midi In on any box designated 0-3, and Midi out 1 & 2 are active for all boxes once set on any.

Soon I will put this together into a patch for review, so that there is at least something definite to discuss.

I have now generated this patch, together with a fair amount of testing various configurations, and it is attached.

The original MIDI-IN non-functioning is caused because when

	snd_ice1712_stdsp24_box_midi(..)

is called with the 3rd parameter 'activate' set to 0, it messes up any previously midi-configured boxes. Thus the zero configs of [1],[2],[3] in the standard code un-set the active midi config of [0] since they happen afterwards. This patch ensures the function is only called to activate a config and not to set it off. As a result configs can be set for any of [0] to [3] successfully.

The various bits are clearly not operating as would be expected. If _MIDI2 is not set, midi out2 still functions, but midi in1 (on first 401 uart) does not. However, no other box can use this , as only one can be the midi source. And, _MIDI1 actually enables input on the second 401 uart. Therfore there really is no value in the separate _MIDI2 config and function. It would be more logical to combine in a single midi config function (it was like this in Alsa 1.0.1, but changed sometime later).

I have included some explanitary text in the code patch which attempts to give some idea of the config issues.

However, without extensive re-working (which it seems no-one has an appetite for), this patch fixes the problem without reducing functionality in the way that January's applied patch does. The box can be set-up as any of [0] to [3]. It might be worth re-opening the 3 related bugs and seeing if the others involved can confirm this patch, as I cannot now add it to them as an alternative.

In addition, name strings are included for the mpu_401 devices so they have unique names.

Regards Alan

AHhoontech.c-midiIn-boxes.diff

Fixes the problems with Midi In on Hoontech/STA dsp24 cards, for example with DSP2000 box, without restricting the box configurations available. Also adds mpu_401 name strings.

pci/ice1712/hoontech.c renamed from pci/ice1712/hoontech.c.orig +18 -3
@@ -208,6 +208,19 @@
 			    /* ICE1712_STDSP24_MUTE |
 			       ICE1712_STDSP24_INSEL |
 			       ICE1712_STDSP24_DAREAR; */
+	/*  These boxconfigs have caused problems in the past.
+	 *  The code is not optimal, but should now enable a working config to
+	 *  be achieved.
+	 *  ** MIDI IN can only be configured on one box **
+	 *  ICE1712_STDSP24_BOX_MIDI1 needs to be set for that box.
+	 *  Tests on a ADAC2000 box suggest the box config flags do not
+	 *  work as would be expected, and the inputs are crossed.
+	 *  Setting ICE1712_STDSP24_BOX_MIDI1 and ICE1712_STDSP24_BOX_MIDI2
+	 *  on the same box connects MIDI-In to both 401 uarts; both outputs
+	 *  are then active on all boxes.
+	 *  The default config here sets up everything on the first box.
+	 *  Alan Horstmann  5.2.2008
+	 */
 	spec->boxconfig[0] = ICE1712_STDSP24_BOX_CHN1 |
 				     ICE1712_STDSP24_BOX_CHN2 |
 				     ICE1712_STDSP24_BOX_CHN3 |
@@ -223,14 +236,14 @@
 		(spec->config & ICE1712_STDSP24_MUTE) ? 1 : 0);
 	snd_ice1712_stdsp24_insel(ice,
 		(spec->config & ICE1712_STDSP24_INSEL) ? 1 : 0);
-	for (box = 0; box < 1; box++) {
+	for (box = 0; box < 4; box++) {
 		if (spec->boxconfig[box] & ICE1712_STDSP24_BOX_MIDI2)
                         snd_ice1712_stdsp24_midi2(ice, 1);
 		for (chn = 0; chn < 4; chn++)
 			snd_ice1712_stdsp24_box_channel(ice, box, chn,
 				(spec->boxconfig[box] & (1 << chn)) ? 1 : 0);
-		snd_ice1712_stdsp24_box_midi(ice, box,
-				(spec->boxconfig[box] & ICE1712_STDSP24_BOX_MIDI1) ? 1 : 0);
+		if (spec->boxconfig[box] & ICE1712_STDSP24_BOX_MIDI1)
+			snd_ice1712_stdsp24_box_midi(ice, box, 1);
 	}
 
 	return 0;
@@ -322,6 +335,8 @@
 		.name = "Hoontech SoundTrack Audio DSP24",
 		.model = "dsp24",
 		.chip_init = snd_ice1712_hoontech_init,
+		.mpu401_1_name = "MIDI-1 Hoontech/STA DSP24",
+		.mpu401_2_name = "MIDI-2 Hoontech/STA DSP24",
 	},
 	{
 		.subvendor = ICE1712_SUBDEVICE_STDSP24_VALUE,	/* a dummy id */

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

Applied
#4 lore raw

At Tue, 5 Feb 2008 14:47:30 +0000,

Quoted 50 lines · Alan Horstmann
Quoted 4 lines · Alan Horstmann

However, things have moved on here, in that I do now have a proposed alternative. One step on from the above approach is to call this function only if

	ICE1712_STDSP24_BOX_MIDI1
Quoted 8 lines

is set for that particular box, rather than setting the parameter 'activate'. This approach does create a complete and effective solution, which I have tested here, being able (using the boxconfigs) to set channels and Midi In on any box designated 0-3, and Midi out 1 & 2 are active for all boxes once set on any.

Soon I will put this together into a patch for review, so that there is at least something definite to discuss.

I have now generated this patch, together with a fair amount of testing various configurations, and it is attached.

The original MIDI-IN non-functioning is caused because when

	snd_ice1712_stdsp24_box_midi(..)

is called with the 3rd parameter 'activate' set to 0, it messes up any previously midi-configured boxes. Thus the zero configs of [1],[2],[3] in the standard code un-set the active midi config of [0] since they happen afterwards. This patch ensures the function is only called to activate a config and not to set it off. As a result configs can be set for any of [0] to [3] successfully.

The various bits are clearly not operating as would be expected. If _MIDI2 is not set, midi out2 still functions, but midi in1 (on first 401 uart) does not. However, no other box can use this , as only one can be the midi source. And, _MIDI1 actually enables input on the second 401 uart. Therfore there really is no value in the separate _MIDI2 config and function. It would be more logical to combine in a single midi config function (it was like this in Alsa 1.0.1, but changed sometime later).

I have included some explanitary text in the code patch which attempts to give some idea of the config issues.

However, without extensive re-working (which it seems no-one has an appetite for), this patch fixes the problem without reducing functionality in the way that January's applied patch does. The box can be set-up as any of [0] to [3]. It might be worth re-opening the 3 related bugs and seeing if the others involved can confirm this patch, as I cannot now add it to them as an alternative.

In addition, name strings are included for the mpu_401 devices so they have unique names.

Regards Alan

Quoted 7 lines

AHhoontech.c-midiIn-boxes.diff

Fixes the problems with Midi In on Hoontech/STA dsp24 cards, for example with DSP2000 box, without restricting the box configurations available. Also adds mpu_401 name strings.

Applied to HG tree now. Thanks.

Takashi