History log of /linux-master/sound/firewire/digi00x/digi00x.h
Revision Date Author Comments
# 9067c181 07-Jun-2021 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: firewire-digi00x: cease from delayed card registration

The delayed registration of sound card instance brings less benefit than
complication of kobject management. This commit ceases from it.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210607081250.13397-6-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 76c4ecbe 17-Oct-2019 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: firewire-digi00x: share PCM buffer size for both direction

This commit allows ALSA firewire-digi00x driver to share PCM buffer
size for both capture and playback PCM substream. When AMDTP domain
starts for one of the PCM substream, buffer size of the PCM substream
is stores to AMDTP domain structure. Some AMDTP streams have already
run with the buffer size when another PCM substream starts, therefore
the PCM substream has a constraint to its buffer size.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20191017155424.885-7-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 18b7f18f 07-Oct-2019 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: firewire-digi00x: register the size of PCM period to AMDTP domain

This commit is a preparation to share the size of PCM period between
PCM substreams on AMDTP streams in the same domain. At this time,
the size of PCM period in PCM substream which starts AMDTP streams in the
same domain is recorded.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20191007110532.30270-7-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 9a08067e 04-Aug-2019 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: firewire-digi00x: support AMDTP domain

This commit adds AMDTP domain support for ALSA firewire-digi00x driver.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# b9434540 18-Jun-2019 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: firewire-digi00x: unify stop and release method for duplex streams

>From callbacks for pcm and rawmidi interfaces, the functions to stop
and release duplex streams are called at the same time. This commit
merges the two functions.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# ae8ffbb2 11-Jun-2019 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: firewire-digi00x: reserve/release isochronous resources in pcm.hw_params/hw_free callbacks

Once allocated, isochronous resources are available for packet
streaming, even if the streaming is cancelled. For this reason,
current implementation handles allocation of the resources and
starting packet streaming at the same time. However, this brings
complicated procedure to start packet streaming.

This commit separates the allocation and starting. The allocation is
done in pcm.hw_params callback and available till pcm.hw_free callback.
Even if any XRUN occurs, pcm.prepare callback is done to restart
packet streaming without releasing/allocating the resources.

There are two points to stop packet streaming; in pcm.hw_params and
pcm.prepare callbacks. The former point is a case that packet streaming
is already started for any MIDI substream then packet streaming is
requested with different sampling transfer frequency for any PCM
substream. The latter point is cases of any XRUN or packet queueing
error.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# da607e19 29-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 345

Based on 1 normalized pattern(s):

licensed under the terms of the gnu general public license version 2

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

has been chosen to replace the boilerplate/reference in 88 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190530000437.521539229@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a02cb8f8 22-May-2017 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: firewire: remove support for 16 bit PCM samples in playback substream

In IEC 61883-6, AM824 is described as format of data block. In this
format, one data block consists of several data channels, which is aligned
to 32 bit. One data channel has 8 bit label field and 24 bit data field.
PCM frames are transferred in Multi Bit Linear Audio (MBLA) data channel.
This channel can include 16/20/24 bit PCM sample.

As long as I know, models which support IEC 61883-1/6 doesn't allow to
switch bit length of PCM sample in MBLA data channel. They always
transmit/receive PCM frames of 24 bit length. This can be seen for the
other models which support protocols similar to IEC 61883-1/6.

On the other hand, current drivers for these protocols supports 16 bit
length PCM sample in playback substream. In this case, PCM sample is put
into the MBLA data channel with 8 bit padding in LSB side. Although 16
bit PCM sample is major because it's in CD format, this doesn't represent
device capability as is.

This commit removes support for 16 bit PCM samples in playback substream.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# fdb2b2ee 02-Apr-2017 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: firewire-digi00x: remove transaction handler for unknown purpose

For digi00x series, asynchronous transaction is not used to transfer MIDI
messages to/from control surface. One of transction handlers in my previous
work loses its practical meaning.

This commit removes the handler. I note that unit of console type
transfers 0x00001000 to registered address of host space when switching
to 'standalone' mode. Then the unit generates bus reset.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 13e005f9 02-Apr-2017 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: firewire-digi00x: add support for console models of Digi00x series

Digi00x series includes two types of unit; rack and console. As long as
reading information on config rom of Digi 002 console, 'MODEL_ID' field
has a different value from the one on Digi 002 rack.

We've already got a test report from users with Digi 003 rack. We can
assume that console type and rack type has different value in the field.

