31 Aug, 2017

1 commit


23 Aug, 2017

1 commit


12 Apr, 2017

1 commit

  • Declare snd_kcontrol_new strcutures as const as they are only passed as
    an argument to the function snd_ctl_new1. This argument is of type const,
    so snd_kcontrol_new structures having this property can be made const too.
    Done using Coccinelle:

    @r disable optional_qualifier@
    identifier x;
    position p;
    @@
    static struct snd_kcontrol_new x@p={...};

    @ok@
    identifier r.x;
    position p;
    @@
    snd_ctl_new1(&x@p,...)

    @bad@
    position p != {r.p,ok.p};
    identifier r.x;
    @@
    x@p

    @depends on !bad disable optional_qualifier@
    identifier r.x;
    @@
    +const
    struct snd_kcontrol_new x;

    Signed-off-by: Bhumika Goyal
    Signed-off-by: Takashi Iwai

    Bhumika Goyal
     

12 Jan, 2017

1 commit


08 May, 2016

1 commit


27 Feb, 2016

1 commit


13 Feb, 2016

1 commit

  • The 'umidi' object will be free'd on the error path by snd_usbmidi_free()
    when tearing down the rawmidi interface. So we shouldn't try to free it
    in snd_usbmidi_create() after having registered the rawmidi interface.

    Found by KASAN.

    Signed-off-by: Andrey Konovalov
    Acked-by: Clemens Ladisch
    Cc:
    Signed-off-by: Takashi Iwai

    Andrey Konovalov
     

29 Jan, 2016

1 commit

  • This is a preliminary patch for the later change to allow a better
    quirk ID management. In the current USB-audio code, there are a few
    places looking at usb_device idVendor and idProduct fields directly
    even though we have already a static member in snd_usb_audio.usb_id.
    This patch modifies such codes to refer to the latter field.

    For achieving this, two slightly intensive changes have been done:
    - The snd_usb_audio object is set/reset via dev_getdrv() for the given
    USB device; it's needed for minimizing the changes for some existing
    quirks that take only usb_device object.

    - __snd_usbmidi_create() is introduced to receive the pre-given usb_id
    argument. The exported snd_usbmidi_create() is unchanged by calling
    this new function internally.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

11 Dec, 2015

1 commit


22 Nov, 2015

1 commit


16 Nov, 2015

3 commits

  • One of the many faults of the QinHeng CH345 USB MIDI interface chip is
    that it does not handle received SysEx messages correctly -- every second
    event packet has a wrong code index number, which is the one from the last
    seen message, instead of 4. For example, the two messages "FE F0 01 02 03
    04 05 06 07 08 09 0A 0B 0C 0D 0E F7" result in the following event
    packets:

    correct: CH345:
    0F FE 00 00 0F FE 00 00
    04 F0 01 02 04 F0 01 02
    04 03 04 05 0F 03 04 05
    04 06 07 08 04 06 07 08
    04 09 0A 0B 0F 09 0A 0B
    04 0C 0D 0E 04 0C 0D 0E
    05 F7 00 00 05 F7 00 00

    A class-compliant driver must interpret an event packet with CIN 15 as
    having a single data byte, so the other two bytes would be ignored. The
    message received by the host would then be missing two bytes out of six;
    in this example, "F0 01 02 03 06 07 08 09 0C 0D 0E F7".

    These corrupted SysEx event packages contain only data bytes, while the
    CH345 uses event packets with a correct CIN value only for messages with
    a status byte, so it is possible to distinguish between these two cases by
    checking for the presence of this status byte.

    (Other bugs in the CH345's input handling, such as the corruption resulting
    from running status, cannot be worked around.)

    Signed-off-by: Clemens Ladisch
    Cc: stable@vger.kernel.org
    Signed-off-by: Takashi Iwai

    Clemens Ladisch
     
  • The CH345 USB MIDI chip has two output ports. However, they are
    multiplexed through one pin, and the number of ports cannot be reduced
    even for hardware that implements only one connector, so for those
    devices, data sent to either port ends up on the same hardware output.
    This becomes a problem when both ports are used at the same time, as
    longer MIDI commands (such as SysEx messages) are likely to be
    interrupted by messages from the other port, and thus to get lost.

    It would not be possible for the driver to detect how many ports the
    device actually has, except that in practice, _all_ devices built with
    the CH345 have only one port. So we can just ignore the device's
    descriptors, and hardcode one output port.

    Signed-off-by: Clemens Ladisch
    Cc: stable@vger.kernel.org
    Signed-off-by: Takashi Iwai

    Clemens Ladisch
     
  • Signed-off-by: Clemens Ladisch
    Cc:
    Signed-off-by: Takashi Iwai

    Clemens Ladisch
     

