06 Apr, 2019

1 commit

  • [ Upstream commit b2e9e1c8810ee05c95f4d55800b8afae70ab01b4 ]

    Duende Classic was produced by Solid State Logic in 2006, as a
    first model of Duende DSP series. The following model, Duende Mini
    was produced in 2008. They are designed to receive isochronous
    packets for PCM frames via IEEE 1394 bus, perform signal processing by
    downloaded program, then transfer isochronous packets for converted
    PCM frames.

    These two models includes the same embedded board, consists of several
    ICs below:
    - Texus Instruments Inc, TSB41AB3 for physical layer of IEEE 1394 bus
    - WaveFront semiconductor, DICE II STD ASIC for link/protocol layer
    - Altera MAX 3000A CPLD for programs
    - Analog devices, SHARC ADSP-21363 for signal processing (4 chips)

    This commit adds support for the two models to ALSA dice driver. Like
    support for the other devices, packet streaming is just available.
    Userspace applications should be developed if full features became
    available; e.g. program uploader and parameter controller.

    $ ./hinawa-config-rom-printer /dev/fw1
    { 'bus-info': { 'adj': False,
    'bmc': False,
    'chip_ID': 349771402425,
    'cmc': True,
    'cyc_clk_acc': 255,
    'generation': 1,
    'imc': True,
    'isc': True,
    'link_spd': 2,
    'max_ROM': 1,
    'max_rec': 512,
    'name': '1394',
    'node_vendor_ID': 20674,
    'pmc': False},
    'root-directory': [ ['VENDOR', 20674],
    ['DESCRIPTOR', 'Solid State Logic'],
    ['MODEL', 112],
    ['DESCRIPTOR', 'Duende board'],
    [ 'NODE_CAPABILITIES',
    { 'addressing': {'64': True, 'fix': True, 'prv': True},
    'misc': {'int': False, 'ms': False, 'spt': True},
    'state': { 'atn': False,
    'ded': False,
    'drq': True,
    'elo': False,
    'init': False,
    'lst': True,
    'off': False},
    'testing': {'bas': False, 'ext': False}}],
    [ 'UNIT',
    [ ['SPECIFIER_ID', 20674],
    ['VERSION', 1],
    ['MODEL', 112],
    ['DESCRIPTOR', 'Duende board']]]]}

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

    Takashi Sakamoto
     

27 Mar, 2019

1 commit

  • commit 2d012c65a9ca26a0ef87ea0a42f1653dd37155f5 upstream.

    Current ALSA firewire-motu driver uses the value of 'model' field
    of unit directory in configuration ROM for modalias for MOTU
    FireWire models. However, as long as I checked, Pre8 and
    828mk3(Hybrid) have the same value for the field (=0x100800).

    unit | version | model
    --------------- | --------- | ----------
    828mkII | 0x000003 | 0x101800
    Traveler | 0x000009 | 0x107800
    Pre8 | 0x00000f | 0x100800
    Cc: # v4.19+
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Sakamoto
     

19 Mar, 2019