This commit adds a device entry for console type. For following commits,
this commit also adds a member to 'struct snd_digi00x' to identify console
type.

$ cd linux-firewire-utils/src
$ python2 ./crpp < /sys/bus/firewire/devices/fw1/config_rom
ROM header and bus information block
-----------------------------------------------------------------
400 0404f9d0 bus_info_length 4, crc_length 4, crc 63952
404 31333934 bus_name "1394"
408 60647002 irmc 0, cmc 1, isc 1, bmc 0, cyc_clk_acc 100, max_rec 7 (256)
40c 00a07e00 company_id 00a07e |
410 00a30000 device_id 0000a30000 | EUI-64 00a07e0000a30000

root directory
-----------------------------------------------------------------
414 00058a39 directory_length 5, crc 35385
418 0c0043a0 node capabilities
41c 04000001 hardware version
420 0300a07e vendor
424 81000007 --> descriptor leaf at 440
428 d1000001 --> unit directory at 42c

unit directory at 42c
-----------------------------------------------------------------
42c 00046674 directory_length 4, crc 26228
430 120000a3 specifier id
434 13000001 version
438 17000001 model
43c 81000007 --> descriptor leaf at 458

descriptor leaf at 440
-----------------------------------------------------------------
440 00055913 leaf_length 5, crc 22803
444 000050f2 descriptor_type 00, specifier_ID 50f2
448 80000000
44c 44696769
450 64657369
454 676e0000

descriptor leaf at 458
-----------------------------------------------------------------
458 0004a6fd leaf_length 4, crc 42749
45c 00000000 textual descriptor
460 00000000 minimal ASCII
464 44696769 "Digi"
468 20303032 " 002"

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 174cd4b1 02-Feb-2017 Ingo Molnar <mingo@kernel.org>

sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h>

Fix up affected files that include this signal functionality via sched.h.

Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>


# 86c8dd7f 30-Mar-2016 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: firewire-digi00x: delayed registration of sound card

When some digi00x units are connected sequentially, userspace
applications are involved at bus-reset state on IEEE 1394 bus. In the
state, any communications can be canceled. Therefore, sound card
registration should be delayed till the bus gets calm.

This commit achieves it.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# b47f525f 10-Oct-2015 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: firewire-digi00x: add support of asynchronous transaction for outgoing MIDI messages to physical controls

In previous commit, asynchronous transaction for incoming MIDI messages
from physical controls is supported. The physical controls may be
controlled by receiving MIDI messages at a certain address.

This commit supports asynchronous transaction for this purpose.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 3646a54a 10-Oct-2015 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: firewire-digi00x: add support of asynchronous transaction for incoming MIDI messages from physical controls

Digi 00x series has two types of model; rack and console. The console
models have physical controls. The model can transmit control messages.
These control messages are transferred by asynchronous transactions to
registered address.

This commit supports the asynchronous transaction.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 9fbfd38b 10-Oct-2015 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: firewire-digi00x: add support for MIDI ports corresponding to isochronous packet streaming

This commit adds MIDI functionality to capture/playback MIDI messages
from/to physical MIDI ports. These messages are transferred in isochronous
packets.

When no substreams request AMDTP streams to run, this driver starts the
streams at current sampling rate. When other substreams start at different
sampling rate, the streams are stopped temporarily, then start again at
requested sampling rate. This operation can generate missing MIDI bytes,
thus it's preferable to start PCM substreams at favorite sampling rate in
advance.

Digi 002/003 console also has a set of MIDI port for physical controls.
These ports are added in later commits.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 9dc5d31c 10-Oct-2015 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: firewire-digi00x: handle MIDI messages in isochronous packets

In Digi 002/003 protocol, MIDI messages are transferred in the last data
channel of data blocks. Although this data channel has a label of 0x80,
it's not fully MIDI conformant data channel especially because the Counter
field always zero independently of included MIDI bytes. The 4th byte of
the data channel in LSB tells the number of included MIDI bytes. This byte
also includes the number of MIDI port. Therefore, the data format in this
data channel is:
* 1st: 0x80 as label
* 2nd: MIDI bytes
* 3rd: 0 or MIDI bytes
* 4th: the number of MIDI byte and the number of MIDI port

This commit adds support of MIDI messages in data block processing layer.

Like AM824 data format, this data channel has a capability to transfer
more MIDI messages than the capability of phisical MIDI bus. Therefore, a
throttle for data rate is required to prevent devices' internal buffer to
overflow.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 44b73088 29-Sep-2015 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: firewire-digi00x: add support for asynchronous messaging