12 Oct, 2015

1 commit

  • This patch enables interrupt transfer mode for MIDI ports on newer
    Boss/Roland devices such as the GT-100/001 which support interrupt
    transfer on both IN and OUT MIDI endpoints. Previously this wasn't being
    enabled for these devices as the code was specifically looking for the
    scenario where the IN endpoint supported interrupt transfer and the OUT
    endpoint was bulk transfer. Newer devices support interrupt transfer for
    both endpoints.

    This has been tested on Boss devices GT-001, BR-80 and JS-8 and Roland
    VS-20.

    It would benefit from some regresison testing with other devices if
    possible.

    Signed-off-by: Keith A. Milner
    Signed-off-by: Takashi Iwai

    Keith A. Milner
     

19 Jan, 2015

1 commit


07 Dec, 2014

1 commit

  • In snd_usbmidi_error_timer(), the driver tries to resubmit MIDI input
    URBs to reactivate the MIDI stream, but this causes the error when
    some of URBs are still pending like:

    WARNING: CPU: 0 PID: 0 at ../drivers/usb/core/urb.c:339 usb_submit_urb+0x5f/0x70()
    URB ef705c40 submitted while active
    CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.16.6-2-desktop #1
    Hardware name: FOXCONN TPS01/TPS01, BIOS 080015 03/23/2010
    c0984bfa f4009ed4 c078deaf f4009ee4 c024c884 c09a135c f4009f00 00000000
    c0984bfa 00000153 c061ac4f c061ac4f 00000009 00000001 ef705c40 e854d1c0
    f4009eec c024c8d3 00000009 f4009ee4 c09a135c f4009f00 f4009f04 c061ac4f
    Call Trace:
    [] try_stack_unwind+0x156/0x170
    [] dump_trace+0x5a/0x1b0
    [] show_trace_log_lvl+0x46/0x50
    [] show_stack_log_lvl+0x51/0xe0
    [] show_stack+0x27/0x50
    [] dump_stack+0x45/0x65
    [] warn_slowpath_common+0x84/0xa0
    [] warn_slowpath_fmt+0x33/0x40
    [] usb_submit_urb+0x5f/0x70
    [] snd_usbmidi_submit_urb+0x14/0x60 [snd_usbmidi_lib]
    [] snd_usbmidi_error_timer+0x6a/0xa0 [snd_usbmidi_lib]
    [] call_timer_fn+0x30/0x130
    [] run_timer_softirq+0x1c2/0x260
    [] __do_softirq+0xc3/0x270
    [] do_softirq_own_stack+0x22/0x30
    [] irq_exit+0x8d/0xa0
    [] smp_apic_timer_interrupt+0x38/0x50
    [] apic_timer_interrupt+0x34/0x3c
    [] cpuidle_enter_state+0x3e/0xd0
    [] cpu_idle_loop+0x29d/0x3e0
    [] cpu_startup_entry+0x53/0x60
    [] start_kernel+0x415/0x41a

    For avoiding these errors, check the pending URBs and skip
    resubmitting such ones.

    Reported-and-tested-by: Stefan Seyfried
    Acked-by: Clemens Ladisch
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

11 Oct, 2014

