1. 04 Jun, 2018 2 commits
  2. 01 Jun, 2018 2 commits
    • Ben Hutchings's avatar
      ALSA: pci/hda: Remove unused, broken, header file · ceec4684
      Ben Hutchings authored
      sound/pci/hda/local.h seems to be an earlier version of
      sound/hda/local.h; it was added at the same time but doesn't seem to
      have ever been used (within the git history).  Most of its macros
      depend on a hdac_read_parm() function which is not defined anywhere.
      Signed-off-by: default avatarBen Hutchings <ben.hutchings@codethink.co.uk>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      ceec4684
    • Bo Chen's avatar
      ALSA: hda - Handle kzalloc() failure in snd_hda_attach_pcm_stream() · a3aa60d5
      Bo Chen authored
      When 'kzalloc()' fails in 'snd_hda_attach_pcm_stream()', a new pcm instance is
      created without setting its operators via 'snd_pcm_set_ops()'. Following
      operations on the new pcm instance can trigger kernel null pointer dereferences
      and cause kernel oops.
      
      This bug was found with my work on building a gray-box fault-injection tool for
      linux-kernel-module binaries. A kernel null pointer dereference was confirmed
      from line 'substream->ops->open()' in function 'snd_pcm_open_substream()' in
      file 'sound/core/pcm_native.c'.
      
      This patch fixes the bug by calling 'snd_device_free()' in the error handling
      path of 'kzalloc()', which removes the new pcm instance from the snd card before
      returns with an error code.
      Signed-off-by: default avatarBo Chen <chenbo@pdx.edu>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      a3aa60d5
  3. 31 May, 2018 2 commits
  4. 30 May, 2018 2 commits
  5. 29 May, 2018 6 commits
  6. 28 May, 2018 8 commits
  7. 27 May, 2018 2 commits
    • Takashi Sakamoto's avatar
      ALSA: dice: unuse second stream for MIDI conformant data channel for TC Electronic models · 84eaaef2
      Takashi Sakamoto authored
      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: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      84eaaef2
    • Takashi Sakamoto's avatar
      ALSA: dice: fix stream format parameters for TC Electronic Studio Konnekt 48 · 1ceb506d
      Takashi Sakamoto authored
      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: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      1ceb506d
  8. 26 May, 2018 1 commit
  9. 24 May, 2018 4 commits
    • Lukas Wunner's avatar
      ALSA: hda - Fix runtime PM · 009f8c90
      Lukas Wunner authored
      Before commit 3b5b899c ("ALSA: hda: Make use of core codec functions
      to sync power state"), hda_set_power_state() returned the response to
      the Get Power State verb, a 32-bit unsigned integer whose expected value
      is 0x233 after transitioning a codec to D3, and 0x0 after transitioning
      it to D0.
      
      The response value is significant because hda_codec_runtime_suspend()
      does not clear the codec's bit in the codec_powered bitmask unless the
      AC_PWRST_CLK_STOP_OK bit (0x200) is set in the response value.  That in
      turn prevents the HDA controller from runtime suspending because
      azx_runtime_idle() checks that the codec_powered bitmask is zero.
      
      Since commit 3b5b899c, hda_set_power_state() only returns 0x0 or
      0x1, thereby breaking runtime PM for any HDA controller.  That's because
      an inline function introduced by the commit returns a bool instead of a
      32-bit unsigned int.  The change was likely erroneous and resulted from
      copying and pasting snd_hda_check_power_state(), which is immediately
      preceding the newly introduced inline function.  Fix it.
      
      Link: https://bugs.freedesktop.org/show_bug.cgi?id=106597
      Fixes: 3b5b899c ("ALSA: hda: Make use of core codec functions to sync power state")
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Abhijeet Kumar <abhijeet.kumar@intel.com>
      Reported-and-tested-by: default avatarGunnar Krüger <taijian@posteo.de>
      Signed-off-by: default avatarLukas Wunner <lukas@wunner.de>
      Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      009f8c90
    • Takashi Iwai's avatar
      ALSA: echoaudio: Drop superfluous macro · afe5da3e
      Takashi Iwai authored
      Drop pci_device() macro that just leads to chip->pci->dev, and pass it
      directly to request_firmware().  It was introduced for allowing the
      external alsa-driver kernel module builds.  Since it was discontinued
      years ago, we should clean it up now.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      afe5da3e
    • Takashi Iwai's avatar
      ALSA: usb-audio: Drop superfluous ifndef · b6622f57
      Takashi Iwai authored
      Drop the superfluous #ifndef checks that had been put just for
      allowing building the alsa-driver kernel modules externally.
      Since the external build was discontinued years ago, let's clean up
      the old kludges.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      b6622f57
    • Takashi Iwai's avatar
      ALSA: memalloc: Drop superfluous ifndef · 96961fa0
      Takashi Iwai authored
      Drop the superfluous #ifndef check in memalloc.h that had been put
      just for allowing building the alsa-driver kernel modules externally.
      Since the external build was discontinued years ago, let's clean up
      the old kludges.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      96961fa0
  10. 23 May, 2018 4 commits
  11. 22 May, 2018 3 commits
  12. 21 May, 2018 2 commits
    • Takashi Iwai's avatar
      Merge branch 'topic/xen' into for-next · 96382b4f
      Takashi Iwai authored
      Merge Xen para-virtualized frontend driver from Oleksandr Andrushchenko.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      96382b4f
    • Takashi Sakamoto's avatar
      ALSA: dice: add stream format parameters for TC Electronic Digital Konnekt x32 · d0aa5909
      Takashi Sakamoto authored
      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: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      d0aa5909
  13. 18 May, 2018 2 commits