2 commits

  • commit f97a0944a72b26a2bece72516294e112a890f98a upstream.

    In data blocks of common isochronous packet for MOTU devices, PCM
    frames are multiplexed in a shape of '24 bit * 4 Audio Pack', described
    in IEC 61883-6. The frames are not aligned to quadlet.

    For capture PCM substream, ALSA firewire-motu driver constructs PCM
    frames by reading data blocks byte-by-byte. However this operation
    includes bug for lower byte of the PCM sample. This brings invalid
    content of the PCM samples.

    This commit fixes the bug.

    Reported-by: Peter Sjöberg
    Cc: # v4.12+
    Fixes: 4641c9394010 ("ALSA: firewire-motu: add MOTU specific protocol layer")
    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Sakamoto
     
  • commit 7dc661bd8d3261053b69e4e2d0050cd1ee540fc1 upstream.

    ALSA bebob driver has an entry for Focusrite Saffire Pro 10 I/O. The
    entry matches vendor_id in root directory and model_id in unit
    directory of configuration ROM for IEEE 1394 bus.

    On the other hand, configuration ROM of Focusrite Liquid Saffire 56
    has the same vendor_id and model_id. This device is an application of
    TCAT Dice (TCD2220 a.k.a Dice Jr.) however ALSA bebob driver can be
    bound to it randomly instead of ALSA dice driver. At present, drivers
    in ALSA firewire stack can not handle this situation appropriately.

    This commit uses more identical mod_alias for Focusrite Saffire Pro 10
    I/O in ALSA bebob driver.

    $ python2 crpp < /sys/bus/firewire/devices/fw1/config_rom
    ROM header and bus information block
    -----------------------------------------------------------------
    400 042a829d bus_info_length 4, crc_length 42, crc 33437
    404 31333934 bus_name "1394"
    408 f0649222 irmc 1, cmc 1, isc 1, bmc 1, pmc 0, cyc_clk_acc 100,
    max_rec 9 (1024), max_rom 2, gen 2, spd 2 (S400)
    40c 00130e01 company_id 00130e |
    410 000606e0 device_id 01000606e0 | EUI-64 00130e01000606e0

    root directory
    -----------------------------------------------------------------
    414 0009d31c directory_length 9, crc 54044
    418 04000014 hardware version
    41c 0c0083c0 node capabilities per IEEE 1394
    420 0300130e vendor
    424 81000012 --> descriptor leaf at 46c
    428 17000006 model
    42c 81000016 --> descriptor leaf at 484
    430 130120c2 version
    434 d1000002 --> unit directory at 43c
    438 d4000006 --> dependent info directory at 450

    unit directory at 43c
    -----------------------------------------------------------------
    43c 0004707c directory_length 4, crc 28796
    440 1200a02d specifier id: 1394 TA
    444 13010001 version: AV/C
    448 17000006 model
    44c 81000013 --> descriptor leaf at 498

    dependent info directory at 450
    -----------------------------------------------------------------
    450 000637c7 directory_length 6, crc 14279
    454 120007f5 specifier id
    458 13000001 version
    45c 3affffc7 (immediate value)
    460 3b100000 (immediate value)
    464 3cffffc7 (immediate value)
    468 3d600000 (immediate value)

    descriptor leaf at 46c
    -----------------------------------------------------------------
    46c 00056f3b leaf_length 5, crc 28475
    470 00000000 textual descriptor
    474 00000000 minimal ASCII
    478 466f6375 "Focu"
    47c 73726974 "srit"
    480 65000000 "e"

    descriptor leaf at 484
    -----------------------------------------------------------------
    484 0004a165 leaf_length 4, crc 41317
    488 00000000 textual descriptor
    48c 00000000 minimal ASCII
    490 50726f31 "Pro1"
    494 30494f00 "0IO"

    descriptor leaf at 498
    -----------------------------------------------------------------
    498 0004a165 leaf_length 4, crc 41317
    49c 00000000 textual descriptor
    4a0 00000000 minimal ASCII
    4a4 50726f31 "Pro1"
    4a8 30494f00 "0IO"

    $ python2 crpp < /sys/bus/firewire/devices/fw1/config_rom
    ROM header and bus information block
    -----------------------------------------------------------------
    400 040442e4 bus_info_length 4, crc_length 4, crc 17124
    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 00130e04 company_id 00130e |
    410 018001e9 device_id 04018001e9 | EUI-64 00130e04018001e9

    root directory
    -----------------------------------------------------------------
    414 00065612 directory_length 6, crc 22034
    418 0300130e vendor
    41c 8100000a --> descriptor leaf at 444
    420 17000006 model
    424 8100000e --> descriptor leaf at 45c
    428 0c0087c0 node capabilities per IEEE 1394
    42c d1000001 --> unit directory at 430

    unit directory at 430
    -----------------------------------------------------------------
    430 000418a0 directory_length 4, crc 6304
    434 1200130e specifier id
    438 13000001 version
    43c 17000006 model
    440 8100000f --> descriptor leaf at 47c

    descriptor leaf at 444
    -----------------------------------------------------------------
    444 00056f3b leaf_length 5, crc 28475
    448 00000000 textual descriptor
    44c 00000000 minimal ASCII
    450 466f6375 "Focu"
    454 73726974 "srit"
    458 65000000 "e"

    descriptor leaf at 45c
    -----------------------------------------------------------------
    45c 000762c6 leaf_length 7, crc 25286
    460 00000000 textual descriptor
    464 00000000 minimal ASCII
    468 4c495155 "LIQU"
    46c 49445f53 "ID_S"
    470 41464649 "AFFI"
    474 52455f35 "RE_5"
    478 36000000 "6"

    descriptor leaf at 47c
    -----------------------------------------------------------------
    47c 000762c6 leaf_length 7, crc 25286
    480 00000000 textual descriptor
    484 00000000 minimal ASCII
    488 4c495155 "LIQU"
    48c 49445f53 "ID_S"
    490 41464649 "AFFI"
    494 52455f35 "RE_5"
    498 36000000 "6"

    Cc: # v3.16+
    Fixes: 25784ec2d034 ("ALSA: bebob: Add support for Focusrite Saffire/SaffirePro series")
    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Sakamoto
     

26 Jan, 2019

2 commits

  • [ Upstream commit 644b2e97405b0b74845e1d3c2b4fe4c34858062b ]

    This commit fixes hard-coded model-id for an unit of Apogee Ensemble with
    a correct value. This unit uses DM1500 ASIC produced ArchWave AG (formerly
    known as BridgeCo AG).

    I note that this model supports three modes in the number of data channels
    in tx/rx streams; 8 ch pairs, 10 ch pairs, 18 ch pairs. The mode is
    switched by Vendor-dependent AV/C command, like:

    $ cd linux-firewire-utils
    $ ./firewire-request /dev/fw1 fcp 0x00ff000003dbeb0600000000 (8ch pairs)
    $ ./firewire-request /dev/fw1 fcp 0x00ff000003dbeb0601000000 (10ch pairs)
    $ ./firewire-request /dev/fw1 fcp 0x00ff000003dbeb0602000000 (18ch pairs)

    When switching between different mode, the unit disappears from IEEE 1394
    bus, then appears on the bus with different combination of stream formats.
    In a mode of 18 ch pairs, available sampling rate is up to 96.0 kHz, else
    up to 192.0 kHz.

    $ ./hinawa-config-rom-printer /dev/fw1
    { 'bus-info': { 'adj': False,
    'bmc': True,
    'chip_ID': 21474898341,
    'cmc': True,
    'cyc_clk_acc': 100,
    'generation': 2,
    'imc': True,
    'isc': True,
    'link_spd': 2,
    'max_ROM': 1,
    'max_rec': 512,
    'name': '1394',
    'node_vendor_ID': 987,
    'pmc': False},
    'root-directory': [ ['HARDWARE_VERSION', 19],
    [ 'NODE_CAPABILITIES',
    { 'addressing': {'64': True, 'fix': True, 'prv': False},
    'misc': {'int': False, 'ms': False, 'spt': True},
    'state': { 'atn': False,
    'ded': False,
    'drq': True,
    'elo': False,
    'init': False,
    'lst': True,
    'off': False},
    'testing': {'bas': False, 'ext': False}}],
    ['VENDOR', 987],
    ['DESCRIPTOR', 'Apogee Electronics'],
    ['MODEL', 126702],
    ['DESCRIPTOR', 'Ensemble'],
    ['VERSION', 5297],
    [ 'UNIT',
    [ ['SPECIFIER_ID', 41005],
    ['VERSION', 65537],
    ['MODEL', 126702],
    ['DESCRIPTOR', 'Ensemble']]],
    [ 'DEPENDENT_INFO',
    [ ['SPECIFIER_ID', 2037],
    ['VERSION', 1],
    [(58, 'IMMEDIATE'), 16777159],
    [(59, 'IMMEDIATE'), 1048576],
    [(60, 'IMMEDIATE'), 16777159],
    [(61, 'IMMEDIATE'), 6291456]]]]}

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

    Takashi Sakamoto
     
  • [ Upstream commit fba43f454cdf9caa3185219d116bd2a6e6354552 ]

    This commit adds support for APOGEE duet FireWire, launched 2007, already
    discontinued. This model uses Oxford Semiconductor FW971 as its
    communication engine. Below is information on Configuration ROM of this
    unit. The unit supports some AV/C commands defined by Audio subunit
    specification and vendor dependent commands.

    $ ./hinawa-config-rom-printer /dev/fw1
    { 'bus-info': { 'adj': False,
    'bmc': False,
    'chip_ID': 42949742248,
    'cmc': False,
    'cyc_clk_acc': 255,
    'generation': 0,
    'imc': False,
    'isc': True,
    'link_spd': 3,
    'max_ROM': 0,
    'max_rec': 64,
    'name': '1394',
    'node_vendor_ID': 987,
    'pmc': False},
    'root-directory': [ ['VENDOR', 987],
    ['DESCRIPTOR', 'Apogee Electronics'],
    ['MODEL', 122333],
    ['DESCRIPTOR', 'Duet'],
    [ 'NODE_CAPABILITIES',
    { 'addressing': {'64': True, 'fix': True, 'prv': False},
    'misc': {'int': False, 'ms': False, 'spt': True},
    'state': { 'atn': False,
    'ded': False,
    'drq': True,
    'elo': False,
    'init': False,
    'lst': True,
    'off': False},
    'testing': {'bas': False, 'ext': False}}],
    [ 'UNIT',
    [ ['SPECIFIER_ID', 41005],
    ['VERSION', 65537],
    ['MODEL', 122333],
    ['DESCRIPTOR', 'Duet']]]]}

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

    Takashi Sakamoto
     