1 commit

  • Pull sound updates from Takashi Iwai:
    "This time it's a relatively calm update batch, but the amount isn't
    too small in the end. Here we go over some highlights:

    ALSA core:
    - One major change is the support of nonatomic PCM operations. This
    allows the trigger and other callbacks to call schedule(), which
    would be useful for mailbox type communications. Already some
    drivers (Digigram ones) have been converted to use together with
    threaded irqs as an example.
    - Improvement / fixes of DSD PCM format support

    HD-audio:
    - Large volume of rewrites are found in Realtek codec driver for
    converting Dell and HP quirks to generic forms.
    - Inverted dmic code cleanup from David.
    - Realtek COEF access has been optimized.
    - Now HD-audio jack infrastructure allows multiple callbacks, which
    fixes / simplifies the jack-dependent power controls on STAC/IDT
    and VIA codecs.
    - Many additional device-specific fixups as usual
    - A few deadcode cleanups, CA0132 code cleanup, etc.

    ASoC:
    - More componentization work from Lars-Peter, this time mainly
    cleaning up the suspend and bias level transition callbacks.
    - Real system support for the Intel drivers and a bunch of fixes and
    enhancements for the associated CODEC drivers, this is going to
    need a lot quirks over time due to the lack of any firmware
    description of the boards.
    - Jack detect support for simple card from Dylan Reid.
    - A bunch of small fixes and enhancements for the Freescale drivers.
    - New drivers for Analog Devices SSM4567, Cirrus Logic CS35L32,
    Everest Semiconductor ES8328 and Freescale cards using the ASRC in
    newer i.MX processors.
    - A few simple-card fixes, mostly cleanups but also a fix for
    interaction between GPIO 0 and simple-card.

    Misc:
    - Virtuoso / Oxygen updates by Clemens
    - USB-audio: Yamaha MOTIF XF MIDI port name fixes
    - Conversion of kernel messages to standard dev_*() in ctxfi driver"

    * tag 'sound-3.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (251 commits)
    ASoC: mc13783: Ensure we only try to dereference valid of_nodes
    ASoC: rockchip-i2s: fix infinite loop in rockchip_snd_txctrl
    ALSA: hda - Add dock port support to Thinkpad L440 (71aa:501e)
    ALSA: Allow pass NULL dev for snd_pci_quirk_lookup()
    ASoC: imx-es8328: Fix of_node_put() call with uninitialized object
    ASoC: soc-pcm: fix sig_bits determination in soc_pcm_apply_msb()
    ASoC: simple-card: Initialize headphone and mic GPIO numbers
    ASoC: imx-es8328: Fix missing return code in imx_es8328_probe()
    ALSA: hda - Add dock support for Thinkpad T440 (17aa:2212)
    ALSA: usb: caiaq: check for cdev->n_streams > 1
    ASoC: 88pm860x-codec: Fix possibly missing string termination
    ASoC: core: fix use after free in snd_soc_remove_platform()
    ASoC: soc-dapm: fix use after free
    ALSA: hda - Make the inv dmic handling for Realtek use generic parser
    ALSA: hda - Add Inverted Internal mic for Samsung Ativ book 9 (NP900X3G)
    ALSA: hda - Add inverted internal mic for Asus Aspire 4830T
    ASoC: Intel: byt-rt5640: fix coccinelle warnings
    ASoC: fsl_esai doc: Add "fsl,vf610-esai" as compatible string
    ASoC: da732x: Remove unnecessary KERN_ERR in pr_err()
    ASoC: simple-card: Fix detect gpio documentation.
    ...

    Linus Torvalds
     

24 Sep, 2014

1 commit

  • USB hub has started to use a workqueue instead of kthread. Let's update
    the documentation and comments here and there.

    This patch mostly just replaces "khubd" with "hub_wq". There are only few
    exceptions where the whole sentence was updated. These more complicated
    changes can be found in the following files:

    Documentation/usb/hotplug.txt
    drivers/net/usb/usbnet.c
    drivers/usb/core/hcd.c
    drivers/usb/host/ohci-hcd.c
    drivers/usb/host/xhci.c

    Signed-off-by: Petr Mladek
    Acked-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Petr Mladek
     

