[LAD] [RME - hdsp] Multiface/Digiface/RPM detection

Adrian Knoth adi at drcomp.erfurt.thur.de
Thu Jul 28 21:56:27 UTC 2011


On Thu, Jul 28, 2011 at 09:41:09PM +0000, Fons Adriaensen wrote:

> > After reading the kernel source, I think the code in hdsp.c is wrong:
> > 
> > 		if (hdsp_fifo_wait(hdsp, 0, HDSP_SHORT_WAIT)) {
> > 			hdsp_write(hdsp, HDSP_control2Reg, HDSP_VERSION_BIT);
> > 			hdsp_write(hdsp, HDSP_control2Reg, HDSP_S_LOAD);
> > 			if (hdsp_fifo_wait(hdsp, 0, HDSP_SHORT_WAIT))
> > 				hdsp->io_type = RPM;
> > 			else
> > 				hdsp->io_type = Multiface;
> > 		} else {
> > 			hdsp->io_type = Digiface;
> > 		}
> > 
> > 
> > Who here owns a Digiface and can confirm or deny that the kernel
> > correctly detects it as Digiface? Same for Multiface, though I guess
> > since it's more or less the default, users wouldn't notice it.
> > 
> > What's wrong with the code above? I think all occurrences of
> > HDSP_control2Reg in hdsp_check_for_iobox need to be changed to
> > HDSP_controlRegister and the second hdsp_fifo_wait needs to be inverted.
> > 
> > But this is pure guesswork. If I come up with a patch, who here has a
> > RPM, Digiface or Multiface to test it?
> 
> I have an RPM wich I'd like to use as a signal generator for measurments
> etc. (it has those nice balanced line outs). But I never managed to make
> it work, despite trying 1000 variations on the code you quoted. It hangs
> in one of the hdsp_fifo_wait(), I don't remember which one.

I blindly wrote a patch:

   http://adi.loris.tv/hdsp_test.tar.bz2

Does it work? If you like and if it's possible to get remote access to
your machine, I'm happy to give it a whirl and start hacking.

I'm somewhat surprised to see so many "wrong" constants in hdsp.c, like
HDSP_fifoData being 368. I have no idea why it is there, I always
thought the fifo write register is 92. (that's what I've changed in the
hdsp_test.tar.bz2, too)

There are even more occurrences of control2Reg in hdsp.c which I would
change to controlRegister, especially in
snd_hdsp_load_firmware_from_cache. But it cannot be totally wrong,
because I guess it must be working for some users...


Cheers



More information about the Linux-audio-dev mailing list