10 Jan, 2019

4 commits

  • commit 5ef108c53e6efd695e32aad969638ccbc35b4be9 upstream.

    An initial commit to add tracepoints for packets without CIP headers
    uses different print formats for added tracepoints. However this is not
    convenient for users/developers to prepare debug tools.

    This commit uses the same format for the two tracepoints.

    Cc: # v4.12+
    Fixes: b164d2fd6e49 ('ALSA: firewire_lib: add tracepoints for packets without CIP headers')
    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Sakamoto
     
  • commit aa9a9e39b4f65733bf19d90cbd026e85a74efb99 upstream.

    An initial commit to add tracepoints for packets without CIP headers
    introduces a wrong assignment to 'data_blocks' value of
    'out_packet_without_header' tracepoint.

    This commit fixes the bug.

    Cc: # v4.12+
    Fixes: b164d2fd6e49 ('ALSA: firewire_lib: add tracepoints for packets without CIP headers')
    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Sakamoto
     
  • commit ada79fa5a0b374dd2c2262137c734da7524a8263 upstream.

    In IEC 61883-1/6 engine of ALSA firewire stack, a packet handler has a
    second argument for 'the number of bytes in payload of isochronous
    packet'. However, an incoming packet handler without CIP header uses the
    value as 'the number of quadlets in the payload'. This brings userspace
    applications to receive the number of PCM frames as four times against
    real time.

    This commit fixes the bug.

    Cc: # v4.12+
    Fixes: 3b196c394dd ('ALSA: firewire-lib: add no-header packet processing')
    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Sakamoto
     
  • commit 3d16200a3e55a39caa1c88419cb559c00316f721 upstream.

    According to my memo at hand and saved records, writing 0x00000001 to
    SND_FF_REG_FETCH_PCM_FRAMES disables fetching PCM frames in corresponding
    channel, however current implement uses reversed logic. This results in
    muted volume in device side during playback.

    This commit corrects the bug.

    Cc: # v4.12+
    Fixes: 76fdb3a9e13a ('ALSA: fireface: add support for Fireface 400')
    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Sakamoto
     

17 Dec, 2018

1 commit

  • commit fa9c98e4b975bb3192ed6af09d9fa282ed3cd8a0 upstream.

    In an initial commit, 'SYNC_STATUS' register is referred to get
    clock configuration, however this is wrong, according to my local
    note at hand for reverse-engineering about packet dump. It should
    be 'CLOCK_CONFIG' register. Actually, ff400_dump_clock_config()
    is correctly programmed.

    This commit fixes the bug.

    Cc: # v4.12+
    Fixes: 76fdb3a9e13a ('ALSA: fireface: add support for Fireface 400')
    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Sakamoto
     

17 Sep, 2018

4 commits


13 Sep, 2018

3 commits

  • Although private data of sound card instance is usually allocated in the
    tail of the instance, drivers in ALSA firewire stack allocate the private
    data before allocating the instance. In this case, the private data
    should be released explicitly at .private_free callback of the instance.

    This commit fixes memory leak following to the above design.

    Fixes: 6c29230e2a5f ('ALSA: oxfw: delayed registration of sound card')
    Cc: # v4.7+
    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     
  • Although private data of sound card instance is usually allocated in the
    tail of the instance, drivers in ALSA firewire stack allocate the private
    data before allocating the instance. In this case, the private data
    should be released explicitly at .private_free callback of the instance.

    This commit fixes memory leak following to the above design.

    Fixes: b610386c8afb ('ALSA: firewire-tascam: deleyed registration of sound card')
    Cc: # v4.7+
    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     
  • Although private data of sound card instance is usually allocated in the
    tail of the instance, drivers in ALSA firewire stack allocate the private
    data before allocating the instance. In this case, the private data
    should be released explicitly at .private_free callback of the instance.

    This commit fixes memory leak following to the above design.

    Fixes: 86c8dd7f4da3 ('ALSA: firewire-digi00x: delayed registration of sound card')
    Cc: # v4.7+
    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     