08 Sep, 2014

1 commit


06 Aug, 2014

2 commits


26 Feb, 2014

1 commit

  • Convert with dev_err() and co from snd_printk(), etc.
    As there are too deep indirections (e.g. ep->chip->dev->dev),
    a few new local macros, usb_audio_err() & co, are introduced.

    Also, the device numbers in some messages are dropped, as they are
    shown in the prefix automatically.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

28 Jun, 2013

2 commits

  • Signed-off-by: Clemens Ladisch

    Clemens Ladisch
     
  • Add quirks to detect the various vendor-specific descriptors used by
    Roland and Yamaha in most of their recent USB audio and MIDI devices.

    Together with the previous patch, this should add audio/MIDI support for
    the following USB devices:
    - Edirol motion dive .tokyo performance package
    - Roland MC-808 Synthesizer
    - Roland BK-7m Synthesizer
    - Roland VIMA JM-5/8 Synthesizer
    - Roland SP-555 Sequencer
    - Roland V-Synth GT Synthesizer
    - Roland Music Atelier AT-75/100/300/350C/500/800/900/900C Organ
    - Edirol V-Mixer M-200i/300/380/400/480/R-1000
    - BOSS GT-10B Effects Processor
    - Roland Fantom G6/G7/G8 Keyboard
    - Cakewalk Sonar V-Studio 20/100/700 Audio Interface
    - Roland GW-8 Keyboard
    - Roland AX-Synth Keyboard
    - Roland JUNO-Di/STAGE/Gi Keyboard
    - Roland VB-99 Effects Processor
    - Cakewalk UM-2G MIDI Interface
    - Roland A-500S Keyboard
    - Roland SD-50 Synthesizer
    - Roland OCTAPAD SPD-30 Controller
    - Roland Lucina AX-09 Synthesizer
    - BOSS BR-800 Digital Recorder
    - Roland DUO/TRI-CAPTURE (EX) Audio Interface
    - BOSS RC-300 Loop Station
    - Roland JUPITER-50/80 Keyboard
    - Roland R-26 Recorder
    - Roland SPD-SX Controller
    - BOSS JS-10 Audio Player
    - Roland TD-11/15/30 Drum Module
    - Roland A-49/88 Keyboard
    - Roland INTEGRA-7 Synthesizer
    - Roland R-88 Recorder

    Signed-off-by: Clemens Ladisch

    Clemens Ladisch
     

15 Apr, 2013

1 commit

  • Commit 88a8516a2128 (ALSA: usbaudio: implement USB autosuspend)
    introduced autopm for all USB audio/MIDI devices. However, many MIDI
    devices, such as synthesizers, do not merely transmit MIDI messages but
    use their MIDI inputs to control other functions. With autopm, these
    devices would get powered down as soon as the last MIDI port device is
    closed on the host.

    Even some plain MIDI interfaces could get broken: they automatically
    send Active Sensing messages while powered up, but as soon as these
    messages cease, the receiving device would interpret this as an
    accidental disconnection.

    Commit f5f165418cab (ALSA: usb-audio: Fix missing autopm for MIDI input)
    introduced another regression: some devices (e.g. the Roland GAIA SH-01)
    are self-powered but do a reset whenever the USB interface's power state
    changes.

    To work around all this, just disable autopm for all USB MIDI devices.

    Reported-by: Laurens Holst
    Cc:
    Signed-off-by: Clemens Ladisch
    Signed-off-by: Takashi Iwai

    Clemens Ladisch
     

04 Apr, 2013

2 commits


04 Jan, 2013

1 commit

  • This patch is based on 3.8-rc1. It fixes two things:
    1) A kernel panic caused by incorrect allocation of a u8 variable
    "bootresponse".
    2) A noisy dmesg (urb status -32) caused by broken pipe to an
    invalid midi endpoint.

    It is also a little cleaner because there is no need for a new
    QUIRK_MIDI type as suggested by kernel developers, since the device
    follows exactly the MIDIMAN protocol.

    Signed-off-by: Damien Zammit
    Signed-off-by: Takashi Iwai

    Damien Zammit
     

