1. 01 Jun, 2021 7 commits
    • Takashi Sakamoto's avatar
      ALSA: dice: wait just for NOTIFY_CLOCK_ACCEPTED after GLOBAL_CLOCK_SELECT operation · 41319eb5
      Takashi Sakamoto authored
      NOTIFY_CLOCK_ACCEPTED notification is always generated as a result of
      GLOBAL_CLOCK_SELECT operation, however NOTIFY_LOCK_CHG notification
      doesn't, as long as the selected clock is already configured. In the case,
      ALSA dice driver waits so long. It's inconvenient for some devices to lock
      to the sequence of value in syt field of CIP header in rx packets.
      
      This commit wait just for NOTIFY_CLOCK_ACCEPTED notification by reverting
      changes partially done by two commits below:
      
       * commit fbeac84d ("ALSA: dice: old firmware optimization for Dice notification")
       * commit aec045b8 ("ALSA: dice: change notification mask to detect lock status change")
      
      I note that the successful lock to the sequence of value in syt field of
      CIP header in rx packets results in NOTIFY_EXT_STATUS notification, then
      EXT_STATUS_ARX1_LOCKED bit stands in GLOBAL_EXTENDED_STATUS register.
      The notification can occur enough after receiving the batch of rx packets.
      When the sequence doesn't include value in syt field of CIP header in rx
      packets adequate to the device, the notification occurs again and the bit
      is off.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Link: https://lore.kernel.org/r/20210601081753.9191-2-o-takashi@sakamocchi.jpSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      41319eb5
    • Takashi Sakamoto's avatar
      ALSA: fireface: perform sequence replay for media clock recovery · dfacca39
      Takashi Sakamoto authored
      This commit takes ALSA fireface driver to perform sequence replay for
      media clock recovery.
      
      The protocol specific to RME Fireface series is not compliant to
      IEC 61883-1/6 since it has no CIP header, therefore presentation time
      is not used for media clock recovery. The sequence of the number of data
      blocks per packet is important.
      
      I note that the device skips an isochronous cycle corresponding to an
      empty packet or a NODATA packet in blocking transmission method of
      IEC 61883-1/6. For sequence replay, the cycle is handled as receiving an
      empty packet. Furthermore, it doesn't start packet transmission till
      receiving any packet.
      
      The sequence replay is tested with below models:
      
      * Fireface 400
      * Fireface 800
      * Fireface 802
      
      I note that it is better to initialize Fireface 400 in advance by
      initialization transaction implemented in snd-fireface-ctl-service of
      snd-firewire-ctl-services project. You can see whether initialized or
      not by HOST LED on the device. Unless, the device often stops packet
      transmission even if session starts.
      
      I guess the sequence replay also works well with below models:
      
      * Fireface UFX
      * Fireface UCX
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Link: https://lore.kernel.org/r/20210531025103.17880-7-o-takashi@sakamocchi.jpSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      dfacca39
    • Takashi Sakamoto's avatar
      ALSA: firewire-tascam: perform sequence replay for media clock recovery · a9dd8a61
      Takashi Sakamoto authored
      This commit takes ALSA firewire-tascam driver to perform sequence replay
      for media clock recovery.
      
      The protocol specific to Tascam FireWire series is not compliant to
      IEC 61883-1/6 in terms of syt field of CIP. The protocol doesn't use
      presentation time in received CIP for playback timing. The sequence of
      the number of data blocks per packet is important for media clock
      recovery.
      
      Although the devices in Tascam FireWire series transfer packets
      regardless of receiving packets, the tx packets includes no events
      in the beginning of streaming. It takes so long to multiplex any event
      into the packet after receiving the sequence of packets. As long as I
      experienced, it takes several thousands of isochronous cycle. Furthermore,
      just after changing sampling transmission frequency, it stops multiplexing
      event at once, then starts multiplexing again.
      
      The sequence replay is tested with below models:
       * FW-1884
       * FW-1804
       * FW-1082
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Link: https://lore.kernel.org/r/20210531025103.17880-6-o-takashi@sakamocchi.jpSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      a9dd8a61
    • Takashi Sakamoto's avatar
      ALSA: firewire-digi00x: perform sequence replay for media clock recovery · 019af592
      Takashi Sakamoto authored
      This commit takes ALSA firewire-digi00x driver to perform sequence replay
      for media clock recovery.
      
      All of models in Digidesign digi00x family don't transfer isochronous
      packets till receiving isochronous packets. The on-the-fly mode is used
      for the purpose. They don't interpret presentation time expressed in syt
      field of received CIP, therefore the sequence of the number of data blocks
      per packet is important for media clock recovery.
      
      The sequence replay is tested with below models:
      
      * Digidesign Digi 002
      * Digidesign Digi 002 Rack
      * Digidesign Digi 003
      * Digidesign Digi 003 Rack
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Link: https://lore.kernel.org/r/20210531025103.17880-5-o-takashi@sakamocchi.jpSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      019af592
    • Takashi Sakamoto's avatar
      ALSA: oxfw: perform sequence replay for media clock recovery · 029ffc42
      Takashi Sakamoto authored
      This commit takes ALSA oxfw driver to perform sequence replay for media
      clock recovery. Unfortunately, OXFW970 ASIC and its firmware has a quirk
      called jumbo payload which skips several isochronous cycles for packet
      transmission, thus the sequence replay is just adopted to OXFW971 ASIC.
      As well as Fireworks, OXFW ASICs also ignores presentation time against
      the way in IEC 61883-1/6.
      
      The sequence replay is tested with below models:
       * Tascam FireOne
       * Stanton Magnetics SCS.1m
       * Apogee Duet FireWire
      
      For below models, the sequence replay is tested to be disabled:
      
       * Griffin FireWave
       * Behringer F-Control Audio 202
       * Loud Technology Tapco Link.FireWire 4x6
       * Loud Technology Mackie Onyx Satellite
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Link: https://lore.kernel.org/r/20210531025103.17880-4-o-takashi@sakamocchi.jpSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      029ffc42
    • Takashi Sakamoto's avatar
      ALSA: fireworks: perform sequence replay for media clock recovery · a105f642
      Takashi Sakamoto authored
      Echo Digital Audio Corporation had US patent US7599388B2 titled as
      'System and method for high-bandwidth serial bus data transfer'. In the
      patent, dual-banked shared memory is used to deliver data between
      serial bus transmission and processor in FIFO way. The patent seems to be
      used for Fireworks board module. The mechanism is not compliant to
      synchronization based on presentation time expressed in syt field
      of CIP header. Fireworks board module takes care of the sequence of
      the number of data blocks per packet and just ignores the value of syt
      field.
      
      This commit takes fireworks driver to performs sequence replay for media
      clock recovery. As long as I tested, Audiofire 2 and 4 have a quirk to
      skip an isochronous cycle several thousands after starting packet
      transmission.
      
      The sequence replay is tested with below models:
       * Loud Technology Mackie 400f
       * Echo Audio Audiofire 12 (DSP model)
       * Echo Audio Audiofire 12 (FPGA model)
       * Echo Audio Audiofire 8 (DSP model)
       * Echo Audio Audiofire 8 (FPGA model)
       * Echo Audio Audiofire Pre8
       * Echo Audio Audiofire 4
       * Echo Audio Audiofire 2
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Link: https://lore.kernel.org/r/20210531025103.17880-3-o-takashi@sakamocchi.jpSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      a105f642
    • Takashi Sakamoto's avatar
      ALSA: fireworks: delete SYTMATCH clock source · 77f1fd6d
      Takashi Sakamoto authored
      In the design of Fireworks board module, the device does't adjust its
      media clock voluntarily by the sequence of presentation time expressed in
      syt field of CIP header of received packet.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Link: https://lore.kernel.org/r/20210531025103.17880-2-o-takashi@sakamocchi.jpSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      77f1fd6d
  2. 30 May, 2021 1 commit
  3. 28 May, 2021 5 commits
    • YueHaibing's avatar
      ALSA: core: use DEVICE_ATTR_*() macro · 873fd813
      YueHaibing authored
      Use DEVICE_ATTR_*() helper instead of plain DEVICE_ATTR,
      which makes the code a bit shorter and easier to read.
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Link: https://lore.kernel.org/r/20210526121828.8460-1-yuehaibing@huawei.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      873fd813
    • Takashi Sakamoto's avatar
      ALSA: firewire-lib: support NO_PERIOD_WAKEUP in ALSA PCM runtime · d360870a
      Takashi Sakamoto authored
      Drivers of ALSA firewire stack can process packets for IT/IR context in
      process context when the process operates ALSA PCM character device by
      calling ioctl(2) with some requests. The ioctl requests are:
      
       * SNDRV_PCM_IOCTL_HWSYNC
       * SNDRV_PCM_IOCTL_SYNC_PTR
       * SNDRV_PCM_IOCTL_REWIND
       * SNDRV_PCM_IOCTL_FORWARD
       * SNDRV_PCM_IOCTL_WRITEI_FRAMES
       * SNDRV_PCM_IOCTL_READI_FRAMES
       * SNDRV_PCM_IOCTL_WRITEN_FRAMES
       * SNDRV_PCM_IOCTL_READN_FRAMES
      
      This means that general application can process PCM frames apart from
      hardware IRQ invocation, even if they are programmed by either IRQ-based
      scheduling model or Timer-based scheduling model.
      
      This commit add support for Timer-based scheduling model by allowing
      PCM runtime to suppress both process wakeup per period and scheduling
      hardware IRQ.
      
      SNDRV_PCM_INFO_BATCH is obsoleted since ALSA IEC 61883-1/6 packet streaming
      engine can report the number of transferred PCM frames within PCM period
      boundary. The granularity equals to SYT_INTERVAL in blocking transmission.
      In non-blocking transmission, it doesn't equal to SYT_INTERVAL but doesn't
      exceed.
      
      This patch is tested with PulseAudio, and --sched-model option of axfer
      with fix against the issue reported at:
      
       * https://lore.kernel.org/alsa-devel/687f9871-7484-1370-04d1-9c968e86f72b@linux.intel.com/#rSigned-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Link: https://lore.kernel.org/r/20210527123253.174315-1-o-takashi@sakamocchi.jpSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      d360870a
    • Takashi Sakamoto's avatar
      ALSA: firewire-lib: transfer rx packets on-the-fly when replaying · 2f21a177
      Takashi Sakamoto authored
      Models in below series start transmission of packet after receiving the
      sequence of packets:
      
       * Digidesign Digi00x family
       * RME Fireface series
      
      Additionally, models in Tascam FireWire series start multiplexing PCM
      frames into packets enough after receiving packets. It's required to
      transfer packets on-the-fly for the above models according to nominal
      sampling transfer frequency before starting sequence replay.
      
      This commit allows drivers to decide whether the engine transfers packet
      on-the-fly or not.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Link: https://lore.kernel.org/r/20210527122611.173711-4-o-takashi@sakamocchi.jpSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      2f21a177
    • Takashi Sakamoto's avatar
      ALSA: firewire-lib: replay sequence of incoming packets for outgoing packets · 39c2649c
      Takashi Sakamoto authored
      ALSA IEC 61883-1/6 packet streaming engine uses pre-computed parameters
      ideal for nominal sampling transfer frequency (STF) to transfer packets
      to device since it was added 2011. As a result of user experience for a
      decade, it is clear that the sequence is not suitable to some actual
      devices. It takes the devices to generate noise, and causes any type of
      discontinuity in the series of packet transferred from the device. It's
      required for the engine to transfer packets according to effective STF.
      
      The effective STF is given by media clock recovered by the sequence of
      packet transferred from the target device. In the previous commit, the
      sequence is already cached. The media clock recovery can be achieved by
      analyzing the sequence.
      
      In technological world, many ideas are proposed for media clock recovery.
      However, the small part of them could be actually adopted in our case
      since floating point arithmetic is not mostly available in Linux kernel
      land.
      
      This commit adopts the simple way from them; sequence replay, which means
      that the sequence of parameters from incoming packet is used as is to
      transfer outgoing packets. The media clock is not computed internally,
      but the sequence of outgoing packet superficially looks to be generated by
      the media clock.
      
      The association between source and destination is decided when starting
      AMDTP domain. When the target device supports a pair of isochronous packet
      streams, the tx stream is source and the rx stream is destination. When it
      supports two pair of streams, each of tx stream is associated to
      corresponding rx stream in its order. When it supports less number of tx
      streams than rx streams, the fist tx stream is selected for all of rx
      streams. When it supports more tx streams than rx streams, the first tx
      packet is associated to the rx stream.
      
      As I noted in previous commit, the sequence of parameters from incoming
      packet is different between devices, time to time. It is worse idea to
      replay the sequence of parameters from a device for the sequence of
      packet to the other devices even if they are in the same category of
      device.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Link: https://lore.kernel.org/r/20210527122611.173711-3-o-takashi@sakamocchi.jpSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      39c2649c
    • Takashi Sakamoto's avatar
      ALSA: firewire-lib: add replay target to cache sequence of packet · f9e5ecdf
      Takashi Sakamoto authored
      In design of audio and music unit in IEEE 1394 bus, feedback of
      effective sampling transfer frequency (STF) is delivered by packets
      transferred from device. The devices supported by ALSA firewire stack
      are categorized to three groups regarding to it.
      
       * Group 1:
         * Echo Audio Fireworks board module
         * Oxford Semiconductor OXFW971 ASIC
         * Digidesign Digi00x family
         * Tascam FireWire series
         * RME Fireface series
      
       * Group 2:
         * BridgeCo. DM1000/DM1100/DM1500 ASICs for BeBoB solution
         * TC Applied Technologies DICE ASICs
      
       * Group 3:
         * Mark of the Unicord FireWire series
      
      In group 1, the effective STF is determined by the sequence of the number
      of events per packet. In group 2, the sequence of presentation timestamp
      expressed in syt field of CIP header is interpreted as well. In group 3,
      the presentation timestamp is expressed in source packet header (SPH) of
      each data block.
      
      I note that some models doesn't take care of effective STF with large
      internal buffer. It's reasonable to name it as group 0:
      
       * Group 0
         * Oxford Semiconductor OXFW970 ASIC
      
      The effective STF is known to be slightly different from nominal STF for
      all of devices, and to be different between the devices. Furthermore, the
      effective STF is known to be shifted for long-period transmission. This
      makes it hard for software to satisfy the effective STF when processing
      packets to the device.
      
      The effective STF is deterministic as a result of analyzing the batch of
      packet transferred from the device. For the analysis, caching the sequence
      of parameter in the packet is required.
      
      This commit adds an option so that AMDTP domain structure takes AMDTP
      stream structure to cache the sequence of parameters in packet transferred
      from the device. The parameters are offset ticks of syt field against the
      cycle to receive the packet and the number of data blocks per packet.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Link: https://lore.kernel.org/r/20210527122611.173711-2-o-takashi@sakamocchi.jpSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      f9e5ecdf
  4. 27 May, 2021 4 commits
  5. 25 May, 2021 15 commits
  6. 22 May, 2021 7 commits
  7. 21 May, 2021 1 commit