Hi Clemens, (CCed Rober von Chamier and Damien Zammit, they work for Dice and 003Rack driver)
Would you please review my patches and comment?
Currently snd-firewire-lib handles the contents of data block for AMDTP packet in itself.
But to implement drivers for Fireworks(Echo Audio)/BeBoB(BridgeCo), there is an inconvinience. Fireworks don't use AM824 label for PCM data. BeBoB needs to remap PCM and MIDI channels depending on devices.
And Dice(TC Applied Technologies) - I think you understand this than me - needs the mode called as "dual wire". In this mode, the sampling rate is a half of requested one and each data block includes the data as twice as usual sampling rate. The each data block handle two PCM frames, usually it's one.
Your snd-firewire-lib in alsa-kprivate.git repository manages to solve these issue. But it has restriction about the PCM format (S32 only) and for me it seems to be hard to maintain.
Additionally to implement full duplex with synchronization, I need to restart streams for MIDI. Then current amdtp_out_stream_set_pcm_format() is not convinient. I want to add condition for PCM format into each drivers.
Furthermore, 003Rack(Digidesign) - I don't work for this - has more issue. The differences related to payload are: - the value of syt field in AMDTP packet is always zero - The data in each channel is encoded by its own way The driver needs to refer to and modify the contents of payload.
To solve these device-dependent issues, I want to move the processing of contents in payload from firewire-lib to each devices. This series of patches is for this purpose.
sakamocchi (4): firewire-lib: add helper function to set data block size firewire-lib: add callback function for payload firewire-lib: remove unused members and functions firewire-speakers: add functions to handle payload
amdtp.c | 144 ++++++------------------------------------------------------ amdtp.h | 45 +++++++------------ speakers.c | 94 ++++++++++++++++++++++++++++++++++++--- 3 files changed, 117 insertions(+), 166 deletions(-)