HDA Driver with adjustable buffer size for lower latency

This is the Haiku (~alpha 4 and later) HDA driver (“High Definition Audio”) modified to use an optional settings file to set sample rate, buffer size, and number of buffers.

You will need it if your machine has HDA and you want to do real-time audio, as the distributed OS still supplies a driver with unusable latency! (see https://dev.haiku-os.org/ticket/9134)

Installation — PM era

On a machine with Package Management, you will need to put the driver in the ‘non-packaged’ hierarchy. You will have to install both the driver and a link.

Move (or copy) the “hda” file to:

/boot/system/non-packaged/add-ons/kernel/drivers/bin/

(This folder should exist but will in most cases be empty.) Then create a link to that file as:

/boot/system/non-packaged/add-ons/kernel/drivers/dev/hda

(Either right-button drag the original file to the ‘dev’ folder and select “Create Link”, or use the “ln -s” command from a Terminal.)

You wil also want to install a settings file — see below.

Installation — old pre-PM system

First preserve the standard driver:

/boot/system/add-ons/kernel/drivers/bin/hda

either by moving it elsewhere or renaming it. (The Tracker will warn you, but you will only lose audio temporarily.) Then move or copy the hda driver from here to that location.

Settings (all systems):

To customize things, edit the hda_settings file to your liking, and put it in:

/boot/home/config/settings/kernel/drivers

Then restart Media Services from the Media Preferences.

The play settings in the file are what I currently use. Shortening the buffer much more breaks things. Note that if you specify the sample-rate in the file, you will no longer be able to set it in the Media Preferences. If you want the latter, comment out the line in the file (and make sure you set it in the Prefs).