15 Jan, 2017

1 commit


11 Sep, 2016

1 commit


02 Sep, 2016

1 commit

  • Check for snd_pcm_ops structures that are only stored in the ops field of a
    snd_soc_platform_driver structure or passed as the third argument to
    snd_pcm_set_ops. The corresponding field or parameter is declared const,
    so snd_pcm_ops structures that have this property can be declared as const
    also.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r disable optional_qualifier@
    identifier i;
    position p;
    @@
    static struct snd_pcm_ops i@p = { ... };

    @ok1@
    identifier r.i;
    struct snd_soc_platform_driver e;
    position p;
    @@
    e.ops = &i@p;

    @ok2@
    identifier r.i;
    expression e1, e2;
    position p;
    @@
    snd_pcm_set_ops(e1, e2, &i@p)

    @bad@
    position p != {r.p,ok1.p,ok2.p};
    identifier r.i;
    struct snd_pcm_ops e;
    @@
    e@i@p

    @depends on !bad disable optional_qualifier@
    identifier r.i;
    @@
    static
    +const
    struct snd_pcm_ops i = { ... };
    //

    Signed-off-by: Julia Lawall
    Reviewed-by: Takashi Sakamoto
    Acked-by: Clemens Ladisch
    Signed-off-by: Takashi Iwai

    Julia Lawall
     

31 Aug, 2016

2 commits

  • In hwdep interface of fireworks driver, accessing to user space is in a
    critical section with disabled local interrupt. Depending on architecture,
    accessing to user space can cause page fault exception. Then local
    processor stores machine status and handles the synchronous event. A
    handler corresponding to the event can call task scheduler to wait for
    preparing pages. In a case of usage of single core processor, the state to
    disable local interrupt is worse because it don't handle usual interrupts
    from hardware.

    This commit fixes this bug, performing the accessing outside spinlock. This
    commit also gives up counting the number of queued response messages to
    simplify ring-buffer management.

    Reported-by: Vaishali Thakkar
    Cc: stable@vger.kernel.org
    Fixes: 555e8a8f7f14('ALSA: fireworks: Add command/response functionality into hwdep interface')
    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     
  • In hwdep interface of firewire-tascam driver, accessing to user space is
    in a critical section with disabled local interrupt. Depending on
    architecture, accessing to user space can cause page fault exception. Then
    local processor stores machine status and handle the synchronous event. A
    handler corresponding to the event can call task scheduler to wait for
    preparing pages. In a case of usage of single core processor, the state to
    disable local interrupt is worse because it doesn't handle usual interrupts
    from hardware.

    This commit fixes this bug, by performing the accessing outside spinlock.

    Reported-by: Vaishali Thakkar
    Cc: stable@vger.kernel.org
    Fixes: e5e0c3dd257b('ALSA: firewire-tascam: add hwdep interface')
    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     

24 Aug, 2016

2 commits


18 May, 2016

