Page MenuHomeFreeBSD

snd_hdsp(4): RME HDSP 9632 and HDSP 9652 sound card driver.
ClosedPublic

Authored by dev_submerge.ch on May 7 2024, 12:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 5, 12:10 PM
Unknown Object (File)
Oct 14 2024, 9:22 AM
Unknown Object (File)
Oct 7 2024, 10:42 AM
Unknown Object (File)
Oct 7 2024, 10:42 AM
Unknown Object (File)
Oct 7 2024, 10:17 AM
Unknown Object (File)
Sep 23 2024, 4:06 AM
Unknown Object (File)
Sep 20 2024, 5:51 AM
Unknown Object (File)
Sep 14 2024, 9:23 AM
Subscribers

Details

Summary

Add a sound(4) bridge device driver for the RME HDSP 9632 and HDSP 9652
sound cards. These cards require a nowadays rare PCI 32bit (not PCIe)
slot, but still see use due to their value and wealth of features.
The HDSP 9632 is mostly comparable to the newer HDSPe AIO, while the
HDSP 9652 is similar to the HDSPe RayDAT. These HDSPe PCIe cards are
supported by the snd_hdspe(4) driver which was taken as a starting point
for development of snd_hdsp(4).

Implementation is kept separately due to substantial differences in
hardware configuration and to allow easy removal in case PCI 32bit
support would be phased out in the future.

The snd_hdsp(4) kernel module is not enabled by default, and can be
loaded at runtime with kldload(8) or during boot via loader.conf(5).
Basic operation was tested with both cards, not including all optional
cable connectors and expansion boards. Features should be roughly on par
with the snd_hdspe(4) supported cards.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

For those not familiar with snd_hdspe(4), it may be best to compare this with the hdspe.h, hdspe.c and hdspe-pcm.c files in the same directory (sys/dev/sound/pci).

I'll try to find other people who own a HDSP card and may be able to test this with hardware through multimedia@. Apart from that I'm happy for some more eyes on the code and eventually someone to commit it.

@christos I wanted to keep you in the loop here, since you were about to remove some PCI drivers. Also it may give you an idea what features could be possibly supported by mixer(8) or some future audioctl tool. Among those are:

  • Analog input levels (Lo Gain, +4dBu, -10dBV), similar to recsrc settings.
  • Analog output levels for line (Hi Gain, +4dBu, -10dBV) and phones (0dB, -6dB, -12dB)
  • Various options regarding SPDIF input and output.
  • n x n hardware mixer for both input -> output and playback -> output routing.
  • Show sync state and select clock source for digital inputs.

The last point is already implemented as sysctl, but would be a good fit for mixer(4), IMHO. I may also implement analog levels as sysctl in a followup commit, since phones output is awfully loud ATM.

good idea — these cards are high in quality to cost ratio, if not the best out all the PCI/PCIe cards we have?

sys/dev/sound/pci/hdsp-pcm.c
412

in case of error, is devlist initialized to pass it to free() ?
you can just return 1 here I think

lwhsu added inline comments.
sys/modules/sound/driver/hdsp/Makefile
2

Very minor stuff: the first while line in other older Makefile was coming from the leftover of removing the VCS comment line. For new Makefile I don't think it's really necessary.

sys/dev/sound/pci/hdsp-pcm.c
412

The promise given in device_get_children(9) is that it leaves the parameters unchanged on error, but no word about allocation. I think the correct solution is to initialize devlist and devcount parameters, then we can return here or after free(). I'll probably redo the bad: label part too, it's not a good fit here.

We may want to adopt these changes in hdspe-pcm.c later.

sys/modules/sound/driver/hdsp/Makefile
2

This is an artifact from the hdspe Makefile I copied, thanks for reporting.

Address the issues reported by Li-Wen Hsu and Ruslan Bukin.

@br does hdsp_running() look correct now? I did some brief tests, seems to work.

I do not really have the hardware to test the driver, but the code looks good to me at a first glance.

This revision is now accepted and ready to land.May 9 2024, 4:39 PM