Copyright ©1995 by NeXT Computer, Inc.  All Rights Reserved.




Driver Functions



DSP Functions



Start the DSP

kern_return_t snddriver_dsp_boot(port_t commandPort, int *bootImage, int imageSize, int priority)
kern_return_t snddriver_dsp_reset(port_t commandPort, int priority)


Transfer data to and from the DSP via DMA

kern_return_t snddriver_dsp_dma_write(port_t commandPort, int elementCount, int dataFormat, pointer_t data)
kern_return_t snddriver_dsp_dma_read(port_t commandPort, int elementCount, int dataFormat, pointer_t data)


Enqueue a DSP command

kern_return_t snddriver_dsp_host_cmd(port_t commandPort, u_int hostCommand, u_int priority)


Set the sound driver's protocol vis-a-vis the DSP

kern_return_t s nddriver_dsp_protocol(port_t devicePort, port_t ownerPort, int protocol)


Set the DSP host flags

kern_return_t snddriver_dsp_set_flags(port_t commandPort, u_int flagMask,u_int flagValue, u_int priority)


Transfer data to and from the DSP

kern_return_t snddriver_dsp_write(port_t commandPort, void *buffer, int elementCount, int elementSize, int priority)
kern_return_t snddriver_dsp_read(port_t commandPort, void *buffer, int elementCount, int elementSize, int priority)
kern_return_t snddriver_dsp_read_messages(port_t commandPort, void *buffer, int elementCount, int elementSize, int priority)
kern_return_t snddriver_dsp_read_data(port_t commandPort, void **buffer, int elementCount, int elementSize, int priority)


Request a DSP host interface register condition

kern_return_t snddriver_dspcmd_req_condition(port_t commandPort, u_int registerMask, u_int conditionFlags, int priority, port_t replyPort)


Request the contents of the DSP-reply buffers

kern_return_t snddriver_dspcmd_req_msg(port_t commandPort, port_t replyPort)
kern_return_t snddriver_dspcmd_req_err(port_t commandPort, port_t replyPort)


Get the DSP command port

kern_return_t snddriver_get_dsp_cmd_port(port_t devicePort, port_t ownerPort, port_t *commandPort)



Driver Setup and Access



Acquire ownership of sound resources

kern_return_t snddriver_set_dsp_owner_port(port_t devicePort, port_t ownerPort, port_t *negotiationPort)
kern_return_t snddriver_set_sndin_owner_port(port_t devicePort, port_t ownerPort, port_t *negotiationPort)
kern_return_t snddriver_set_sndout_owner_port(port_t devicePort, port_t ownerPort, port_t *negotiationPort)


Reallocate the sound driver device port

kern_return_t snddriver_new_device_port(port_t devicePort, port_t superuserPort, port_t *newDevicePort)


Respond to asynchronous sound driver messages

kern_return_t snddriver_reply_handler(msg_header_t *reply, snddriver_handlers_t *handlers)


Set and get sound playback attributes

kern_return_t snddriver_set_device_parms(port_t devicePort, boolean_t speakerOn, boolean_t filterOn, boolean_t zerofill)
kern_return_t snddriver_get_device_parms(port_t devicePort, boolean_t *speakerOn, boolean_t *filterOn, boolean_t *zerofill)
kern_return_t snddriver_set_volume(port_t devicePort, int leftVolume, int rightVolume)
kern_return_t snddriver_get_volume(port_t devicePort, int *leftVolume, int *rightVolume)
kern_return_t snddriver_set_ramp(port_t devicePort, int rampOn)



Stream Setup and Access



Configure stream transfer buffers

kern_return_t snddriver_set_sndout_bufcount(port_t devicePort, port_t sndoutPort, int count)
kern_return_t snddriver_set_sndout_bufsize(port_t devicePort, port_t sndoutPort, int size)
kern_return_t snddriver_stream_ndma(port_t streamPort, int regionTag, int count)


Control and query a stream

kern_return_t snddriver_stream_control(port_t streamPort, int regionTag, int control)
kern_return_t snddriver_stream_nsamples(port_t streamPort, int *byteCount)


Configure a sound stream

kern_return_t snddriver_stream_setup(port_t devicePort, port_t ownerPort, int dataPath, int sampleCount, int sampleSize, int lowWater, int highWater, int *protocol, port_t *streamPort)


Send data to and retrieve data fom a stream

kern_return_t snddriver_stream_start_writing(port_t streamPort, void *data, int sampleCount, int regionTag, boolean_t preempt, boolean_t deallocateWhenDone, boolean_t msgStarted, boolean_t msgCompleted, boolean_t msgAborted, boolean_t msgPaused, boolean_t msgResumed, boolean_t msgUnderrun, port_t replyPort)
kern_return_t snddriver_stream_start_reading(port_t streamPort, char *filename, int sampleCount, int regionTag, boolean_t msgStarted, boolean_t msgCompleted, boolean_t msgAborted, boolean_t msgPaused, boolean_t msgResumed, boolean_t msgOverrun, port_t replyPort)