19 Dec, 2012

1 commit

  • This patch is the result of a lot of trial and error, since there are no specs
    available for the device.

    Full duplex support is provided, i.e. playback and recording in stereo.
    The format is hardcoded at 48000Hz @ 24 bit, which is the maximum that the
    device supports. Also, MIDI in and MIDI out both work.

    Users will notice that the S/PDIF light also flashes when playback or recording
    is active. I believe this means that S/PDIF input/output is simultaneously
    activated with the analogue i/o during use.
    But this particular functionality remains untested.

    Note that this particular version of the patch is so far untested on the
    physical hardware because I have not compiled a full kernel with the changes.
    However, extensive testing has been done by many users of the hardware
    who believe other versions of my patch have worked since circa 2009.

    [Modified to make a function static by tiwai]

    Signed-off-by: Damien Zammit
    Signed-off-by: Takashi Iwai

    Damien Zammit
     

04 Dec, 2012

2 commits

  • The commit [88a8516a: ALSA: usbaudio: implement USB autosuspend] added
    the support of autopm for USB MIDI output, but it didn't take the MIDI
    input into account.

    This patch adds the following for fixing the autopm:
    - Manage the URB start at the first MIDI input stream open, instead of
    the time of instance creation
    - Move autopm code to the common substream_open()
    - Make snd_usbmidi_input_start/_stop() more robust and add the running
    state check

    Reviewd-by: Clemens Ladisch
    Tested-by: Clemens Ladisch
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • Add a similar protection against the disconnection race and the
    invalid use of usb instance after disconnection, as well as we've done
    for the USB audio PCM.

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=51201

    Reviewd-by: Clemens Ladisch
    Tested-by: Clemens Ladisch
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

19 Nov, 2012

1 commit

  • Commit 88a8516a2128 (ALSA: usbaudio: implement USB autosuspend) added
    autosuspend code to all files making up the snd-usb-audio driver.
    However, midi.c is part of snd-usb-lib and is also used by other
    drivers, not all of which support autosuspend. Thus, calls to
    usb_autopm_get_interface() could fail, and this unexpected error would
    result in the MIDI output being completely unusable.

    Make it work by ignoring the error that is expected with drivers that do
    not support autosuspend.

    Reported-by: Colin Fletcher
    Reported-by: Devin Venable
    Reported-by: Dr Nick Bailey
    Reported-by: Jannis Achstetter
    Reported-by: Rui Nuno Capela
    Cc: Oliver Neukum
    Cc: 2.6.39+
    Signed-off-by: Clemens Ladisch

    Clemens Ladisch
     

01 Nov, 2011

1 commit


26 Aug, 2011

1 commit


06 Apr, 2011

1 commit


11 Mar, 2011

1 commit

  • Devices are autosuspended if no pcm nor midi channel is open
    Mixer devices may be opened. This way they are active when
    in use to play or record sound, but can be suspended while
    users have a mixer application running.

    [Small clean-ups using static inline by tiwai]

    Signed-off-by: Oliver Neukum
    Signed-off-by: Takashi Iwai

    Oliver Neukum
     

12 Jan, 2011

1 commit


10 Jan, 2011

1 commit


23 Oct, 2010

1 commit


14 Aug, 2010

1 commit

  • This is V2 of the patch, after feedback from Clemens and Daniel.

    This patch adds SuperSpeed support to the USB drivers under sound/. It adds
    tests for USB_SPEED_SUPER to the appropriate places that check for the USB
    speed.

    This patch has been tested with our SS USB3 device emulating a set of Yamaha
    speakers and a Logitech microphone, but with the descriptors modified to add
    USB3 support. It has also been tested with the real speakers and microphone,
    to make sure that USB2 devices still work.

    Signed-off-by: Paul Zimmerman
    Cc: Clemens Ladisch
    Cc: Daniel Mack
    Cc: Greg Kroah-Hartman
    Signed-off-by: Takashi Iwai

    Paul Zimmerman