1. 30 9月, 2015 2 次提交
    • T
      ALSA: firewire-digi00x: add data block processing layer · 163ae6f3
      Takashi Sakamoto 提交于
      Digi 002/003 family uses its own format for data blocks. The format is
      quite similar to AM824 in IEC 61883-6, while there're some differences:
      
       * The Valid Bit Length (VBL) code is always 0x40 in Multi-bit Linear Audio
         (MBLA) data channel.
       * The first data channel includes MIDI messages, against IEC 61883-6
         recommendation.
       * The Counter field is always zero in MIDI conformant data channel.
       * Sequence multiplexing in IEC 61883-6 is not applied to the MIDI
         conformant data channel.
       * PCM samples are scrambled in received AMDTP packets. We call the way
         as Double-Oh-Three (DOT). The algorithm was discovered by
         Robin Gareus and Damien Zammit in 2012.
      
      This commit adds data processing layer to satisfy these differences.
      
      There's a quirk about transmission mode for received packets. When this
      driver applies non-blocking mode to outgoing packets with isochronous
      channel 2 or more, after 15 to 20 seconds since playbacking, any PCM
      samples causes noisy sound on the device. With isochronous channel 0 or 1,
      this doesn't occur. As long as I investigated, this quirk is not observed
      when applying blocking mode to the received packets.
      
      This driver applies blocking mode to outgoing packets, while non-blocking
      mode to incoming packgets.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      163ae6f3
    • T
      ALSA: firewire-digi00x: add skeleton for Digi 002/003 family · 9edf723f
      Takashi Sakamoto 提交于
      This commit adds a new driver for Digidesign 002/003 family. This commit
      just creates/removes card instance according to bus event. More functions
      will be added in following commits.
      
      Digidesign 002/003 family consists of:
       * Agere FW802B for IEEE 1394 PHY layer
       * PDI 1394L40 for IEEE 1394 LINK layer and IEC 61883 interface
       * ALTERA ACEX EP1K50 for IEC 61883 layer and DSP controller
       * ADSP-21065L for signal processing
      
      [minor cleanup using skip_spaces() by tiwai]
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      9edf723f
  2. 29 9月, 2015 16 次提交
  3. 24 9月, 2015 1 次提交
    • T
      ALSA: oxfw: add Mackie Onyx Satellite quirk to inform wrong value in 'dbs' field in tx CIP header · 13f3a46d
      Takashi Sakamoto 提交于
      Mackie Onyx Satellite has two usage; standalone and with base station.
      
      These two modes has different stream formats. In standalone mode, rx data
      block includes 2 Multi Bit Linear Audio (MBLA) data channels and tx data
      block includes 2. With base station, they're 6 and 2.
      
      Although, with base station, the actual tx packet include wrong value in
      'dbs' field in its CIP header. This quirk causes packet streaming layer to
      detect packet discontinuity and to stop PCM substream.
      
      This is a response of 'single' subfunction 'extended stream format
      information' command in AV/C Stream Format Information Specification 1.1.
      It means that a data block in tx packets includes 2 MBLA data channels.
      
      $ ./firewire-request /dev/fw1 fcp 0x01ffbfc001000000ffffffff
      response: 000: 0c ff bf c0 01 00 00 00 ff 00 90 40 03 02 01 02
      response: 010: 06
      
      Current OXFW driver parses the response and detects stream formats
      correctly.
      
      $ cat /proc/asound/card1/firewire/formation
      ...
      Output Stream from device:
      	Rate	PCM	MIDI
      * 	48000	2	0
       	44100	2	0
       	88200	2	0
      	96000	2	0
      
      On the other hand, in actual tx CIP, the 'dbs' field has 6. But the number
      of quadlets in CIP payload is not multiple of 6. Seeing the subtraction of
      two successive payload quadlets, it should be multiple of 2.
      
      payload  CIP      CIP
      quadlets header0  header1
            24 00060052 9002ffff
            24 0006005e 9002ffff
            26 0006006a 9002ffff
            24 00060077 9002ffff
            24 00060083 9002ffff
            26 0006008f 9002ffff
            24 0006009c 9002ffff
            24 000600a8 9002ffff
            26 000600b4 9002ffff
            24 000600c1 9002ffff
      
      This commit adds support for this quirk to OXFW driver, by using
      CIP_WRONG_DBS flag. When this flag is set, packet streaming layer uses
      the value of its 'data_block_quadlets' member instead of the value in CIP
      header. This value is already set by OXFW driver and no discontinuity is
      detected.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      13f3a46d
  4. 29 8月, 2015 1 次提交
  5. 07 8月, 2015 1 次提交
  6. 05 8月, 2015 2 次提交
    • T
      ALSA: fireworks/firewire-lib: add support for recent firmware quirk · 18f5ed36
      Takashi Sakamoto 提交于
      Fireworks uses TSB43CB43(IceLynx-Micro) as its IEC 61883-1/6 interface.
      This chip includes ARM7 core, and loads and runs program. The firmware
      is stored in on-board memory and loaded every powering-on from it.
      
      Echo Audio ships several versions of firmwares for each model. These
      firmwares have each quirk and the quirk changes a sequence of packets.
      
      As long as I investigated, AudioFire2/AudioFire4/AudioFirePre8 have a
      quirk to transfer a first packet with 0x02 in its dbc field. This causes
      ALSA Fireworks driver to detect discontinuity. In this case, firmware
      version 5.7.0, 5.7.3 and 5.8.0 are used.
      
      Payload  CIP      CIP
      quadlets header1  header2
      02       00050002 90ffffff <-
      42       0005000a 90013000
      42       00050012 90014400
      42       0005001a 90015800
      02       0005001a 90ffffff
      42       00050022 90019000
      42       0005002a 9001a400
      42       00050032 9001b800
      02       00050032 90ffffff
      42       0005003a 9001d000
      42       00050042 9001e400
      42       0005004a 9001f800
      02       0005004a 90ffffff
      (AudioFire2 with firmware version 5.7.)
      
      $ dmesg
      snd-fireworks fw1.0: Detect discontinuity of CIP: 00 02
      
      These models, AudioFire8 (since Jul 2009 ) and Gibson Robot Interface
      Pack series uses the same ARM binary as their firmware. Thus, this
      quirk may be observed among them.
      
      This commit adds a new member for AMDTP structure. This member represents
      the value of dbc field in a first AMDTP packet. Drivers can set it with
      a preferred value according to model's quirk.
      Tested-by: NJohannes Oertei <johannes.oertel@uni-due.de>
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      18f5ed36
    • T
      Revert "ALSA: fireworks: add support for AudioFire2 quirk" · c85523d1
      Takashi Sakamoto 提交于
      This reverts commit 9c6893e0.
      
      The fix is superseded by the next commit as a better implementation
      for supporting AudioFire2/AudioFire4/AudioFirePre8 quirks.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      c85523d1
  7. 27 7月, 2015 1 次提交
    • T
      ALSA: fireworks: add support for AudioFire2 quirk · 9c6893e0
      Takashi Sakamoto 提交于
      Fireworks uses TSB43CB43(IceLynx-Micro) as its IEC 61883-1/6 interface.
      This chip includes ARM7 core, and loads and runs program. The firmware
      is stored in on-board memory and loaded every powering-on.
      
      Echo Audio ships several versions of firmwares for each model. These
      firmwares have each quirk and the quirk changes a sequence of packets.
      
      AudioFire2 has a quirk to transfer a first packet with non-zero in
      its dbc field. This causes ALSA Fireworks driver to detect discontinuity.
      As long as I investigated, firmware 5.7, 5.7.6 and 5.8 have this quirk.
      
      This commit adds a support for the quirk to handle AudioFire2 packets.
      For safe, CIP_SKIP_INIT_DBC_CHECK is applied to all versions of
      AudioFire2's firmwares.
      
      02 00050002 90ffffff <-
      42 0005000a 90013000
      42 00050012 90014400
      42 0005001a 90015800
      02 0005001a 90ffffff
      42 00050022 90019000
      42 0005002a 9001a400
      42 00050032 9001b800
      02 00050032 90ffffff
      42 0005003a 9001d000
      42 00050042 9001e400
      42 0005004a 9001f800
      02 0005004a 90ffffff
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      9c6893e0
  8. 15 6月, 2015 11 次提交
  9. 27 5月, 2015 1 次提交
    • T
      ALSA: firewire-lib: fix buffer-over-run when detecting packet discontinuity · 31ea49ba
      Takashi Sakamoto 提交于
      When detecting packet discontinuity, handle_in_packet() returns minus value
      and this value is assigned to unsigned int variable, then the variable has
      huge value. As a result, the variable causes buffer-over-run in
      handle_out_packet(). This brings invalid page request and system hangup.
      
      This commit fixes the bug to add a new argument into handle_in_packet()
      and the number of handled data blocks is assignd to it. The function
      return value is just used to check error.
      
      I also considered to change the type of local variable to 'int' in
      in_stream_callback(). This idea is based on type-conversion in C standard,
      while it may cause future problems when adding more works. Thus, I dropped
      this idea.
      
      Fixes: 6fc6b9ce('ALSA: firewire-lib: pass the number of data blocks in incoming packets to outgoing packets')
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      31ea49ba
  10. 24 5月, 2015 4 次提交