[PlanetCCRMA] Re: patch #1 for hdsp MIDI

Mark Knecht markknecht@attbi.com
Mon Jan 13 14:17:01 2003


Fernando,
   Attached is a patch for the MIDI timing problem on all of the RME
HDSP line. (HDSP 9652 - my card, as well as the DigiFace/MultiFace
products that use the same driver).

   I'd like to request that you try patching the Alsa stuff with this so
that we can test it out. Please remember that additional 1 line patch
that checks for the HDSP card also.

   Thanks very much in advance for helping with this. No major rush.
Just drop me a note and let me know roughly when you think you can get
to this so I can plan my time.

   I am not clear why Paul called this Path #1, unless it's just to keep
things straight should there be a second path later.

Cheers,
Mark

On Mon, 2003-01-13 at 13:34, Paul Davis wrote:
> Index: hdsp.c
> ===================================================================
> RCS file: /cvsroot/alsa/alsa-kernel/pci/rme9652/hdsp.c,v
> retrieving revision 1.16
> diff -u -u -r1.16 hdsp.c
> --- hdsp.c      7 Jan 2003 10:36:32 -0000       1.16
> +++ hdsp.c      13 Jan 2003 13:32:32 -0000
> @@ -817,10 +817,18 @@
>  
>  static inline int snd_hdsp_midi_output_possible (hdsp_t *hdsp, int id)
>  {
> +       int fifo_bytes_used;
> +
>         if (id) {
> -               return (hdsp_read(hdsp, HDSP_midiStatusOut1) & 0xff) < 128;
> +               fifo_bytes_used = hdsp_read(hdsp, HDSP_midiStatusOut1) & 0xff;
>         } else {
> -               return (hdsp_read(hdsp, HDSP_midiStatusOut0) & 0xff)< 128;
> +               fifo_bytes_used = hdsp_read(hdsp, HDSP_midiStatusOut0) & 0xff;
> +       }
> +
> +       if (fifo_bytes_used < 128) {
> +               return  128 - fifo_bytes_used;
> +       } else {
> +               return 0;
>         }
>  }