1 commit

  • Commit a9c4284bf5a9 ("ALSA: firewire-lib: add context information to
    tracepoints") adds new members to tracepoint events of this module, to
    represent context information. One of the members is bool type and
    this causes sparse warnings.

    16:1: warning: expression using sizeof bool
    60:1: warning: expression using sizeof bool
    16:1: warning: odd constant _Bool cast (ffffffffffffffff becomes 1)
    60:1: warning: odd constant _Bool cast (ffffffffffffffff becomes 1)

    This commit suppresses the warnings, by changing type of the member
    to 'unsigned int'. Additionally, this commit applies '!!' idiom to
    get 0/1 from 'in_interrupt()'.

    Fixes: a9c4284bf5a9 ("ALSA: firewire-lib: add context information to tracepoints")
    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     

12 May, 2016

3 commits

  • On most of audio and music units on IEEE 1394 bus which ALSA firewire stack
    supports (or plans to support), CIP with two quadlets header is used.
    Thus, there's no cases to queue packets with blank payload. If such packets
    are going to be queued, it means that they're for skips of the cycle.

    This commit simplifies helper functions to queue a packet.

    Signed-off-by: Takashi Sakamoto
    Acked-by: Clemens Ladisch
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     
  • In current implementation, packet processing is done in both of software
    IRQ contexts of IR/IT contexts and process contexts.

    This is usual interrupt handling of IR/IT context for 1394 OHCI.
    (in hardware IRQ context)
    irq_handler() (drivers/firewire/ohci.c)
    ->tasklet_schedule()
    (in software IRQ context)
    handle_it_packet() or handle_ir_packet_per_buffer() (drivers/firewire/ohci.c)
    ->flush_iso_completions()
    ->struct fw_iso_context.callback.sc()
    = out_stream_callback() or in_stream_callback()

    However, we have another chance for packet processing. It's done in PCM
    frame handling via ALSA PCM interfaces.
    (in process context)
    ioctl(i.e. SNDRV_PCM_IOCTL_HWSYNC)
    ->snd_pcm_hwsync() (sound/core/pcm_native.c)
    ->snd_pcm_update_hw_ptr() (sound/core/pcm_lib.c)
    ->snd_pcm_update_hw_ptr0()
    ->struct snd_pcm_ops.pointer()
    = amdtp_stream_pcm_pointer()
    ->fw_iso_context_flush_completions() (drivers/firewire/core-iso.c)
    ->struct fw_card_driver.flush_iso_completions()
    = ohci_flush_iso_completions() (drivers/firewire/ohci.c)
    ->flush_iso_completions()
    ->struct fw_iso_context.callback.sc()
    = out_stream_callback() or in_stream_callback()

    This design is for a better granularity of PCM pointer. When ioctl(2) is
    executed with some commands for ALSA PCM interface, queued packets are
    handled at first. Then, the latest number of handled PCM frames is
    reported. The number can represent PCM frames transferred in most near
    isochronous cycle.

    Current tracepoints include no information to distinguish running contexts.
    When tracing the interval of software IRQ context, this is not good.

    This commit adds more information for current context. Additionally, the
    index of packet processed in one context is added in a case that packet
    processing is executed in continuous context of the same kind,

    As a result, the output includes 11 fields with additional two fields
    to commit 0c95c1d6197f ("ALSA: firewire-lib: add tracepoints to dump a part
    of isochronous packet data"):
    17131.9186: out_packet: 07 7494 ffc0 ffc1 00 000700c0 9001a496 058 45 1 13
    17131.9186: out_packet: 07 7495 ffc0 ffc1 00 000700c8 9001ba00 058 46 1 14
    17131.9186: out_packet: 07 7496 ffc0 ffc1 00 000700d0 9001ffff 002 47 1 15
    17131.9189: out_packet: 07 7497 ffc0 ffc1 00 000700d0 9001d36a 058 00 0 00
    17131.9189: out_packet: 07 7498 ffc0 ffc1 00 000700d8 9001e8d4 058 01 0 01
    17131.9189: out_packet: 07 7499 ffc0 ffc1 00 000700e0 9001023e 058 02 0 00
    17131.9206: in_packet: 07 7447 ffc1 ffc0 01 3f070072 9001783d 058 32 1 00
    17131.9206: in_packet: 07 7448 ffc1 ffc0 01 3f070072 90ffffff 002 33 1 01
    17131.9206: in_packet: 07 7449 ffc1 ffc0 01 3f07007a 900191a8 058 34 1 02
    (Here, some common fields are omitted so that a line is within 80
    characters.)

    The legend is:
    - The second of cycle scheduled for the packet
    - The count of cycle scheduled for the packet
    - The ID of node as source (hex)
    - The ID of node as destination (hex)
    - The value of isochronous channel
    - The first quadlet of CIP header (hex)
    - The second quadlet of CIP header (hex)
    - The number of included quadlets
    - The index of packet in a buffer maintained by this module
    - 0 in process context, 1 in IRQ context
    - The index of packet processed in the context

    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     
  • …etter PCM period granularity

    These three commits were merged to improve PCM pointer granularity.
    commit 76fb87894828 ("ALSA: firewire-lib: taskletize the snd_pcm_period_elapsed() call")
    commit e9148dddc3c7 ("ALSA: firewire-lib: flush completed packets when reading PCM position")
    commit 92b862c7d685 ("ALSA: firewire-lib: optimize packet flushing")

    The point of them is to handle queued packets not only in software IRQ
    context of IR/IT contexts, but also in process context. As a result of
    handling packets, period tasklet is scheduled when acrossing PCM period
    boundary. This is to prevent recursive call of
    'struct snd_pcm_ops.pointer()' in the same context.

    When the pointer callback is executed in the process context, it's
    better to avoid the second callback in the software IRQ context. The
    software IRQ context runs immediately after scheduled in the process
    context because few packets are queued yet.

    For the aim, 'pointer_flush' is used, however it causes a race condition
    between the process context and software IRQ context of IR/IT contexts.

    Practically, this race is not so critical because it influences process
    context to skip flushing queued packet and to get worse granularity of
    PCM pointer. The race condition is quite rare but it should be improved
    for stable service.

    The similar effect can be achieved by using 'in_interrupt()' macro. This
    commit obsoletes 'pointer_flush' with it.

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

    Takashi Sakamoto
     

10 May, 2016

7 commits

  • In former commit, drivers in ALSA firewire stack always starts IT context
    before IR context. If IR context starts after packets are transmitted by
    peer unit, packet discontinuity may be detected because the context starts
    in the middle of packet streaming. This situation is rare because IT
    context usually starts immediately. However, it's better to solve this
    issue. This is suppressed with CIP_SKIP_INIT_DBC_CHECK flag.

    This commit enables the same feature as CIP_SKIP_INIT_DBC_CHECK.

    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     
  • In previous commit, this module has no need to reuse parameters of
    incoming packets for outgoing packets anymore. This commit arranges some
    needless codes for outgoing packet processing.

    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     
  • In previous commit, this module has no need to reuse parameters of
    incoming packets for outgoing packets anymore. This commit arranges some
    needless codes for incoming packet processing.

    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     
  • In clause 6.3 of IEC 61883-6:2000, there's an explanation about processing
    of presentation timestamp. In the clause, we can see "If a function block
    receives a CIP, processes it and subsequently re-transmits it, then the
    SYT of the outgoing CIP shall be the sum of the incoming SYT and the
    processing delay." ALSA firewire stack has an implementation to partly
    satisfy this specification. Developers assumed the stack to perform as an
    Audio function block[1].

    Following to the assumption, current implementation of ALSA firewire stack
    use one software interrupt context to handle both of in/out packets. In
    most case, this is processed in 1394 OHCI IR context independently of the
    opposite context. Thus, this implementation uses longer CPU time in the
    software interrupt context. This is not better for whole system.

    Against the assumption, I confirmed that each ASIC for IEC 61883-1/6
    doesn't necessarily expect it to the stack. Thus, current implementation
    of ALSA firewire stack includes over-engineering.

    This commit purges the implementation. As a result, packets of one
    direction are handled in one software interrupt context and spends
    minimum CPU time.

    [1] [alsa-devel] [PATCH 0/8] [RFC] new driver for Echo Audio's Fireworks based devices
    http://mailman.alsa-project.org/pipermail/alsa-devel/2013-June/062660.html

    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     
  • In packet streaming protocol applied to TASCAM FireWire series, the value
    of SYT field in CIP header is always zero, therefore it has no meaning.
    There's no need to synchronize packets in both direction for the series.

    In current implementation of ALSA firewire stack, driver for the series
    uses incoming packet parameter for outgoing packet parameter to calculate
    the number of data blocks. This can be simplified because the task of
    corresponding driver is to transfer data blocks enough to sampling transfer
    frequency.

    This commit purges support of full duplex synchronization to prevent
    over-engineering implementation.

    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     
  • On Fireworks board module of Echo Audio, TSB43Cx43A (IceLynx Micro, iCEM)
    is used to process payload of isochronous packets. There's an public
    document of this chip[1]. This document is for firmware programmers to
    transfer/receive AMDTP with IEC60958 data format, however in clause 2.5,
    2.6 and 2.7, we can see system design to utilize the sequence of value in
    SYT field of CIP header. In clause 2.3, we can see the specification of
    Audio Master Clock (MCLK) from iCEM.

    Well, this clock is actually not used for sampling clock. This can be
    confirmed when corresponding driver transfer random value as the sequence
    of SYT field. Even if in this case, the unit generates proper sound.

    Additionally, in unique command set for this board module, the format
    of CIP is changed; for IEC 61883-6 mode which we use, and for Windows
    Operating System. In the latter mode, the whole 32 bit field in second CIP
    header from Windows driver is used to represent counter of packets (NO-DATA
    code is still used for packets without data blocks). If the master clock
    was physically used by DSP on the board module, the Windows driver must
    have transferred correct sequence of SYT field.

    Furthermore, as long as seeing capacities of AudioFire2, AudioFire4,
    AudioFire8, AudioFirePre8 and AudioFire12, these models don't support
    SYT-Match clock source.

    Summary, we have no need to relate incoming/outgoing packets. This commit
    drops reusing SYT sequence of incoming packets for outgoing packets.

    [1] Using TSB43Cx43A: S/PDIF over 1394 (2003, Texus Instruments
    Incorporated)
    http://www.ti.com/analog/docs/litabsmultiplefilelist.tsp?literatureNumber=slla148&docCategoryId=1&familyId=361

    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     
  • Windows driver for BeBoB-based models mostly wait for transmitted packets,
    then transfer packets to the models. This looks for the relationship
    between incoming packets and outgoing packets to synchronize the sequence
    of presentation timestamp.

    However, the sequence between packets of both direction has no
    relationship. Even if receiving NO-DATA packets, the drivers transfer
    packets with meaningful value in SYT field. Additionally, the order of
    starting packets is always the same, independently of the source of clock.
    The corresponding driver is expected as a generator of presentation
    timestamp and these models can select it as a source of sampling clock.

    This commit drops reusing SYT sequence from ALSA bebob driver. The driver
    always transfer packets with presentation timestamp generated by ALSA
    firewire stack, without re-using the sequence of value in SYT field in
    incoming packets to outgoing packets.

    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     

09 May, 2016

3 commits

  • When audio and music units have some quirks in their sequence of packet,
    it's really hard for non-owners to identify the quirks. Although developers
    need dumps for sequence of packets, it's difficult for users who have no
    knowledges and no equipments for this purpose.

    This commit adds tracepoints for this situation. When users encounter
    the issue, they can dump a part of packet data via Linux tracing framework
    as long as using drivers in ALSA firewire stack.

    Additionally, tracepoints for outgoing packets will be our help to check
    and debug packet processing of ALSA firewire stack.

    This commit newly adds 'snd_firewire_lib' subsystem with 'in_packet' and
    'out_packet' events. In the events, some attributes of packets and the
    index of packet managed by this module are recorded per packet.

    This is an usage:

    $ trace-cmd record -e snd_firewire_lib:out_packet \
    -e snd_firewire_lib:in_packet
    /sys/kernel/tracing/events/snd_firewire_lib/out_packet/filter
    /sys/kernel/tracing/events/snd_firewire_lib/in_packet/filter
    Hit Ctrl^C to stop recording
    ^C
    $ trace-cmd report trace.dat
    ...
    23647.033934: in_packet: 01 4073 ffc0 ffc1 00 000f0040 9001b2d1 122 44
    23647.033936: in_packet: 01 4074 ffc0 ffc1 00 000f0048 9001c83b 122 45
    23647.033937: in_packet: 01 4075 ffc0 ffc1 00 000f0050 9001ffff 002 46
    23647.033938: in_packet: 01 4076 ffc0 ffc1 00 000f0050 9001e1a6 122 47
    23647.035426: out_packet: 01 4123 ffc1 ffc0 01 010f00d0 9001fb40 122 17
    23647.035428: out_packet: 01 4124 ffc1 ffc0 01 010f00d8 9001ffff 002 18
    23647.035429: out_packet: 01 4125 ffc1 ffc0 01 010f00d8 900114aa 122 19
    23647.035430: out_packet: 01 4126 ffc1 ffc0 01 010f00e0 90012a15 122 20
    (Here, some common fields are omitted so that a line to be within 80
    characters.)
    ...

    One line represent one packet. The legend for the last nine fields is:
    - The second of cycle scheduled for the packet
    - The count of cycle scheduled for the packet
    - The ID of node as source (hex)
    - Some devices transfer packets with invalid source node ID in their CIP
    header.
    - The ID of node as destination (hex)
    - The value is not in CIP header of packets.
    - The value of isochronous channel
    - The first quadlet of CIP header (hex)
    - The second quadlet of CIP header (hex)
    - The number of included quadlets
    - The index of packet in a buffer maintained by this module

    This is an example to parse these lines from text file by Python3 script:

    \#!/usr/bin/env python3
    import sys

    def parse_ts(second, cycle, syt):
    offset = syt & 0xfff
    syt >>= 12
    if cycle & 0x0f > syt:
    cycle += 0x10
    cycle &= 0x1ff0
    cycle |= syt
    second += cycle // 8000
    cycle %= 8000
    # In CYCLE_TIMER of 1394 OHCI, second is represented in 8 bit.
    second %= 128
    return (second, cycle, offset)

    def calc_ts(second, cycle, offset):
    ts = offset
    ts += cycle * 3072
    # In DMA descriptor of 1394 OHCI, second is represented in 3 bit.
    ts += (second % 8) * 8000 * 3072
    return ts

    def subtract_ts(minuend, subtrahend):
    # In DMA descriptor of 1394 OHCI, second is represented in 3 bit.
    if minuend < subtrahend:
    minuend += 8 * 8000 * 3072
    return minuend - subtrahend

    if len(sys.argv) != 2:
    print('At least, one argument is required for packet dump.')
    sys.exit()

    filename = sys.argv[1]

    data = []

    prev = 0
    with open(filename, 'r') as f:
    for line in f:
    pos = line.find('packet:')
    if pos < 0:
    continue

    pos += len('packet:')
    line = line[pos:].strip()
    fields = line.split(' ')

    datum = []

    datum.append(fields[8])

    syt = int(fields[6][4:], 16)

    # Empty packet in IEC 61883-1, or NODATA in IEC 61883-6
    if syt == 0xffff:
    data_blocks = 0
    else:
    payload_size = int(fields[7], 10)
    data_block_size = int(fields[5][2:4], 16)
    data_blocks = (payload_size - 2) / data_block_size
    datum.append(data_blocks)

    second = int(fields[0], 10)
    cycle = int(fields[1], 10)
    start = (second << 25) | (cycle << 12)
    datum.append('0x{0:08x}'.format(start))
    start = calc_ts(second, cycle, 0)

    datum.append("0x" + fields[5])
    datum.append("0x" + fields[6])

    if syt == 0xffff:
    second = 0
    cycle = 0
    tick = 0
    else:
    second, cycle, tick = parse_ts(second, cycle, syt)
    ts = calc_ts(second, cycle, tick)
    datum.append(start)
    datum.append(ts)
    if ts == 0:
    datum.append(0)
    datum.append(0)
    else:
    # Usual case, or a case over 8 seconds.
    if ts > start or start > 7 * 8000 * 3072:
    datum.append(subtract_ts(ts, start))
    if ts > prev or start > 7 * 8000 * 3072:
    gap = subtract_ts(ts, prev)
    datum.append(gap)
    else:
    datum.append('backward')
    else:
    datum.append('invalid')
    prev = ts

    data.append(datum)

    sys.exit()

    The data variable includes array with these elements:
    - The index of the packet
    - The number of data blocks in the packet
    - The value of cycle count (hex)
    - The value of CIP header 1 (hex)
    - The value of CIP header 2 (hex)
    - The value of cycle count (tick)
    - The value of calculated presentation timestamp (tick)
    - The offset between the cycle count and presentation timestamp
    - The elapsed ticks from the previous presentation timestamp

    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     
  • In callback function of isochronous context, modules can queue packets to
    indicated isochronous cycles. Although the cycle to queue a packet is
    deterministic by calculation, this module doesn't implement the calculation
    because it's useless for processing.

    In future, the cycle count is going to be printed with the other parameters
    for debugging. This commit is the preparation. The cycle count is computed
    by cycle unit, and correctly arranged to corresponding packets. The
    calculated count is used in later commit.

    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     
  • In callback function of isochronous context, u32 variable is passed for
    cycle count. The value of this variable comes from DMA descriptors of 1394
    Open Host Controller Interface (1394 OHCI). In the specification, DMA
    descriptors transport lower 3 bits for second field and full cycle field in
    16 bits field, therefore 16 bits of the u32 variable are available. The
    value for second is modulo 8, and the value for cycle is modulo 8,000.

    Currently, ALSA firewire-lib module don't use the value of the second
    field, because the value is useless to calculate presentation timestamp in
    IEC 61883-6. However, the value may be useful for debugging. In later
    commit, it will be printed with the other parameters for debugging.

    This commit makes this module to handle the whole cycle count including
    second. The value is calculated by cycle unit. The existed code is already
    written with ignoring the value of second, thus this commit causes no
    issues.

    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     

08 May, 2016

1 commit

  • M-Audio Profire 610 has an unexpected value in version field of its config
    ROM, thus ALSA dice driver is not assigned to the model due to a mismatch
    of modalias.

    This commit adds an entry to support the model. I expect the entry is
    also for Profire 2626.

    I note that Profire 610 uses TCD2220 (so-called Dice Jr.), and supports a
    part of Extended Application Protocol (EAP).

    $ cd linux-firewire-utils/src
    $ ./crpp < /sys/bus/firewire/devices/fw1/config_rom
    ROM header and bus information block
    ------------------------------------------------------------
    400 04047689 bus_info_length 4, crc_length 4, crc 30345
    404 31333934 bus_name "1394"
    408 e0ff8112 irmc 1, cmc 1, isc 1, bmc 0, pmc 0, cyc_clk_acc 255,
    max_rec 8 (512), max_rom 1, gen 1, spd 2 (S400)
    40c 000d6c04 company_id 000d6c |
    410 04400002 device_id 0404400002 | EUI-64 000d6c0404400002

    root directory
    ------------------------------------------------------------
    414 000695fe directory_length 6, crc 38398
    418 03000d6c vendor
    41c 8100000a --> descriptor leaf at 444
    420 17000011 model
    424 8100000d --> descriptor leaf at 458
    428 0c0087c0 node capabilities per IEEE 1394
    42c d1000001 --> unit directory at 430

    unit directory at 430
    ------------------------------------------------------------
    430 0004fb14 directory_length 4, crc 64276
    434 12000d6c specifier id
    438 130100d1 version
    43c 17000011 model
    440 8100000c --> descriptor leaf at 470

    descriptor leaf at 444
    ------------------------------------------------------------
    444 0004b8e4 leaf_length 4, crc 47332
    448 00000000 textual descriptor
    44c 00000000 minimal ASCII
    450 4d2d4175 "M-Au"
    454 64696f00 "dio"

    descriptor leaf at 458
    ------------------------------------------------------------
    458 00053128 leaf_length 5, crc 12584
    45c 00000000 textual descriptor
    460 00000000 minimal ASCII
    464 50726f46 "ProF"
    468 69726520 "ire "
    46c 36313000 "610"

    descriptor leaf at 470
    ------------------------------------------------------------
    470 00053128 leaf_length 5, crc 12584
    474 00000000 textual descriptor
    478 00000000 minimal ASCII
    47c 50726f46 "ProF"
    480 69726520 "ire "
    484 36313000 "610"

    $ cat /proc/asound/card1/dice
    sections:
    global: offset 10, size 90
    tx: offset 100, size 142
    rx: offset 242, size 282
    ext_sync: offset 524, size 4
    unused2: offset 0, size 0
    global:
    owner: ffc0:000100000000
    notification: 00000040
    nick name: FW610
    clock select: internal 48000
    enable: 1
    status: locked 48000
    ext status: 00000040
    sample rate: 48000
    version: 1.0.4.0
    clock caps: 32000 44100 48000 88200 96000 176400 192000 aes1 aes4 aes adat tdif wc arx1 arx2 internal
    clock source names: SPDIF\AES34\AES56\TOS\AES_ANY\ADAT\ADAT_AUX\Word Clock\Unused\Unused\Unused\Unused\Internal\\
    ...

    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     

25 Apr, 2016

1 commit

  • When some tascam 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
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     

31 Mar, 2016

7 commits

  • 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
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     
  • Some oxfw based units tends to fail asynchronous communication when
    IEEE 1394 bus is under bus-reset state. When registering sound card
    instance at unit probe callback, userspace applications can be involved
    to the state.

    This commit postpones the registration till the bus is calm.

    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     
  • When some fireworks 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
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     
  • Some bebob based units tends to fail asynchronous communication when
    IEEE 1394 bus is under bus-reset state. When registering sound card
    instance at unit probe callback, userspace applications can be involved
    to the state.

    This commit postpones the registration till the bus is calm.

    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     
  • In former commit, ALSA dice driver postpone sound card registration after
    IEEE 1394 bus is calm. This idea has advantages for the other drivers.

    This commit adds a helper function for it to firewire-lib module. The
    function is really for the specific purpose. Callers should initialize
    delayed work structure with callback function.

    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     
  • In former commit, ALSA dice driver doesn't generate kernel warnings
    when unplugging units before initializing stream data.

    This commit moves the initialization to delayed registration of sound
    card, to simplify unit probe processing.

    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     
  • When any of AMDTP stream data are not initialized and private data is
    going to be released, WARN_ON() in amdtp_stream_destroy() is hit and
    dump messages. This may take users irritated.

    This commit fixes the bug to skip releasing when it's not initialized.

    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     

28 Mar, 2016

5 commits


10 Mar, 2016

1 commit


09 Mar, 2016

4 commits

  • Some models reduce the number of available isochronous streams for higher
    sampling transfer frequency. Such models bring an issue about how to add
    PCM substreams. When at lower sampling transfer frequency, the
    models reports whole available streams, thus this driver can add enough
    number of PCM substreams at probing time. On the other hand, at higher
    sampling transfer frequency, this driver can just add reduced number of
    PCM substreams. After probed, even if the sampling transfer frequency is
    changed to lower rate, fewer PCM substreams are actually available. This
    is inconvenience.

    For the reason, this commit adds a list so that this driver assume models
    on the list to have two pairs of PCM substreams. This list keeps the name
    of model in which the number of available streams differs depending on
    sampling transfer frequency.

    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     
  • In former commits, ALSA dice driver can handle available isochronous
    streams. This commit adds support for several PCM substreams on the
    streams.

    The additional PCM substreams are available via another ALSA PCM character
    devices so that one ALSA PCM application can handle them without cumbersome
    operations. For example, two PCM substreams are available on each stream,
    two ALSA character devices are added for them. In configuration space of
    alsa-lib, it's represented with 'hw:0,0' and 'hw:0,1'.

    The PCM substreams are constraint to parameters of the corresponding
    streams. If the PCM substreams are unavailable for some reasons,
    open(2) to ALSA PCM character device returns error and reports ENXIO.

    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     
  • This commit enables ALSA dice driver to handle whole available streams.

    In Dice, certain registers represent the number of available streams at
    current sampling transfer frequency for both directions. The parameters
    of each stream are represented in a block of register. This block is
    aligned sequentially. These streams start simultaneously by writing
    enable bit to a register.

    This commit operates these registers when starting/stopping streams.

    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     
  • Currently ALSA dice driver handles a pair of isochronous resources for
    IEC 61883-1/6 packet streaming. While, according to some documents about
    ASICs named as 'Dice', several isochronous streams are available.

    Here, I start to describe ASICs produced under 'Dice' name.
    * Dice II (designed by wavefront semiconductor, including TCAT's IP)
    * STD (with limited functionality of DTCP)
    * CP (with full functionality of DTCP)
    * TCD2210/2210-E (so-called 'Dice Mini')
    * TCD2220/2220-E (so-called 'Dice Jr.')
    * TCD3070-CH (so-called 'Dice III')

    Some documents are public and we can see hardware design of them. We can
    find some articles about hardware internal register definitions
    (not registers exported to IEEE 1394 bus).

    * DICE II User Guide
    * http://www.tctechnologies.tc/archive/downloads/dice_ii_user_guide.pdf
    * 6.1 AVS Audio Receivers
    * Table 6.1: AVS Audio Receiver Memory Map
    * ARX1-ARX4
    * 6.2 AVS Audio Transmitters
    * Table 6.2: AVS Audio Transmitter Memory Map
    * ATX1, ATX2
    * TCD22xx User Guide
    * http://www.tctechnologies.tc/downloads/tcd22xx_user_guide.pdf
    * 6.1 AVS Audio Receivers
    * Table 66: AVS Audio Receiver Memory Map
    * ARX1, ARX2
    * 6/2 AVS Audio Transmitters
    * Table 67: AVS Audio Transmitter Memory Map
    * ATX1, ATX2
    * DICE III
    * http://www.tctechnologies.tc/downloads/TCD3070-CH.pdf
    * Dual stream 63 channel transmitter/receiver

    For Dice II and TCD22xx series, maximum 16 data channels are transferred in
    an AMDTP packet, while for Dice III, maximum 32 data channels are
    transferred.

    According to the design of the series of these ASICs, this commit allows
    this driver to handle additional set of isochronous resources. For
    practical reason, two pair of isochronous resources are added. As of this
    commit, this driver still use a pair of the first isochronous resources.

    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto