1. 02 5月, 2018 4 次提交
  2. 02 3月, 2017 1 次提交
  3. 09 3月, 2016 2 次提交
    • 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: 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. 09 2月, 2016 2 次提交
    • T
      ALSA: dice: ensure phase lock before starting streaming · dfabc0ee
      Takashi Sakamoto 提交于
      In former commits, probing process has no need to set sampling transfer
      frequency. Although it's OK to drop a function to change the frequency
      from this module, some models require it before streaming. This seems to
      be due to phase lock of clock source.
      
      This commit moves the function from transaction layer to stream layer, and
      rename it according to the purpose.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      dfabc0ee
    • T
      ALSA: dice: purge generating channel cache · 6f688268
      Takashi Sakamoto 提交于
      Dice interface design doesn't allow drivers to read supported combination
      between sampling transfer frequencies and the number of Multi bit linear
      audio data channels. Due to the design, ALSA dice driver changes current
      sampling transfer frequency to generate cache of the combinations at
      device probing processing.
      
      Although, this idea is worse because ALSA dice driver changes the state of
      clock. This is not what users want when they save favorite configuration
      to the device in advance.
      
      Furthermore, there's a possibility that the format of data block is decided
      not only according to current sampling transfer frequency, but also the
      other factors, i.e. data format for digital interface. It's not good to
      generate channel cache according to the sampling transfer frequency only.
      
      This commit purges processing cache data and related structure members. As
      a result, users must set preferable sampling transfer frequency before
      using ALSA PCM applications, as long as they want to start any PCM
      substreams at the rate except for current one.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      6f688268
  5. 06 1月, 2016 1 次提交
    • 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
  6. 29 9月, 2015 2 次提交
  7. 10 12月, 2014 4 次提交
    • T
      ALSA: dice: Add support for MIDI capture/playback · a113ff88
      Takashi Sakamoto 提交于
      This commit adds a support for MIDI capture/playback
      
      When MIDI substrams already start streaming and PCM substreams are going to
      join at different sampling rate, streams are stopped once. Then sampling rate
      is changed and streams are restarted.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Acked-by: NClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      a113ff88
    • T
      ALSA: dice: Support for non SYT-Match sampling clock source mode · 8fc01fc0
      Takashi Sakamoto 提交于
      This commit allows this driver to handle devices with non SYT-Match
      sampling clock source.
      
      When sampling clock source is SYT-Match mode, devices handle
      'presentation timestamp' in received packets and generates sampling clock
      according to the information. In this case, driver is synchronization master
      and must transfer correct value in SYT field of each packets in outgoing
      stream, then the outgoing stream is a master stream.
      
      On the other hand, non SYT-Match mode, devices do this. So drivers must pick
      up the value in SYT field of incoming packets and use the value for outgoing
      stream. Currently firewire-lib module achieve this work.
      
      Furthermore, without SYT-Match and internal clock source, the sampling rate
      should be fixed for the other devices connected to the handled device. This
      commit add a restriction of sampling rate at this situation.
      
      With these implementations, this driver has no need to set clock source.
      This commit remove set function.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Acked-by: NClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      8fc01fc0
    • T
      ALSA: dice: Add support for duplex streams with synchronization · 9a02843c
      Takashi Sakamoto 提交于
      This commit adds support for AMDTP in-stream. As a result, Dice driver
      supports full duplex streams with synchronization.
      
      AMDTP can transfer timestamps in its packets. By handling the timestamp,
      devices can synchronize to the other devices or drivers on the same bus.
      
      When Dice chipset is 'enabled', it starts streams with correct settings.
      This 'enable' register is global, thus, when a stream is started to run,
      an opposite stream can't start unless turning off 'enable'. Therefore
      a pair of streams must be running. This causes a loss of CPU usage when
      single stream is needed for neither playbacking or capturing.
      
      This commit assumes that playback-only models also have a functionality
      to transmit stream for delivering timestamps.
      
      Currently, sampling clock source is restricted to SYT-Match mode. This is
      improved in followed commit. I note that at SYT-Match mode, Dice can select
      from 4 streams for synchronization but this driver uses the 1st stream only
      for simplicity.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Acked-by: NClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      9a02843c
    • T
      ALSA: dice: Change the way to start stream · 288a8d0c
      Takashi Sakamoto 提交于
      Streaming functionality can start streams when rate is given but currently
      some codes are in PCM functionality.
      
      This commit changes the way to start stream and add some arrangement
      to make it easy to understand the way.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Acked-by: NClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      288a8d0c
  8. 30 11月, 2014 5 次提交
    • T
      ALSA: dice: Split proc interface into a file · 04d426a0
      Takashi Sakamoto 提交于
      This commit adds a file and move some codes related to proc output.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      04d426a0
    • T
      ALSA: dice: Split hwdep functionality into a file · 19af57b4
      Takashi Sakamoto 提交于
      This commit adds a file and move some codes related to hwdep functionality.
      
      This interface is designed for mixer/control application. By using hwdep
      interface, the application can get information about firewire node, can
      lock/unlock kernel streaming and can get notification at starting/stopping
      kernel streaming.
      
      Additionally, this interface give a way to read Dice notification.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      19af57b4
    • T
      ALSA: dice: Split PCM functionality into a file · c50fb91f
      Takashi Sakamoto 提交于
      This commit adds a file and move some codes related to PCM functionality.
      
      Currently PCM playback is supported. PCM capture will be supported in followed
      commits.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      c50fb91f
    • T
      ALSA: dice: Split stream functionality into a file · 6eb6c81e
      Takashi Sakamoto 提交于
      This commit adds a file with some helper functions for streaming, and move some
      codes into the file with some arrangements.
      
      Well-known CMP is not used to start/stop streams for Dice chipset. It's
      achieved by writing to specific address. We call this way as 'enable'.
      When devices are 'enabled', streaming starts in registered isochronous channel.
      Some helper functions are already implemented in previous commit.
      
      Basically, the stream is compliant to IEC 61883-6, so-called as AMDTP. But Dice
      has a specific quirk, so called-as 'Dual Wire'. This quirk is applied at
      176.4/192.0kHz. In this mode, each packet includes double number of events than
      number in the specification, and stream runs at a half of sampling rate.
      
      There is another quirk at bus reset. Dice chipset handles drivers' request but
      don't re-enable streaming. So stream should be stopped.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      6eb6c81e
    • T
      ALSA: dice: Split transaction functionality into a file · 7c2d4c0c
      Takashi Sakamoto 提交于
      This commit adds a file with some helper functions for transaction, and move
      some codes into the file with some arrangements.
      
      For Dice chipset, well-known FCP or AV/C commands are not used to control
      devices. It's achieved by read/write transactions into specific addresses.
      
      Dice's address area is split into 5 areas. Each area has its own role. The
      offset for each area can be got by reading head of the address area. By
      reading these areas, drivers can get to know device status. By writing these
      areas, drivers can change device status.
      
      Dice has a specific mechanism called as 'notification'. When device status is
      changed, Dice devices tells the event by sending transaction. This notification
      is sent to an address which drivers register in advance. But this causes an
      issue to drivers.
      
      To handle the notification, drivers need to allocate its own callback function
      to the address region in host controller. This region is exclusive. For the
      other applications, drivers must give a mechanism to read the received
      notification. For this purpose, Dice driver already implements hwdep interface.
      
      Dice chipset doesn't allow drivers to register several addresses. In this
      reason, when this driver is applied to a device, the other drivers should
      _not_ try to register its own address to the device.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      7c2d4c0c