Skip to content
  1. Jun 13, 2023
    • Oswald Buddenhagen's avatar
      ALSA: emu10k1: fix timer for E-MU cards at 44.1 kHz word clock · ca533448
      Oswald Buddenhagen authored
      
      
      The timer was presuming a fixed 48 kHz word clock, like the rest of the
      code.
      
      Signed-off-by: default avatarOswald Buddenhagen <oswald.buddenhagen@gmx.de>
      Link: https://lore.kernel.org/r/20230612191325.1315854-8-oswald.buddenhagen@gmx.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      ca533448
    • Oswald Buddenhagen's avatar
      ALSA: timer: minimize open-coded access to hw.resolution · 6cc84450
      Oswald Buddenhagen authored
      
      
      Some info-querying code still used hw.resolution directly instead of
      calling snd_timer_hw_resolution(), thus missing a possible
      hw.c_resolution callback. This patch rectifies that.
      
      Signed-off-by: default avatarOswald Buddenhagen <oswald.buddenhagen@gmx.de>
      Link: https://lore.kernel.org/r/20230612191325.1315854-7-oswald.buddenhagen@gmx.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      6cc84450
    • Oswald Buddenhagen's avatar
      ALSA: emu10k1: fix synthesizer pitch for E-MU cards at 44.1 kHz · e68235c8
      Oswald Buddenhagen authored
      
      
      This is only a very partial fix - the frequency-dependent envelope & LFO
      register values aren't adjusted.
      
      But I'm not sure they were even correct at 48 kHz to start with, as most
      of them are precalculated by common code which assumes an EMU8K-specific
      44.1 kHz word clock, and it seems somewhat unlikely that the hardware's
      register interpretation was adjusted to compensate for the different
      word clock.
      
      In any case I'm not going to spend time on fixing that, as this code is
      unlikely to be actually used by anyone today.
      
      Signed-off-by: default avatarOswald Buddenhagen <oswald.buddenhagen@gmx.de>
      Link: https://lore.kernel.org/r/20230612191325.1315854-6-oswald.buddenhagen@gmx.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      e68235c8
    • Oswald Buddenhagen's avatar
      ALSA: emu10k1: fix sample rates for E-MU cards at 44.1 kHz word clock · 19b89d15
      Oswald Buddenhagen authored
      
      
      Now that we know the actual word clock, we can:
      - Put the resulting rate into the hardware info
      - At 44.1 kHz word clock shift the rate for the pitch calculations,
        which presume a 48 kHz word clock
      
      Signed-off-by: default avatarOswald Buddenhagen <oswald.buddenhagen@gmx.de>
      Link: https://lore.kernel.org/r/20230612191325.1315854-5-oswald.buddenhagen@gmx.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      19b89d15
    • Oswald Buddenhagen's avatar
      ALSA: emu10k1: query rate of external clock sources on E-MU cards · e73b597e
      Oswald Buddenhagen authored
      
      
      The value isn't used yet; the subsequent commits will do that.
      
      This ignores the existence of rates above 48 kHz, which is fine, as the
      hardware will just switch to the fallback clock source when fed with a
      rate which is incompatible with the base clock multiplier, which
      currently is always x1.
      
      The sample rate display in /proc spdif-in is adjusted to reflect our
      understanding of the input rates.
      
      This is tested only with an 0404b card without sync card, so there is a
      lot of room for improvement.
      
      Signed-off-by: default avatarOswald Buddenhagen <oswald.buddenhagen@gmx.de>
      
      Link: https://lore.kernel.org/r/20230612191325.1315854-4-oswald.buddenhagen@gmx.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      e73b597e
    • Oswald Buddenhagen's avatar
      ALSA: emu10k1: make available E-MU clock sources card-specific · 60985241
      Oswald Buddenhagen authored
      
      
      The actually available clock sources depend on the available audio input
      ports and dedicated clock input ports.
      
      This includes refactoring the code to be data-driven to remain
      manageable.
      
      Signed-off-by: default avatarOswald Buddenhagen <oswald.buddenhagen@gmx.de>
      Link: https://lore.kernel.org/r/20230612191325.1315854-3-oswald.buddenhagen@gmx.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      60985241
    • Oswald Buddenhagen's avatar
      ALSA: emu10k1: split off E-MU fallback clock from clock source · 13598862
      Oswald Buddenhagen authored
      
      
      So far, we set the fallback as a side effect of setting the source. But
      the fallback makes no sense at all when an internal clock is selected.
      Defaulting to 48k for S/PDIF & ADAT makes sense, but as that is the
      global default and we're not changing it automatically any more, it's
      just fine to leave it entirely to the explicit setting.
      
      This changes the name of the pre-existing control to something more
      appropriate (regardless of the split), so users will need to adjust
      their mixer settings.
      
      Signed-off-by: default avatarOswald Buddenhagen <oswald.buddenhagen@gmx.de>
      Link: https://lore.kernel.org/r/20230612191325.1315854-2-oswald.buddenhagen@gmx.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      13598862
    • Takashi Iwai's avatar
      Merge branch 'topic/midi20' into for-next · 508b662b
      Takashi Iwai authored
      
      
      As the updated MIDI 2.0 spec has been published freshly, this is a
      catch up to add the support for new specs, especially UMP v1.1
      features, on Linux kernel.
      
      The new UMP v1.1 introduced the concept of Function Blocks (FB), which
      is a kind of superset of USB MIDI 2.0 Group Terminal Blocks (GTB).
      The patch set adds the support for FB as the primary information
      source while keeping the parse of GTB as fallback.  Also UMP v1.1
      supports the groupless messages, the protocol switch, static FBs, and
      other new fundamental features, and those are supported as well.
      
      Link: https://www.midi.org/midi-articles/details-about-midi-2-0-midi-ci-profiles-and-property-exchange
      Link: https://lore.kernel.org/r/20230612081054.17200-1-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      508b662b
    • Takashi Iwai's avatar
      ALSA: docs: Update MIDI 2.0 documentation for UMP 1.1 enhancement · febdfa0e
      Takashi Iwai authored
      
      
      There have been a few enhancements for the new UMP 1.1 features.
      Update the documentation accordingly.
      
      Link: https://lore.kernel.org/r/20230612081054.17200-11-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      febdfa0e
    • Takashi Iwai's avatar
      ALSA: ump: Add info flag bit for static blocks · 01dfa8e9
      Takashi Iwai authored
      
      
      UMP v1.1 spec allows to inform whether the function blocks are static
      and not dynamically updated.  Add a new flag bit to
      snd_ump_endpoint_info to reflect that attribute, too.
      
      The flag is set when a USB MIDI device is still in the old MIDI 2.0
      without UMP 1.1 support.  Then the driver falls back to GTBs, and they
      are supposed to be static-only.
      
      Link: https://lore.kernel.org/r/20230612081054.17200-10-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      01dfa8e9
    • Takashi Iwai's avatar
      ALSA: seq: ump: Notify UMP protocol change to sequencer · 6a8b4800
      Takashi Iwai authored
      
      
      UMP v1.1 supports the protocol switch via a UMP Stream message.  When
      it's received, we need to take care of the midi_version field in the
      corresponding sequencer client, too.
      
      This patch introduces a new ops to notify the protocol change to
      snd_seq_ump_ops for handling it.
      
      Link: https://lore.kernel.org/r/20230612081054.17200-9-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      6a8b4800
    • Takashi Iwai's avatar
      ALSA: seq: ump: Notify port changes to system port · 174a6dfb
      Takashi Iwai authored
      
      
      For allowing applications to track the FB active changes, this patch
      adds the notification from the system port at each time a FB change is
      handled and the active flag or re-grouping happens.
      
      Link: https://lore.kernel.org/r/20230612081054.17200-8-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      174a6dfb
    • Takashi Iwai's avatar
      ALSA: seq: ump: Handle FB info update · 4a16a3af
      Takashi Iwai authored
      
      
      This patch implements the handling of the dynamic update of FB info.
      
      When the FB info update is received after the initial parsing, it
      means the dynamic FB info update.  We compare the result, and if the
      actual update is detected, it's notified via a new ops,
      notify_fb_change, to the sequencer client, and the corresponding
      sequencer ports are updated accordingly.
      
      Link: https://lore.kernel.org/r/20230612081054.17200-7-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      4a16a3af
    • Takashi Iwai's avatar
      ALSA: seq: ump: Handle groupless messages · 5437ac9b
      Takashi Iwai authored
      
      
      The UMP Utility and Stream messages are "groupless", i.e. an incoming
      groupless packet should be sent only to the UMP EP port, and the event
      with the groupless message is sent to UMP EP as is without the group
      translation per port.
      
      Also, the former reserved bit 0 for the client group filter is now
      used for groupless events.  When the bit 0 is set, the groupless
      events are filtered out and skipped.
      
      Link: https://lore.kernel.org/r/20230612081054.17200-6-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      5437ac9b
    • Takashi Iwai's avatar
      ALSA: usb-audio: Add midi2_ump_probe option · 960a1149
      Takashi Iwai authored
      
      
      Add a new option to enable/disable the UMP Endpoint probing.
      Some firmware seems screwed up when such a new command issued, and
      this option allows user to suppress it.
      
      Link: https://lore.kernel.org/r/20230612081054.17200-5-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      960a1149
    • Takashi Iwai's avatar
      ALSA: usb-audio: Parse UMP Endpoint and Function Blocks at first · 54852e8f
      Takashi Iwai authored
      
      
      Try to parse the UMP Endpoint and UMP Function Blocks for building the
      topology at first.  Only when those are missing (e.g. on an older USB
      MIDI 2.0 spec or a unidirectional endpoint), the driver still creates
      blocks based on USB group terminal block information as fallback.
      
      Link: https://lore.kernel.org/r/20230612081054.17200-4-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      54852e8f
    • Takashi Iwai's avatar
      ALSA: ump: Support UMP Endpoint and Function Block parsing · 37e0e141
      Takashi Iwai authored
      
      
      This patch adds the basic support for UMP Endpoint and UMP Function
      Block parsing, which are extended in the new UMP v1.1 spec.
      The patch provides a new helper function to perform the query of the
      UMP Endpoint information and builds up the UMP blocks based on UMP
      Function Block information.  For the communication over the UMP
      Endpoint, it opens the rawmidi device once internally, inquiries the
      UMP Endpoint and Function Block info by sending new UMP Stream
      messages, and waits for the response for each query.
      
      The new UMP spec allows to update the FB info and change its
      associated groups or its activeness on the fly, too.  For catching it,
      the UMP core keeps watching the incoming UMP messages, and
      snd_ump_receive() handles the incoming UMP Stream messages to refresh
      the FB info.
      
      Link: https://lore.kernel.org/r/20230612081054.17200-3-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      37e0e141
    • Takashi Iwai's avatar
      ALSA: ump: Add more attributes to UMP EP and FB info · e375b8a0
      Takashi Iwai authored
      
      
      Add a few more fields to snd_ump_endpoint_info and snd_ump_block_info
      that are added in the new v1.1 spec.  Those are filled by the UMP Stream
      messages.
      
      The rawmidi protocol version is bumped to 2.0.4 to indicate those
      updates.
      
      Also, update the proc outputs to show the newly introduced fields.
      
      Link: https://lore.kernel.org/r/20230612081054.17200-2-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      e375b8a0
  2. Jun 12, 2023
  3. Jun 11, 2023
    • Mark Brown's avatar
      ALSA: hda: Use maple tree register cache · 15253079
      Mark Brown authored
      
      
      HDA can only support single register read and write operations so does not
      benefit from block writes. This means it gets no benefit from using the
      rbtree register cache over the maple tree register cache so convert it to
      use maple trees instead, it is more modern.
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Link: https://lore.kernel.org/r/20230609-alsa-hda-maple-v1-1-a2b725c8b8f5@kernel.org
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      15253079
  4. Jun 07, 2023
    • Ivan Orlov's avatar
      selftests: ALSA: Add test for the 'pcmtest' driver · 10b98a4d
      Ivan Orlov authored
      
      
      This test covers the new Virtual PCM Test Driver, including the capturing,
      playback and ioctl redefinition functionalities for both interleaved and
      non-interleaved access modes. This test is also helpful as an usage example
      of the 'pcmtest' driver.
      
      We have a lot of different virtual media drivers, which can be used for
      testing of the userspace applications and media subsystem middle layer.
      However, all of them are aimed at testing the video functionality and
      simulating the video devices. For audio devices we have only snd-dummy
      module, which is good in simulating the correct behavior of an ALSA device.
      I decided to write a tool, which would help to test the userspace ALSA
      programs (and the PCM middle layer as well) under unusual circumstances
      to figure out how they would behave. So I came up with this Virtual PCM
      Test Driver.
      
      This new Virtual PCM Test Driver has several features which can be useful
      during the userspace ALSA applications testing/fuzzing, or testing/fuzzing
      of the PCM middle layer. Not all of them can be implemented using the
      existing virtual drivers (like dummy or loopback). Here is what can this
      driver do:
      
      - Simulate both capture and playback processes
      - Generate random or pattern-based capture data
      - Check the playback stream for containing the looped pattern
      - Inject delays into the playback and capturing processes
      - Inject errors during the PCM callbacks
      
      Also, this driver can check the playback stream for containing the
      predefined pattern, which is used in the corresponding selftest to check
      the PCM middle layer data transferring functionality. Additionally, this
      driver redefines the default RESET ioctl, and the selftest covers this PCM
      API functionality as well.
      
      The driver supports both interleaved and non-interleaved access modes, and
      have separate pattern buffers for each channel. The driver supports up to
      4 channels and up to 8 substreams.
      
      Signed-off-by: default avatarIvan Orlov <ivan.orlov0322@gmail.com>
      Acked-by: default avatarJaroslav Kysela <perex@perex.cz>
      Link: https://lore.kernel.org/r/20230606193254.20791-3-ivan.orlov0322@gmail.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      10b98a4d
    • Ivan Orlov's avatar
      ALSA: Implement the new Virtual PCM Test Driver · 315a3d57
      Ivan Orlov authored
      
      
      We have a lot of different virtual media drivers, which can be used for
      testing of the userspace applications and media subsystem middle layer.
      However, all of them are aimed at testing the video functionality and
      simulating the video devices. For audio devices we have only snd-dummy
      module, which is good in simulating the correct behavior of an ALSA device.
      I decided to write a tool, which would help to test the userspace ALSA
      programs (and the PCM middle layer as well) under unusual circumstances
      to figure out how they would behave. So I came up with this Virtual PCM
      Test Driver.
      
      This new Virtual PCM Test Driver has several features which can be useful
      during the userspace ALSA applications testing/fuzzing, or testing/fuzzing
      of the PCM middle layer. Not all of them can be implemented using the
      existing virtual drivers (like dummy or loopback). Here is what can this
      driver do:
      
      - Simulate both capture and playback processes
      - Generate random or pattern-based capture data
      - Inject delays into the playback and capturing processes
      - Inject errors during the PCM callbacks
      
      Also, this driver can check the playback stream for containing the
      predefined pattern, which is used in the corresponding selftest to check
      the PCM middle layer data transferring functionality. Additionally, this
      driver redefines the default RESET ioctl, and the selftest covers this PCM
      API functionality as well.
      
      The driver supports both interleaved and non-interleaved access modes, and
      have separate pattern buffers for each channel. The driver supports up to
      4 channels and up to 8 substreams.
      
      Signed-off-by: default avatarIvan Orlov <ivan.orlov0322@gmail.com>
      Acked-by: default avatarJaroslav Kysela <perex@perex.cz>
      Link: https://lore.kernel.org/r/20230606193254.20791-2-ivan.orlov0322@gmail.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      315a3d57
    • Ivan Orlov's avatar
      docs: sound: add 'pcmtest' driver documentation · f091ec76
      Ivan Orlov authored
      
      
      Add documentation for the new Virtual PCM Test Driver. It covers all
      possible usage cases: errors and delay injections, random and
      pattern-based data generation, playback and ioctl redefinition
      functionalities testing.
      
      We have a lot of different virtual media drivers, which can be used for
      testing of the userspace applications and media subsystem middle layer.
      However, all of them are aimed at testing the video functionality and
      simulating the video devices. For audio devices we have only snd-dummy
      module, which is good in simulating the correct behavior of an ALSA device.
      I decided to write a tool, which would help to test the userspace ALSA
      programs (and the PCM middle layer as well) under unusual circumstances
      to figure out how they would behave. So I came up with this Virtual PCM
      Test Driver.
      
      This new Virtual PCM Test Driver has several features which can be useful
      during the userspace ALSA applications testing/fuzzing, or testing/fuzzing
      of the PCM middle layer. Not all of them can be implemented using the
      existing virtual drivers (like dummy or loopback). Here is what can this
      driver do:
      
      - Simulate both capture and playback processes
      - Check the playback stream for containing the looped pattern
      - Generate random or pattern-based capture data
      - Inject delays into the playback and capturing processes
      - Inject errors during the PCM callbacks
      
      Also, this driver can check the playback stream for containing the
      predefined pattern, which is used in the corresponding selftest to check
      the PCM middle layer data transferring functionality. Additionally, this
      driver redefines the default RESET ioctl, and the selftest covers this PCM
      API functionality as well.
      
      The driver supports both interleaved and non-interleaved access modes, and
      have separate pattern buffers for each channel. The driver supports up to
      4 channels and up to 8 substreams.
      
      Signed-off-by: default avatarIvan Orlov <ivan.orlov0322@gmail.com>
      Acked-by: default avatarJaroslav Kysela <perex@perex.cz>
      Link: https://lore.kernel.org/r/20230606193254.20791-1-ivan.orlov0322@gmail.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      f091ec76
    • Yanteng Si's avatar
      ALSA: hda/intel: Workaround for WALLCLK register for loongson controller · a4d2b853
      Yanteng Si authored
      
      
      On loongson controller, the value of WALLCLK register
      is always 0, which is meaningless, so we return directly.
      
      Signed-off-by: default avatarYanteng Si <siyanteng@loongson.cn>
      Signed-off-by: default avatarYingkun Meng <mengyingkun@loongson.cn>
      Acked-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
      Link: https://lore.kernel.org/r/185df71ef413ab190460eb377703214ee7288aeb.1686128807.git.siyanteng@loongson.cn
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      a4d2b853
    • Yanteng Si's avatar
      ALSA: hda: Workaround for SDnCTL register on loongson · 942ccdd8
      Yanteng Si authored
      
      
      On loongson controller, after calling snd_hdac_stream_updateb()
      to enable DMA engine, the SDnCTL.STRM will become to zero.  We
      need to access SDnCTL in dword to keep SDnCTL.STRM is not changed.
      
      Signed-off-by: default avatarYanteng Si <siyanteng@loongson.cn>
      Signed-off-by: default avatarYingkun Meng <mengyingkun@loongson.cn>
      Acked-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
      Link: https://lore.kernel.org/r/27aeddf5ebbe7c69631cec0e489c1b264be94990.1686128807.git.siyanteng@loongson.cn
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      942ccdd8
    • Yanteng Si's avatar
      ALSA: hda: Using polling mode for loongson controller by default · cbc3e98a
      Yanteng Si authored
      
      
      On loongson controller, RIRBSTS.RINTFL cannot be cleared,
      azx_interrupt() is called all the time. We disable RIRB
      interrupt, and use polling mode by default.
      
      Signed-off-by: default avatarYanteng Si <siyanteng@loongson.cn>
      Signed-off-by: default avatarYingkun Meng <mengyingkun@loongson.cn>
      Acked-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
      Link: https://lore.kernel.org/r/d309a75424d438b958d90d797b4f1ba45468e090.1686128807.git.siyanteng@loongson.cn
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      cbc3e98a
    • Yanteng Si's avatar
      ALSA: hda: Add Loongson LS7A HD-Audio support · 28bd137a
      Yanteng Si authored
      
      
      Add the new PCI ID 0x0014 0x7a07 and the new PCI ID 0x0014 0x7a37
      Loongson HDA controller.
      
      Signed-off-by: default avatarYanteng Si <siyanteng@loongson.cn>
      Acked-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
      Link: https://lore.kernel.org/r/993587483b9509796b29a416f257fcfb4b15c6ea.1686128807.git.siyanteng@loongson.cn
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      28bd137a
  5. Jun 06, 2023
  6. Jun 05, 2023