Digi 002/003 family uses asynchronous transaction for messaging.
The address to transmit this message is stored on a certain register.

This commit allocates a range of address on OHCI 1394 host controller
to handle the messaging. As long as I know, the purpose of this message
seems to notify lost of synchronization. While, the meaning of content
of the message is not clear.

Actual examples of this messaging:
* When clock source is set as internal:
- 0x00007051
- 0x00007052
- 0x00007054
- 0x00007057
- 0x00007058
* When clock source is set as somewhat external:
- 0x00009000
- 0x00009010
- 0x00009020
- 0x00009021
- 0x00009022

The lost often occurs when using internal clock source. In this case,
users hear sounds with quite short gap every several minutes. In fact,
the lost is recovered temporarily.

When using with external clock source, the lost seems not to occur. The
mechanism is not clear yet.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 660dd3d5 29-Sep-2015 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: firewire-digi00x: add hwdep interface

This commit adds hwdep interface so as the other sound drivers for units
on IEEE 1394 bus have.

This interface is designed for mixer/control applications. By using this
interface, an application can get information about firewire node, can
lock/unlock kernel streaming and can get notification at starting/stopping
kernel streaming.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 0120d0f1 29-Sep-2015 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: firewire-digi00x: add PCM functionality

This commit adds PCM functionality to transmit/receive PCM samples.

Any PCM substreams are jointed because incoming/outgoing AMDTP streams
are bound. When one of PCM substream is running or external clock source
is selected, current sampling rate is used. Else, the sampling rate is
changed as an userspace application requests.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 927f17dc 29-Sep-2015 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: firewire-digi00x: add proc node to show clock status

This commit adds proc node to show current clock status for debugging.

As long as testing Digi 002 rack, registers can show local clock rate,
local clock source. When external clock input such as S/PDIF is
connected, the registers show the detection and external clock rate.

Additionally, the registers show the mode of optical digital input
interface. Although, a tester with Digi 003 rack reports this makes no
sense. Further investigation is required for Digi 003 series.

Besides, in Digi 002 rack, the S/PDIF format must be IEC 60958-4,
so-called professional.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 3a2a1797 29-Sep-2015 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: firewire-digi00x: add stream functionality

This commit adds a functionality to manage streaming.

The streaming is not controlled by CMP in IEC 61883-6. It's controlled by
IEEE 1394 write transaction to certain addresses.

Several clock sources are available, while there're no differences about
packet transmission. The value of SYT field in transmitted packets is
always zero. Thus, streams in both direction don't build synchronization.

And the device always requires received packets to transmit packets. This
driver keeps to transfer outgoing stream even if they're not required.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 163ae6f3 29-Sep-2015 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: firewire-digi00x: add data block processing layer

Digi 002/003 family uses its own format for data blocks. The format is
quite similar to AM824 in IEC 61883-6, while there're some differences:

* The Valid Bit Length (VBL) code is always 0x40 in Multi-bit Linear Audio
(MBLA) data channel.
* The first data channel includes MIDI messages, against IEC 61883-6
recommendation.
* The Counter field is always zero in MIDI conformant data channel.
* Sequence multiplexing in IEC 61883-6 is not applied to the MIDI
conformant data channel.
* PCM samples are scrambled in received AMDTP packets. We call the way
as Double-Oh-Three (DOT). The algorithm was discovered by
Robin Gareus and Damien Zammit in 2012.

This commit adds data processing layer to satisfy these differences.

There's a quirk about transmission mode for received packets. When this
driver applies non-blocking mode to outgoing packets with isochronous
channel 2 or more, after 15 to 20 seconds since playbacking, any PCM
samples causes noisy sound on the device. With isochronous channel 0 or 1,
this doesn't occur. As long as I investigated, this quirk is not observed
when applying blocking mode to the received packets.

This driver applies blocking mode to outgoing packets, while non-blocking
mode to incoming packgets.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 9edf723f 29-Sep-2015 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: firewire-digi00x: add skeleton for Digi 002/003 family

This commit adds a new driver for Digidesign 002/003 family. This commit
just creates/removes card instance according to bus event. More functions
will be added in following commits.

Digidesign 002/003 family consists of:
* Agere FW802B for IEEE 1394 PHY layer
* PDI 1394L40 for IEEE 1394 LINK layer and IEC 61883 interface
* ALTERA ACEX EP1K50 for IEC 61883 layer and DSP controller
* ADSP-21065L for signal processing

[minor cleanup using skip_spaces() by tiwai]

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>