10 Sep, 2018

2 commits

  • An allocated memory forgets to be released.

    Fixes: 76fdb3a9e13 ('ALSA: fireface: add support for Fireface 400')
    Cc: # 4.12+
    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     
  • When executing 'fw_run_transaction()' with 'TCODE_WRITE_BLOCK_REQUEST',
    an address of 'payload' argument is used for streaming DMA mapping by
    'firewire_ohci' module if 'size' argument is larger than 8 byte.
    Although in this case the address should not be on kernel stack, current
    implementation of ALSA bebob driver uses data in kernel stack for a cue
    to boot M-Audio devices. This often brings unexpected result, especially
    for a case of CONFIG_VMAP_STACK=y.

    This commit fixes the bug.

    Reference: https://bugzilla.kernel.org/show_bug.cgi?id=201021
    Reference: https://forum.manjaro.org/t/firewire-m-audio-410-driver-wont-load-firmware/51165
    Fixes: a2b2a7798fb6('ALSA: bebob: Send a cue to load firmware for M-Audio Firewire series')
    Cc: # v3.16+
    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     

12 Aug, 2018

1 commit


06 Aug, 2018

1 commit

  • A commit 28b208f600a3 ('ALSA: dice: add parameters of stream formats for
    models produced by Alesis') adds wrong copy to rx parameters instead of
    tx parameters for Alesis iO26.

    This commit fixes the bug for v4.18-rc8.

    Fixes: 28b208f600a3 ('ALSA: dice: add parameters of stream formats for models produced by Alesis')
    Signed-off-by: Takashi Sakamoto
    Cc: # v4.18
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     

18 Jul, 2018

1 commit

  • snd_pcm_lib_mmap_vmalloc() was supposed to be implemented with
    somewhat special for vmalloc handling, but in the end, this turned to
    just the default handler, i.e. NULL. As the situation has never
    changed over decades, let's rip it off.

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

    Takashi Iwai
     

20 Jun, 2018

5 commits

  • This commit adds support for MOTU Traveler, launched in 2005, discontinued
    quite before. As a result, transmission of PCM frame and MIDI messages is
    available via ALSA PCM and RawMIDI/Sequencer interfaces.

    This model supports sampling transmission frequency up to 192.0 kHz, and
    AES/EBU on XLR interface and ADAT on optical interface. Unlike
    Motu 828MkII, Windows driver can switch fetching mode for DSP, like
    mute/unmute feature.

    Although this commit enables high sampling transmission frequency, actual
    sound from this model is not good. As long as I tested, it's silence at
    176.4 kHz, and it includes hissing noise at 192.0 kHz. In my opinion, as I
    reported at 3526ce7f9ba7 ('ALSA: firewire-motu: add MOTU specific protocol
    layer'), timestamping on source packet header (SPH) may not still be good
    for this model as well.

    $ python2 crpp < /sys/bus/firewire/devices/fw1/config_rom
    ROM header and bus information block
    -----------------------------------------------------------------
    400 04106505 bus_info_length 4, crc_length 16, crc 25861
    404 31333934 bus_name "1394"
    408 20001000 irmc 0, cmc 0, isc 1, bmc 0, cyc_clk_acc 0, max_rec 1 (4)
    40c 0001f200 company_id 0001f2 |
    410 0001f32f device_id 000001f32f | EUI-64 0001f2000001f32f

    root directory
    -----------------------------------------------------------------
    414 0004c65c directory_length 4, crc 50780
    418 030001f2 vendor
    41c 0c0083c0 node capabilities per IEEE 1394
    420 8d000006 --> eui-64 leaf at 438
    424 d1000001 --> unit directory at 428

    unit directory at 428
    -----------------------------------------------------------------
    428 00035955 directory_length 3, crc 22869
    42c 120001f2 specifier id
    430 13000009 version
    434 17107800 model

    eui-64 leaf at 438
    -----------------------------------------------------------------
    438 000206b2 leaf_length 2, crc 1714
    43c 0001f200 company_id 0001f2 |
    440 0001f32f device_id 000001f32f | EUI-64 0001f2000001f32f

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

    Takashi Sakamoto
     
  • For MOTU protocol version 2, this driver arranges the number of data
    chunks to align chunks to quadlet data channel. However, MOTU Traveler
    has padding bytes in the end of data block at high clock mode.

    This commit removes the arrangement. Fortunately, at low and middle clock
    mode, supported model for v2 protocol (828mkII) gets no influence from this
    change because all of combination for data chunks are just aligned to
    quadlet data channel.

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

    Takashi Sakamoto
     
  • MOTU Traveler supports AES/EBU on XLR interface and data block of rx/tx
    packet includes two chunk for the interface. This commit adds a flag
    for this purpose.

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

    Takashi Sakamoto
     
  • This driver explicitly assumes that all of supported models have main data
    chunk separated from chunk for analog ports. However, MOTU Traveler doesn't
    support the separated main data chunk.

    This commit adds a flag for the separated main data chunk.

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

    Takashi Sakamoto
     
  • In MOTU firewire protocol, data block consists of 24 bit data chunks except
    for one quadlet for source packet header (SPH). The number of data chunk in
    a data block is different between three clock modes; low, middle and high.
    When unit supports ADAT on optical interface, the data block includes some
    chunks for ADAT channels. These ADAT chunks are unavailable at high mode.

    This driver has local functions to calculate the number of ADAT chunks. But
    They uses stack for three clock modes. This is useless for higher mode.

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

    Takashi Sakamoto
     

13 Jun, 2018

2 commits

  • The kzalloc() function has a 2-factor argument form, kcalloc(). This
    patch replaces cases of:

    kzalloc(a * b, gfp)

    with:
    kcalloc(a * b, gfp)

    as well as handling cases of:

    kzalloc(a * b * c, gfp)

    with:

    kzalloc(array3_size(a, b, c), gfp)

    as it's slightly less ugly than:

    kzalloc_array(array_size(a, b), c, gfp)

    This does, however, attempt to ignore constant size factors like:

    kzalloc(4 * 1024, gfp)

    though any constants defined via macros get caught up in the conversion.

    Any factors with a sizeof() of "unsigned char", "char", and "u8" were
    dropped, since they're redundant.

    The Coccinelle script used for this was:

    // Fix redundant parens around sizeof().
    @@
    type TYPE;
    expression THING, E;
    @@

    (
    kzalloc(
    - (sizeof(TYPE)) * E
    + sizeof(TYPE) * E
    , ...)
    |
    kzalloc(
    - (sizeof(THING)) * E
    + sizeof(THING) * E
    , ...)
    )

    // Drop single-byte sizes and redundant parens.
    @@
    expression COUNT;
    typedef u8;
    typedef __u8;
    @@

    (
    kzalloc(
    - sizeof(u8) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(__u8) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(char) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(unsigned char) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(u8) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(__u8) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(char) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(unsigned char) * COUNT
    + COUNT
    , ...)
    )

    // 2-factor product with sizeof(type/expression) and identifier or constant.
    @@
    type TYPE;
    expression THING;
    identifier COUNT_ID;
    constant COUNT_CONST;
    @@

    (
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (COUNT_ID)
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * COUNT_ID
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (COUNT_CONST)
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * COUNT_CONST
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (COUNT_ID)
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * COUNT_ID
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (COUNT_CONST)
    + COUNT_CONST, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * COUNT_CONST
    + COUNT_CONST, sizeof(THING)
    , ...)
    )

    // 2-factor product, only identifiers.
    @@
    identifier SIZE, COUNT;
    @@

    - kzalloc
    + kcalloc
    (
    - SIZE * COUNT
    + COUNT, SIZE
    , ...)

    // 3-factor product with 1 sizeof(type) or sizeof(expression), with
    // redundant parens removed.
    @@
    expression THING;
    identifier STRIDE, COUNT;
    type TYPE;
    @@

    (
    kzalloc(
    - sizeof(TYPE) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    )

    // 3-factor product with 2 sizeof(variable), with redundant parens removed.
    @@
    expression THING1, THING2;
    identifier COUNT;
    type TYPE1, TYPE2;
    @@

    (
    kzalloc(
    - sizeof(TYPE1) * sizeof(TYPE2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    kzalloc(
    - sizeof(THING1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(THING1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    )

    // 3-factor product, only identifiers, with redundant parens removed.
    @@
    identifier STRIDE, SIZE, COUNT;
    @@

    (
    kzalloc(
    - (COUNT) * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    )

    // Any remaining multi-factor products, first at least 3-factor products,
    // when they're not all constants...
    @@
    expression E1, E2, E3;
    constant C1, C2, C3;
    @@

    (
    kzalloc(C1 * C2 * C3, ...)
    |
    kzalloc(
    - (E1) * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - (E1) * (E2) * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - (E1) * (E2) * (E3)
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - E1 * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    )

    // And then all remaining 2 factors products when they're not all constants,
    // keeping sizeof() as the second factor argument.
    @@
    expression THING, E1, E2;
    type TYPE;
    constant C1, C2, C3;
    @@

    (
    kzalloc(sizeof(THING) * C2, ...)
    |
    kzalloc(sizeof(TYPE) * C2, ...)
    |
    kzalloc(C1 * C2 * C3, ...)
    |
    kzalloc(C1 * C2, ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (E2)
    + E2, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * E2
    + E2, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (E2)
    + E2, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * E2
    + E2, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - (E1) * E2
    + E1, E2
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - (E1) * (E2)
    + E1, E2
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - E1 * E2
    + E1, E2
    , ...)
    )

    Signed-off-by: Kees Cook

    Kees Cook
     
  • The kmalloc() function has a 2-factor argument form, kmalloc_array(). This
    patch replaces cases of:

    kmalloc(a * b, gfp)

    with:
    kmalloc_array(a * b, gfp)

    as well as handling cases of:

    kmalloc(a * b * c, gfp)

    with:

    kmalloc(array3_size(a, b, c), gfp)

    as it's slightly less ugly than:

    kmalloc_array(array_size(a, b), c, gfp)

    This does, however, attempt to ignore constant size factors like:

    kmalloc(4 * 1024, gfp)

    though any constants defined via macros get caught up in the conversion.

    Any factors with a sizeof() of "unsigned char", "char", and "u8" were
    dropped, since they're redundant.

    The tools/ directory was manually excluded, since it has its own
    implementation of kmalloc().

    The Coccinelle script used for this was:

    // Fix redundant parens around sizeof().
    @@
    type TYPE;
    expression THING, E;
    @@

    (
    kmalloc(
    - (sizeof(TYPE)) * E
    + sizeof(TYPE) * E
    , ...)
    |
    kmalloc(
    - (sizeof(THING)) * E
    + sizeof(THING) * E
    , ...)
    )

    // Drop single-byte sizes and redundant parens.
    @@
    expression COUNT;
    typedef u8;
    typedef __u8;
    @@

    (
    kmalloc(
    - sizeof(u8) * (COUNT)
    + COUNT
    , ...)
    |
    kmalloc(
    - sizeof(__u8) * (COUNT)
    + COUNT
    , ...)
    |
    kmalloc(
    - sizeof(char) * (COUNT)
    + COUNT
    , ...)
    |
    kmalloc(
    - sizeof(unsigned char) * (COUNT)
    + COUNT
    , ...)
    |
    kmalloc(
    - sizeof(u8) * COUNT
    + COUNT
    , ...)
    |
    kmalloc(
    - sizeof(__u8) * COUNT
    + COUNT
    , ...)
    |
    kmalloc(
    - sizeof(char) * COUNT
    + COUNT
    , ...)
    |
    kmalloc(
    - sizeof(unsigned char) * COUNT
    + COUNT
    , ...)
    )

    // 2-factor product with sizeof(type/expression) and identifier or constant.
    @@
    type TYPE;
    expression THING;
    identifier COUNT_ID;
    constant COUNT_CONST;
    @@

    (
    - kmalloc
    + kmalloc_array
    (
    - sizeof(TYPE) * (COUNT_ID)
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(TYPE) * COUNT_ID
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(TYPE) * (COUNT_CONST)
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(TYPE) * COUNT_CONST
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(THING) * (COUNT_ID)
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(THING) * COUNT_ID
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(THING) * (COUNT_CONST)
    + COUNT_CONST, sizeof(THING)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(THING) * COUNT_CONST
    + COUNT_CONST, sizeof(THING)
    , ...)
    )

    // 2-factor product, only identifiers.
    @@
    identifier SIZE, COUNT;
    @@

    - kmalloc
    + kmalloc_array
    (
    - SIZE * COUNT
    + COUNT, SIZE
    , ...)

    // 3-factor product with 1 sizeof(type) or sizeof(expression), with
    // redundant parens removed.
    @@
    expression THING;
    identifier STRIDE, COUNT;
    type TYPE;
    @@

    (
    kmalloc(
    - sizeof(TYPE) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kmalloc(
    - sizeof(TYPE) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kmalloc(
    - sizeof(TYPE) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kmalloc(
    - sizeof(TYPE) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kmalloc(
    - sizeof(THING) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kmalloc(
    - sizeof(THING) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kmalloc(
    - sizeof(THING) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kmalloc(
    - sizeof(THING) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    )

    // 3-factor product with 2 sizeof(variable), with redundant parens removed.
    @@
    expression THING1, THING2;
    identifier COUNT;
    type TYPE1, TYPE2;
    @@

    (
    kmalloc(
    - sizeof(TYPE1) * sizeof(TYPE2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    kmalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    kmalloc(
    - sizeof(THING1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    kmalloc(
    - sizeof(THING1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    kmalloc(
    - sizeof(TYPE1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    |
    kmalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    )

    // 3-factor product, only identifiers, with redundant parens removed.
    @@
    identifier STRIDE, SIZE, COUNT;
    @@

    (
    kmalloc(
    - (COUNT) * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kmalloc(
    - COUNT * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kmalloc(
    - COUNT * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kmalloc(
    - (COUNT) * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kmalloc(
    - COUNT * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kmalloc(
    - (COUNT) * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kmalloc(
    - (COUNT) * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kmalloc(
    - COUNT * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    )

    // Any remaining multi-factor products, first at least 3-factor products,
    // when they're not all constants...
    @@
    expression E1, E2, E3;
    constant C1, C2, C3;
    @@

    (
    kmalloc(C1 * C2 * C3, ...)
    |
    kmalloc(
    - (E1) * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    kmalloc(
    - (E1) * (E2) * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    kmalloc(
    - (E1) * (E2) * (E3)
    + array3_size(E1, E2, E3)
    , ...)
    |
    kmalloc(
    - E1 * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    )

    // And then all remaining 2 factors products when they're not all constants,
    // keeping sizeof() as the second factor argument.
    @@
    expression THING, E1, E2;
    type TYPE;
    constant C1, C2, C3;
    @@

    (
    kmalloc(sizeof(THING) * C2, ...)
    |
    kmalloc(sizeof(TYPE) * C2, ...)
    |
    kmalloc(C1 * C2 * C3, ...)
    |
    kmalloc(C1 * C2, ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(TYPE) * (E2)
    + E2, sizeof(TYPE)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(TYPE) * E2
    + E2, sizeof(TYPE)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(THING) * (E2)
    + E2, sizeof(THING)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(THING) * E2
    + E2, sizeof(THING)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - (E1) * E2
    + E1, E2
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - (E1) * (E2)
    + E1, E2
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - E1 * E2
    + E1, E2
    , ...)
    )

    Signed-off-by: Kees Cook

    Kees Cook
     

28 May, 2018

1 commit

  • Convert the S_ symbolic permissions to their octal equivalents as
    using octal and not symbolic permissions is preferred by many as more
    readable.

    see: https://lkml.org/lkml/2016/8/2/1945

    Done with automated conversion via:
    $ ./scripts/checkpatch.pl -f --types=SYMBOLIC_PERMS --fix-inplace

    Miscellanea:

    o Wrapped one multi-line call to a single line

    Signed-off-by: Joe Perches
    Acked-by: Vinod Koul
    Signed-off-by: Takashi Iwai

    Joe Perches
     

27 May, 2018

2 commits

  • At present, all of models produced by TC Electronic except for Konnekt Live
    are supported with hard-coded their stream formats. Studio Konnekt 48 is
    sore model to support dual streams for both directions. The second stream
    has no MIDI conformant data channel in its data block. But current
    implementation transfers the second stream with MIDI conformant data
    channel.

    This commit fixes this issue.

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

    Takashi Sakamoto
     
  • TC Electronic Studio Konnekt 48 is an application of combination of
    WaveFront Dice II STD and TC Applied Technologies (TCAT) TCD2210 (Dice
    Mini). The latter is on a board with BNC and optical interfaces, thus
    used for signal processing for word clock, S/PDIF and ADAT. This model
    doesn't support TCAT extended application protocol. For such devices,
    ALSA dice driver needs to have hard-coded parameters for stream formats.

    This commit fixes stream format parameters for this model. Unfortunately, at
    sampling transmission frequencies over 48.0kHz, I confirmed that current
    ALSA dice driver doesn't drive the device appropriately to generate sounds
    (silence). I guess that this comes from timestamping quirk of Dice-based
    devices, which I reported.

    [alsa-devel] Dice packet sequence quirk and ALSA firewire stack in Linux 4.6
    http://mailman.alsa-project.org/pipermail/alsa-devel/2016-May/107715.html

    $ cd linux-firewire-utils/src
    $ python2 crpp < /sys/bus/firewire/devices/fw1/config_rom
    ROM header and bus information block
    -----------------------------------------------------------------
    400 04044a26 bus_info_length 4, crc_length 4, crc 18982
    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 00016604 company_id 000166 |
    410 08a65810 device_id 0408a65810 | EUI-64 0001660408a65810

    root directory
    -----------------------------------------------------------------
    414 00062ab9 directory_length 6, crc 10937
    418 03000166 vendor
    41c 8100000a --> descriptor leaf at 444
    420 17000022 model
    424 8100000f --> descriptor leaf at 460
    428 0c0087c0 node capabilities per IEEE 1394
    42c d1000001 --> unit directory at 430

    unit directory at 430
    -----------------------------------------------------------------
    430 0004d5c5 directory_length 4, crc 54725
    434 12000166 specifier id
    438 13000001 version
    43c 17000022 model
    440 8100000f --> descriptor leaf at 47c

    descriptor leaf at 444
    -----------------------------------------------------------------
    444 0006c490 leaf_length 6, crc 50320
    448 00000000 textual descriptor
    44c 00000000 minimal ASCII
    450 54432045 "TC E"
    454 6c656374 "lect"
    458 726f6e69 "roni"
    45c 63000000 "c"

    descriptor leaf at 460
    -----------------------------------------------------------------
    460 0006e08e leaf_length 6, crc 57486
    464 00000000 textual descriptor
    468 00000000 minimal ASCII
    46c 53747564 "Stud"
    470 696f4b6f "ioKo"
    474 6e6e656b "nnek"
    478 74343800 "t48"

    descriptor leaf at 47c
    -----------------------------------------------------------------
    47c 0006e08e leaf_length 6, crc 57486
    480 00000000 textual descriptor
    484 00000000 minimal ASCII
    488 53747564 "Stud"
    48c 696f4b6f "ioKo"
    490 6e6e656b "nnek"
    494 74343800 "t48"

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

    Takashi Sakamoto
     

22 May, 2018

1 commit


21 May, 2018

1 commit

  • TC Electronic Digital Konnekt x32 is an application of WaveFront DiceII STD
    and doesn't support TCAT extended application protocol. For such devices,
    ALSA dice driver needs to have hard-coded parameters for stream formats.

    This commit adds stream format parameters for this model. Unfortunately, at
    sampling transmission frequencies of 88.2/96.0kHz, I confirmed that current
    ALSA dice driver doesn't drive the device appropriately due to detecting
    packet discontinuities.

    $ journalctl
    kernel: snd_dice fw1.0: Detect discontinuity of CIP: 90 80

    At the frequencies, the device transfers 16 data blocks per packet and 16
    data channels per data block, as a result one packet includes 1032 bytes
    if it's not NODATA. However, as long as I checked, the device often
    postpone packet transmission and continue with truncated payload than
    metadata in isochronous packet header. Below is a sample of sequence I got.

    sec cycle bytes CIP1 CIP2
    37 3314 1032 0x01100090 0x900449E2
    37 3315 8 0x011000A0 0x9004FFFF
    37 3316 1032 0x011000A0 0x900461E2
    37 3317 1032 0x011000B0 0x900475E2
    37 3318 1032 0x011000C0 0x900489E2
    37 3319 8 0x011000D0 0x9004FFFF
    37 3320 1032 0x011000D0 0x9004A1E2
    37 3321 1032 0x011000E0 0x9004B5E2
    37 3322 1032 0x011000F0 0x9004C9E2
    37 3323 8 0x01100000 0x9004FFFF
    37 3324 1032 0x01100000 0x9004E1E2
    37 3325 1032 0x01100010 0x9004F5E2
    37 3326 1032 0x01100020 0x900409E2
    37 3327 8 0x01100030 0x9004FFFF
    37 3328 1032 0x01100030 0x900421E2
    37 3329 1032 0x01100040 0x900435E2
    37 3330 (skip)
    37 3331 (skip)
    37 3332 (skip)
    37 3333 (skip)
    37 3334 (skip)
    37 3335 (skip)
    37 3336 (skip)
    37 3337 (skip)
    37 3338 (skip)
    37 3339 (skip)
    37 3340 (skip)
    37 3341 (skip)
    37 3342 (skip)
    37 3343 (skip)
    37 3344 (skip)
    37 3345 (skip)
    37 3346 (skip)
    37 3347 (skip)
    37 3348 (skip)
    37 3349 (skip)
    37 3350 (skip)
    37 3351 (skip)
    37 3352 (skip)
    37 3353 (skip)
    37 3354 (skip)
    37 3355 (skip)
    37 3356 (skip)
    37 3357 (skip)
    37 3358 (skip)
    37 3359 (skip)
    37 3360 (skip)
    37 3361 (skip)
    37 3362 (skip)
    37 3363 (skip)
    37 3364 (skip)
    37 3365 (skip)
    37 3366 (skip)
    37 3367 1032 0x01100050 0x900461E1
    37 3368 1032 0x01100060 0x900475E1
    37 3369 1032 0x01100070 0x9004A1E1
    37 3370 1032 0x01100080 0x9004A1E1 but content of payload is truncated.
    37 3371 (skip)
    37 3371 1032 0x01100080 0x9004B5E0 detect discontinuity
    37 3372 1032 0x01100090 0x9004C9E0
    37 3373 1032 0x011000A0 0x9004E1E0
    37 3374 1032 0x011000B0 0x9004F5E0
    37 3375 1032 0x011000C0 0x900409E0
    37 3376 1032 0x011000D0 0x900421E0
    37 3377 1032 0x011000E0 0x900435E0
    37 3378 1032 0x011000F0 0x900449DF
    37 3379 8 0x01100000 0x9004FFFF
    37 3380 1032 0x01100000 0x900461DF
    37 3381 1032 0x01100010 0x900475DF
    37 3382 1032 0x01100020 0x900489DF
    37 3383 8 0x01100030 0x9004FFFF
    37 3384 1032 0x01100030 0x9004A1DF
    37 3385 1032 0x01100040 0x9004B5DF
    37 3386 1032 0x01100050 0x9004C9DF
    37 3387 8 0x01100060 0x9004FFFF

    I cannot confirm this quirks with Windows driver. ALSA dice driver has a
    cause if assumed differences between these two drivers are ways of
    timestampling to RX packets from the drivers to the device. I've already
    reported timestamping quirk of Dice-based devices and this might bring
    this issue.

    [alsa-devel] Dice packet sequence quirk and ALSA firewire stack in Linux 4.6
    http://mailman.alsa-project.org/pipermail/alsa-devel/2016-May/107715.html

    Well, nevertheless, I enable ALSA dice driver to work at the frequencies.
    This may brings inconvenience to users but I expect developers and users
    to fix it.

    $ cd linux-firewire-utils/src
    $ python2 crpp < /sys/bus/firewire/devices/fw1/config_rom
    ROM header and bus information block
    -----------------------------------------------------------------
    400 040423bb bus_info_length 4, crc_length 4, crc 9147
    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 00016604 company_id 000166 |
    410 0c232c28 device_id 040c232c28 | EUI-64 000166040c232c28

    root directory
    -----------------------------------------------------------------
    414 0006b6cb directory_length 6, crc 46795
    418 03000166 vendor
    41c 8100000a --> descriptor leaf at 444
    420 17000030 model
    424 8100000f --> descriptor leaf at 460
    428 0c0087c0 node capabilities per IEEE 1394
    42c d1000001 --> unit directory at 430

    unit directory at 430
    -----------------------------------------------------------------
    430 000476c2 directory_length 4, crc 30402
    434 12000166 specifier id
    438 13000001 version
    43c 17000030 model
    440 81000010 --> descriptor leaf at 480

    descriptor leaf at 444
    -----------------------------------------------------------------
    444 0006c490 leaf_length 6, crc 50320
    448 00000000 textual descriptor
    44c 00000000 minimal ASCII
    450 54432045 "TC E"
    454 6c656374 "lect"
    458 726f6e69 "roni"
    45c 63000000 "c"

    descriptor leaf at 460
    -----------------------------------------------------------------
    460 000772b4 leaf_length 7, crc 29364
    464 00000000 textual descriptor
    468 00000000 minimal ASCII
    46c 44696769 "Digi"
    470 74616c4b "talK"
    474 6f6e6e65 "onne"
    478 6b747833 "ktx3"
    47c 32000000 "2"

    descriptor leaf at 480
    -----------------------------------------------------------------
    480 000772b4 leaf_length 7, crc 29364
    484 00000000 textual descriptor
    488 00000000 minimal ASCII
    48c 44696769 "Digi"
    490 74616c4b "talK"
    494 6f6e6e65 "onne"
    498 6b747833 "ktx3"
    49c 32000000 "2"

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

    Takashi Sakamoto
     

18 May, 2018

2 commits

  • The "entry" pointer is always non-NULL so this test for out of bounds
    won't work.

    Fixes: f1f0f330b1d0 ("ALSA: dice: add parameters of stream formats for models produced by TC Electronic")
    Signed-off-by: Dan Carpenter
    Reviewed-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Dan Carpenter
     
  • --nextPart3916812.EicPReet6m
    Content-Transfer-Encoding: 7Bit
    Content-Type: text/plain; charset="us-ascii"

    Mytek manufactures some equipment with DICE-based firewire ports. These
    devices contain old versions of DICE firmware which lacks detailed
    stream format reporting for all sampling clock modes.

    Building upon the recent work by Takashi Sakamoto, hard-coded parameters
    are added for the Stereo 192 DSD-DAC. When the device vendor and model
    match the coded parameters are copied into the stream format cache.

    Signed-off-by: Melvin Vermeeren
    Reviewed-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Melvin Vermeeren
     

15 May, 2018

1 commit


14 May, 2018

1 commit


02 May, 2018

1 commit

  • At present, to add PCM substreams for each of available tx/rx streams,
    this driver uses a condition based on model-name. This is not enough
    to support unknown models.

    In former commits, this driver gains cache of stream formats. For models
    which support protocol extension, all of available steam formats are
    cached. For known models, hard-coded stream formats are used to generate
    the cache. For unknown models, stream formats at current mode of sampling
    transmission frequency is cached.

    Anyway, at least, the cached formats are used to expose constrains of PCM
    substreams for userspace applications. Thus, The cached data can be also
    used to add PCM substreams themselves, instead of the name-based
    conditions.

    This commit obsoletes local frag of force_two_pcms.

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

    Takashi Sakamoto