1. 28 3月, 2016 4 次提交
  2. 10 3月, 2016 1 次提交
  3. 09 3月, 2016 4 次提交
    • T
      ALSA: dice: force to add two pcm devices for listed models · 7cafc65b
      Takashi Sakamoto 提交于
      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: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      7cafc65b
    • T
      ALSA: dice: handle several PCM substreams when any isochronous streams are available · 4bdc495c
      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: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      4bdc495c
    • T
      ALSA: dice: handle whole available isochronous streams · 436b5abe
      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: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      436b5abe
    • T
      ALSA: dice: have two sets of isochronous resources/streams · 8ae25b76
      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: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      8ae25b76
  4. 28 2月, 2016 1 次提交
    • T
      ALSA: dice: drop duplex streams synchronization to transfer own time stamps · 1387e3ea
      Takashi Sakamoto 提交于
      This commit drops implementation of duplex streams synchronization
      from ALSA dice driver, due to a reason of hardware design. This patch
      allows dice-based units to generate sounds correctly when isochronous
      packet streaming starts at first time.
      
      In IEC 61883-6:2005, CIP packetization layer for AM824 data format
      utilizes the value of SYT field in CIP header of received packet for
      a reference to phase lock loop. Figure 3 in clause 4.3 describes it.
      The value is an offset from cycle_time field of every cycle start packet
      from cycle master on IEEE 1394 bus. The time calculated with these two
      fields is called as 'presentation timestamp' which represents the time
      to play data included in the packet.
      
      Although, this idea includes some problems due to accuracy of timekeep in
      cycle master, accuracy of transmission of cycle start packet on the bus
      with the other units, accuracy of sampling clock in data transmitter side
      and accuracy of replay in data receiver side. In most case, these
      accuracies somewhat worse because there's no such ideal hardwares in this
      world.
      
      For the issues, ASICs for Dice include Jitter Elimination Technologies
      (JET) PLL. The PLL can handle several sources of clock and compensate it
      with high-precision internal clock source. The sequence of value in syt
      field of received AMDTP packets is one of the sources, therefore
      transmitters on IEEE 1394 bus should transfer it.
      
      On the other hand, current ALSA dice driver is programmed with a mode of
      duplex streams with synchronization. In this mode, the driver outputs
      packets after some incoming packets are handled, to re-use the value of
      SYT field in incoming packets to the value for outgoing packets. This mode
      is enabled when source signal of sampling clock is set to internal, and
      this is a major use case. Thus, in most cases, the unit receives no packets
      during a short time after packet streaming starts.
      
      As long as I experienced, this causes the units to generate no sounds at
      first time to receive packets. This issue occurs only with Dice II. I guess
      this is due to a quirk of the PLL. In short, the PLL cannot generate firm
      signals to ADCs/DACs or the other ICs when no packets are received in the
      beginning of packet streaming. While, on second time or later, the unit
      generates sound correctly. I guess that starting packet streaming at first
      time sets the PLL correctly.
      
      Well, still based on my hypothesis and no way to prove it, this commit
      drops duplex streams synchronization from this driver. At least, the PLL
      requires the sequence of value in SYT field of received AMDTP packets as
      one of source of clock signals with internal clock source.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      1387e3ea
  5. 24 2月, 2016 2 次提交
    • T
      ALSA: oxfw: discontinue MIDI substream for scs1x at transaction failure · 956dea9e
      Takashi Sakamoto 提交于
      With a previous commit, ALSA oxfw driver retries transferring MIDI
      messages at transaction failure for scs1x. On the other hand, there're
      fatal transaction error. Then, no MIDI messages reach to the unit anymore.
      In this case, MIDI substream should be terminated.
      
      This commit stops MIDI transmission after the fatal error occurs.
      Unfortunately, unlike ALSA PCM functionality, ALSA rawmidi core has no
      feature to discontinue MIDI substream runtime in kernel side, thus this
      commit just stops MIDI transmission without notifying it to userspace.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      956dea9e
    • T
      ALSA: oxfw: retry MIDI transferring for scs1x at transaction failure · b4c23ab1
      Takashi Sakamoto 提交于
      Currently, ALSA oxfw driver has a TODO to retry MIDI transferring
      at transaction failure.
      
      This commit achieves it. Current implementation uses snd_rawmidi_transmit()
      to transfer messages, thus the target MIDI messages are not in buffer when
      transaction failure is detected. Although we cannot use a pair of
      snd_rawmidi_transmit_peek() and snd_ramwidi_transmit_ack(), the
      messages are still in scs1x specific structure and the data is available
      for retries.
      
      This commit adds a member to the structure for the length of buffered
      messages, and uses the value again at retries.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      b4c23ab1
  6. 20 2月, 2016 5 次提交
    • T
      ALSA: fireworks: serialize transactions to update connections at bus reset · 99d73559
      Takashi Sakamoto 提交于
      In IEC 61883-1, at bus-reset, applications can continue isochronous
      streaming by updating connections. In ALSA fireworks driver, the
      operation is executed in 'update' handler for bus driver.
      
      The connection resources are also changed in process contexts of PCM/MIDI
      applications. Therefore, bus-reset handling has race condition
      against connection. Current ALSA fireworks driver has a bug for the
      condition.
      
      This commit fixes the bug, by expand critical section with mutex. As a
      result, connection updating operation in bus-reset handler and connection
      changing operation in process context are serialized.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      99d73559
    • T
      ALSA: bebob: give up updating streams at bus reset handler · 3800e6f9
      Takashi Sakamoto 提交于
      DM1000/DM1100/DM1500 chipsets transfer packets with discontinue value in
      'dbc' field of CIP header. For ALSA bebob driver, this makes its bus-reset
      handler meaningless, because the discontinuity is detected quite earlier
      than executing the handler.
      
      This commit gives up updating streams at the bus reset handler.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      3800e6f9
    • T
      ALSA: bebob: change type of substream counter from atomic_t to unsigned int · 4fd6c6c7
      Takashi Sakamoto 提交于
      The counter is incremented/decremented in critical section protected with
      mutex. Therefore, no need to use atomic_t.
      
      This commit changes the type to unsigned int.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      4fd6c6c7
    • T
      ALSA: bebob: move mutex from function callee to callers · 2a71e701
      Takashi Sakamoto 提交于
      Currently, critical section is protected by mutex in functions of
      fireworks_stream.c. Callers increments/decrements substreams counter
      before calling the functions. Moving mutex to the callers code allows
      to change type of the substream counter from atomic_t to unsigned int.
      
      This commit is a preparation for obsoleting usage of atomic_t for
      substream counter.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      2a71e701
    • T
      ALSA: bebob: simplify bus-reset handling · 14a37ac1
      Takashi Sakamoto 提交于
      At bus-reset, DM1000/DM1100/DM1500 chipsets transfer packets with
      discontinuous value in 'dbc' field of CIP header. In this case, packet
      streaming layer in firewire-lib module stops streaming and set XRUN to PCM
      substream.
      
      In ALSA, PCM applications are notified the XRUN status by the return value
      of ALSA PCM interface. They can recover this state by executing
      snd_pcm_prepare(), then PCM drivers' prepare handler is called, and start
      new PCM substream. For ALSA BeBoB driver, the handler establishes new
      connections and start new AMDTP streaming.
      
      Unfortunately, neither the PCM applications nor the driver know the reason
      of XRUN. The driver gets to know the reason when update handler is called
      by IEEE 1394 bus driver. As long as I tested, the order of below events are
      not fixed:
       * Detecting packet discontinuity in tasklet context of OHCI 1394 driver
       * Calling prepare handler in process context of ALSA PCM application
       * Calling update handler in kthread context of IEEE 1394 bus driver
      
      The unpredictable order is disadvantage for the driver to be compliant to
      CMP. In IEC 61883-1, new CMP establish operations should be done 1 sec
      (isoc_resource_delay) after bus-reset. Within 1 sec, CMP restore
      operations are allowed. For this reason, in former commit ('b6bc8123:
      ALSA: bebob/firewire-lib: Add a quirk for discontinuity at bus reset'),
      the process context is forced to wait for executing update handler. The
      process context wait for bus-reset up to 1 sec. This commit solves the
      issue, while causes more disadvantages. For PCM applications, calling
      snd_pcm_prepare() for recovering XRUN state takes more time and the driver
      got a bit complicated code, while the recovery is not always successful.
      
      As long as I tested, DM1000/DM1100/DM1500 and BeBoB firmware can allow
      drivers to establish new connections just after bus reset. Furthermore,
      any FCP transactions are handled correctly. Therefore, the driver don't
      need to wait for bus reset handler for starting new streaming.
      
      This commit removes the codes to reduce maintenance cost.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      14a37ac1
  7. 18 2月, 2016 1 次提交
    • T
      ALSA: oxfw: use workqueue instead of tasklet for scs1x · ea790053
      Takashi Sakamoto 提交于
      This commit replaces tasklet with workqueue for scs1x functionality of
      ALSA oxfw driver.
      
      This driver transfers MIDI message specific for SCS.1m and SCS.1d. This
      task is currently done in software IRQ context of tasklet. In a view of
      system, this context is limited resources and some important drivers (at
      least, more important than ALSA oxfw driver) use the context as its
      bottom-harf.
      
      If the work to transfer MIDI messages is done within a time, it's better
      to use the other context for the work. Actually, with recent CPUs, the
      work will be scheduled within a time. This is a reason of this commit.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      ea790053
  8. 12 2月, 2016 2 次提交
  9. 09 2月, 2016 7 次提交
  10. 05 2月, 2016 4 次提交
  11. 26 1月, 2016 1 次提交
  12. 06 1月, 2016 4 次提交
    • T
      ALSA: dice: expand timeout to wait for Dice notification · 2eb65d67
      Takashi Sakamoto 提交于
      Some users have reported that their Dice based models generate ETIMEDOUT
      when starting PCM playback. It means that current timeout (=100msec) is
      not enough for their models to transfer notifications.
      
      This commit expands the timeout up to 2 sec. As a result, in a worst case,
      any operations to start AMDTP streams takes 2 sec or more. Then, in
      userspace, snd_pcm_hw_params(), snd_pcm_prepare(), snd_pcm_recover(),
      snd_rawmidi_open(), snd_seq_connect_from() and snd_seq_connect_to() may
      take the time.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      2eb65d67
    • T
      ALSA: dice: purge transaction initialization at timeout of Dice notification · a2875a92
      Takashi Sakamoto 提交于
      In previous commit, card registration is processed under situation
      with few bus reset. There's no need to add a workaround of transaction
      re-initialization at timeout.
      
      This commit purges the re-initialization.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      a2875a92
    • T
      ALSA: dice: postpone card registration · b59fb190
      Takashi Sakamoto 提交于
      Some models based on ASIC for Dice II series (STD, CP) change their
      hardware configurations after appearing on IEEE 1394 bus. This is due to
      interactions of boot loader (RedBoot), firmwares (eCos) and vendor's
      configurations. This causes current ALSA dice driver to get wrong
      information about the hardware's capability because its probe function
      runs just after detecting unit of the model.
      
      As long as I investigated, it takes a bit time (less than 1 second) to load
      the firmware after bootstrap. Just after loaded, the driver can get
      information about the unit. Then the hardware is initialized according to
      vendor's configurations. After, the got information becomes wrong.
      Between bootstrap, firmware loading and post configuration, some bus resets
      are observed.
      
      This commit offloads most processing of probe function into workqueue and
      schedules the workqueue after successive bus resets. This has an effect to
      get correct hardware information and avoid involvement to bus reset storm.
      
      For code simplicity, this change effects all of Dice-based models, i.e.
      Dice II, Dice Jr., Dice Mini and Dice III.
      
      I use a loose strategy to manage a race condition between the work and the
      bus reset. This is due to a specification of dice transaction. When bus
      reset occurs, registered address for the transaction is cleared. Drivers
      must re-register their own address again. While, this operation is required
      for the work because the work includes to wait for the transaction. This
      commit uses no lock primitives for the race condition. Instead, checking
      'registered' member of 'struct snd_dice' avoid executing the work again.
      If sound card is not registered, the work can be scheduled again by bus
      reset handler.
      
      When .remove callback is executed, the sound card is going to be released.
      The work should not be pending or executed in the releasing. This commit
      uses cancel_delayed_work_sync() in .remove callback and wait till the
      pending work finished. After .remove callback, .update callback is not
      executed, therefore no works are scheduled again.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      b59fb190
    • T
      ALSA: dice: split subaddress check from category check · 4a47a87d
      Takashi Sakamoto 提交于
      Before allocating an instance of sound card, ALSA dice driver checks
      chip_ID_hi in Bus information block of Config ROM, then also checks
      subaddresses. The former operation reads cache of Config ROM in Linux
      FireWire subsystem, while the latter operation sends read transaction.
      The latter can be merged into initialization of transaction system.
      
      This commit splits these two operations to reduce needless transactions
      in probe processing.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      4a47a87d
  13. 22 12月, 2015 4 次提交