15 Feb, 2017

1 commit

  • commit f3d83317a69e7d658e7c83e24f8b31ac533c39e3 upstream.

    This reverts commit f6a0dd107ad0c8b59d1c9735eea4b8cb9f460949.

    The commit caused a regression on LINE6 Transport that has no control
    caps. Although reverting the commit may result back in a spurious
    error message for some device again, it's the simplest regression fix,
    hence it's taken as is at first. The further code fix will follow
    later.

    Fixes: f6a0dd107ad0 ("ALSA: line6: Only determine control port properties if needed")
    Reported-by: Igor Zinovev
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

15 Jan, 2017

1 commit

  • commit 2e40795c3bf344cfb5220d94566205796e3ef19a upstream.

    Plantronics BT600 does not support reading the sample rate which leads
    to many lines of "cannot get freq at ep 0x1" and "cannot get freq at
    ep 0x82". This patch adds the USB ID of the BT600 to quirks.c and
    avoids those error messages.

    Signed-off-by: Dennis Kadioglu
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Dennis Kadioglu
     

12 Jan, 2017

2 commits

  • commit 4763601a56f155ddf94ef35fc2c41504a2de15f5 upstream.

    The function returns -EINVAL even if it builds the stream properly.
    The bogus error code sneaked in during the code refactoring, but it
    wasn't noticed until now since the returned error code itself is
    ignored in anyway. Kill it here, but there is no behavior change by
    this patch, obviously.

    Fixes: e5779998bf8b ('ALSA: usb-audio: refactor code')
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit 1d0f953086f090a022f2c0e1448300c15372db46 upstream.

    Commit 16200948d83 ("ALSA: usb-audio: Fix race at stopping the stream") was
    incomplete causing another more severe kernel panic, so it got reverted.
    This fixes both the original problem and its fallout kernel race/crash.

    The original fix is to move the endpoint member NULL clearing logic inside
    wait_clear_urbs() so the irq triggering the urb completion doesn't call
    retire_capture/playback_urb() after the NULL clearing and generate a panic.

    However this creates a new race between snd_usb_endpoint_start()'s call
    to wait_clear_urbs() and the irq urb completion handler which again calls
    retire_capture/playback_urb() leading to a new NULL dereference.

    We keep the EP deactivation code in snd_usb_endpoint_start() because
    removing it will break the EP reference counting (see [1] [2] for info),
    however we don't need the "can_sleep" mechanism anymore because a new
    function was introduced (snd_usb_endpoint_sync_pending_stop()) which
    synchronizes pending stops and gets called inside the pcm prepare callback.

    It also makes sense to remove can_sleep because it was also removed from
    deactivate_urbs() signature in [3] so we benefit from more simplification.

    [1] commit 015618b90 ("ALSA: snd-usb: Fix URB cancellation at stream start")
    [2] commit e9ba389c5 ("ALSA: usb-audio: Fix scheduling-while-atomic bug in PCM capture stream")
    [3] commit ccc1696d5 ("ALSA: usb-audio: simplify endpoint deactivation code")

    Fixes: f8114f8583bb ("Revert "ALSA: usb-audio: Fix race at stopping the stream"")

    Signed-off-by: Ioan-Adrian Ratiu
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Ioan-Adrian Ratiu
     

06 Jan, 2017

2 commits

  • commit 995c6a7fd9b9212abdf01160f6ce3193176be503 upstream.

    Sampling rate changes after first set one are not reflected to the
    hardware, while driver and ALSA think the rate has been changed.

    Fix the problem by properly stopping the interface at the beginning of
    prepare call, allowing new rate to be set to the hardware. This keeps
    the hardware in sync with the driver.

    Signed-off-by: Jussi Laako
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Jussi Laako
     
  • commit 82ffb6fc637150b279f49e174166d2aa3853eaf4 upstream.

    The Logitech QuickCam Communicate Deluxe/S7500 microphone fails with the
    following warning.

    [ 6.778995] usb 2-1.2.2.2: Warning! Unlikely big volume range (=3072),
    cval->res is probably wrong.
    [ 6.778996] usb 2-1.2.2.2: [5] FU [Mic Capture Volume] ch = 1, val =
    4608/7680/1

    Adding it to the list of devices in volume_control_quirks makes it work
    properly, fixing related typo.

    Signed-off-by: Con Kolivas
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Con Kolivas
     

15 Nov, 2016

1 commit

  • The usb-audio driver implements the deferred device disconnection for
    the device in use. In this mode, the disconnection callback returns
    immediately while the actual ALSA card object removal happens later
    when all files get closed. As Shuah reported, this code flow,
    however, leads to a use-after-free, detected by KASAN:

    BUG: KASAN: use-after-free in snd_usb_audio_free+0x134/0x160 [snd_usb_audio] at addr ffff8801c863ce10
    Write of size 8 by task pulseaudio/2244
    Call Trace:
    [] dump_stack+0x67/0x94
    [] kasan_object_err+0x21/0x70
    [] kasan_report_error+0x1fa/0x4e0
    [] ? kasan_slab_free+0x87/0xb0
    [] __asan_report_store8_noabort+0x43/0x50
    [] ? snd_usb_audio_free+0x134/0x160 [snd_usb_audio]
    [] snd_usb_audio_free+0x134/0x160 [snd_usb_audio]
    [] snd_usb_audio_dev_free+0x31/0x40 [snd_usb_audio]
    [] __snd_device_free+0x12a/0x210
    [] snd_device_free_all+0x85/0xd0
    [] release_card_device+0x34/0x130
    [] device_release+0x76/0x1e0
    [] kobject_release+0x107/0x370
    .....
    Object at ffff8801c863cc80, in cache kmalloc-2048 size: 2048
    Allocated:
    [] save_stack_trace+0x2b/0x50
    [] save_stack+0x46/0xd0
    [] kasan_kmalloc+0xad/0xe0
    [] kmem_cache_alloc_trace+0xfa/0x240
    [] usb_alloc_dev+0x57/0xc90
    [] hub_event+0xf1d/0x35f0
    ....
    Freed:
    [] save_stack_trace+0x2b/0x50
    [] save_stack+0x46/0xd0
    [] kasan_slab_free+0x71/0xb0
    [] kfree+0xd9/0x280
    [] usb_release_dev+0xde/0x110
    [] device_release+0x76/0x1e0
    ....

    It's the code trying to clear drvdata of the assigned usb_device where
    the usb_device itself was already released in usb_release_dev() after
    the disconnect callback.

    This patch fixes it by checking whether the code path is via the
    disconnect callback, i.e. chip->shutdown flag is set.

    Fixes: 79289e24194a ('ALSA: usb-audio: Refer to chip->usb_id for quirks...')
    Reported-and-tested-by: Shuah Khan
    Cc: # v4.6+
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

27 Oct, 2016

1 commit

  • The stk1160 chip needs QUIRK_AUDIO_ALIGN_TRANSFER. This patch resolves
    the issue reported on the mailing list
    (http://marc.info/?l=linux-sound&m=139223599126215&w=2) and also fixes
    bug 180071 (https://bugzilla.kernel.org/show_bug.cgi?id=180071).

    Signed-off-by: Marcel Hasler
    Cc:
    Signed-off-by: Takashi Iwai

    Marcel Hasler
     

13 Oct, 2016

1 commit


10 Oct, 2016

1 commit

  • The commit c039aaa77a7d1d9375665a8b59ec16dc7d23e259 was incomplete,
    missing part of the setup for Live. This makes also audio input work,
    in addition to audio output.

    Fixes: c039aaa77a7d1d9375665a8b59ec16dc7d23e259
    Reported-by: Eddi De Pieri
    Signed-off-by: Andrej Krutak
    Signed-off-by: Takashi Iwai

    Andrej Krutak
     

30 Sep, 2016

1 commit


26 Sep, 2016

1 commit

  • Currently, usb-line6 module exports an array of MIDI manufacturer ID and
    usb-pod module uses it. However, the declaration is not the definition in
    common header. The difference is explicit length of array. Although
    compiler calculates it and everything goes well, it's better to use the
    same representation between definition and declaration.

    This commit fills the length of array for usb-line6 module. As a small
    good sub-effect, this commit suppress below warnings from static analysis
    by sparse v0.5.0.

    sound/usb/line6/driver.c:274:43: error: cannot size expression
    sound/usb/line6/driver.c:275:16: error: cannot size expression
    sound/usb/line6/driver.c:276:16: error: cannot size expression
    sound/usb/line6/driver.c:277:16: error: cannot size expression

    Fixes: 705ececd1c60 ("Staging: add line6 usb driver")
    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     

23 Sep, 2016

1 commit

  • The DragonFly quirk added in 42e3121d90f4 ("ALSA: usb-audio: Add a more
    accurate volume quirk for AudioQuest DragonFly") applies a custom dB map
    on the volume control when its range is reported as 0..50 (0 .. 0.2dB).

    However, there exists at least one other variant (hw v1.0c, as opposed
    to the tested v1.2) which reports a different non-sensical volume range
    (0..53) and the custom map is therefore not applied for that device.

    This results in all of the volume change appearing close to 100% on
    mixer UIs that utilize the dB TLV information.

    Add a fallback case where no dB TLV is reported at all if the control
    range is not 0..50 but still 0..N where N
    Reported-by: David W
    Tested-by: David W
    Cc:
    Signed-off-by: Takashi Iwai

    Anssi Hannula
     

21 Sep, 2016

1 commit

  • ERROR: "snd_hwdep_new" [sound/usb/line6/snd-usb-line6.ko] undefined!
    scripts/Makefile.modpost:91: recipe for target '__modpost' failed
    make[1]: *** [__modpost] Error 1

    Fixes: a16039cbf1a1 ('ALSA: line6: Add hwdep interface to access the POD control messages')
    Signed-off-by: Valdis Kletnieks
    Reviewed-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Valdis Kletnieks
     

20 Sep, 2016

13 commits


11 Sep, 2016

1 commit


29 Aug, 2016

1 commit


22 Aug, 2016

7 commits

  • kmalloc already print similar error once failing to alloc
    enough memory, so let's remove this dump here.

    Signed-off-by: Shawn Lin
    Signed-off-by: Takashi Iwai

    Shawn Lin
     
  • Users of devices affected by the Tenor feedback data error report
    buffer underruns, even with the +/- 0x1.0000 quirk applied.
    Compensating the error with 0xf000 instead seems to reliably fix
    that issue.

    See

    https://sourceforge.net/p/alsa/mailman/message/35230259/

    Reported-and-tested-by: Norman Nolte
    Reported-and-tested-by: Thomas Gresens
    Signed-off-by: Daniel Mack
    Signed-off-by: Takashi Iwai

    Daniel Mack
     
  • The quirk seems to be necessary not only for TEAC UD-H01 devices, but to
    more that are based on the Tenor 8802TL chipset. Devices built by T+A
    are affected too, and they apparently all use the same USB PID:PID.

    Extend the quirky handling for that device as well, and rename the
    quirks flag.

    Reported-and-tested-by: Thomas Gresens
    Signed-off-by: Daniel Mack
    Signed-off-by: Takashi Iwai

    Daniel Mack
     
  • That's a quirk, after all, so move it where to all the other quirks
    live.

    Signed-off-by: Daniel Mack
    Signed-off-by: Takashi Iwai

    Daniel Mack
     
  • The commit 02fc76f6a changed base of the sysfs attributes from device to card.
    The "show" callbacks dereferenced wrong objects because of this.

    Fixes: 02fc76f6a7db ('ALSA: line6: Create sysfs via snd_card_add_dev_attr()')
    Cc: # v4.0+
    Reviewed-by: Stefan Hajnoczi
    Signed-off-by: Andrej Krutak
    Signed-off-by: Takashi Iwai

    Andrej Krutak
     
  • Done, because line6_stream_stop() locks and calls line6_unlink_audio_urbs(),
    which in turn invokes audio_out_callback(), which tries to lock 2nd time.

    Fixes:

    =============================================
    [ INFO: possible recursive locking detected ]
    4.4.15+ #15 Not tainted
    ---------------------------------------------
    mplayer/3591 is trying to acquire lock:
    (&(&line6pcm->out.lock)->rlock){-.-...}, at: [] audio_out_callback+0x70/0x110 [snd_usb_line6]

    but task is already holding lock:
    (&(&line6pcm->out.lock)->rlock){-.-...}, at: [] line6_stream_stop+0x24/0x5c [snd_usb_line6]

    other info that might help us debug this:
    Possible unsafe locking scenario:

    CPU0
    ----
    lock(&(&line6pcm->out.lock)->rlock);
    lock(&(&line6pcm->out.lock)->rlock);

    *** DEADLOCK ***

    May be due to missing lock nesting notation

    3 locks held by mplayer/3591:
    #0: (snd_pcm_link_rwlock){.-.-..}, at: [] snd_pcm_stream_lock+0x1e/0x40 [snd_pcm]
    #1: (&(&substream->self_group.lock)->rlock){-.-...}, at: [] snd_pcm_stream_lock+0x26/0x40 [snd_pcm]
    #2: (&(&line6pcm->out.lock)->rlock){-.-...}, at: [] line6_stream_stop+0x24/0x5c [snd_usb_line6]

    stack backtrace:
    CPU: 0 PID: 3591 Comm: mplayer Not tainted 4.4.15+ #15
    Hardware name: Generic AM33XX (Flattened Device Tree)
    [] (unwind_backtrace) from [] (show_stack+0x11/0x14)
    [] (show_stack) from [] (dump_stack+0x8b/0xac)
    [] (dump_stack) from [] (__lock_acquire+0xc8b/0x1780)
    [] (__lock_acquire) from [] (lock_acquire+0x99/0x1c0)
    [] (lock_acquire) from [] (_raw_spin_lock_irqsave+0x3f/0x4c)
    [] (_raw_spin_lock_irqsave) from [] (audio_out_callback+0x70/0x110 [snd_usb_line6])
    [] (audio_out_callback [snd_usb_line6]) from [] (__usb_hcd_giveback_urb+0x53/0xd0)
    [] (__usb_hcd_giveback_urb) from [] (musb_giveback+0x3d/0x98)
    [] (musb_giveback) from [] (musb_urb_dequeue+0x6d/0x114)
    [] (musb_urb_dequeue) from [] (usb_hcd_unlink_urb+0x39/0x98)
    [] (usb_hcd_unlink_urb) from [] (line6_unlink_audio_urbs+0x6a/0x6c [snd_usb_line6])
    [] (line6_unlink_audio_urbs [snd_usb_line6]) from [] (line6_stream_stop+0x42/0x5c [snd_usb_line6])
    [] (line6_stream_stop [snd_usb_line6]) from [] (snd_line6_trigger+0xb6/0xf4 [snd_usb_line6])
    [] (snd_line6_trigger [snd_usb_line6]) from [] (snd_pcm_do_stop+0x36/0x38 [snd_pcm])
    [] (snd_pcm_do_stop [snd_pcm]) from [] (snd_pcm_action_single+0x22/0x40 [snd_pcm])
    [] (snd_pcm_action_single [snd_pcm]) from [] (snd_pcm_action+0xac/0xb0 [snd_pcm])
    [] (snd_pcm_action [snd_pcm]) from [] (snd_pcm_drop+0x38/0x64 [snd_pcm])
    [] (snd_pcm_drop [snd_pcm]) from [] (snd_pcm_common_ioctl1+0x7fe/0xbe8 [snd_pcm])
    [] (snd_pcm_common_ioctl1 [snd_pcm]) from [] (snd_pcm_playback_ioctl1+0x15c/0x51c [snd_pcm])
    [] (snd_pcm_playback_ioctl1 [snd_pcm]) from [] (snd_pcm_playback_ioctl+0x20/0x28 [snd_pcm])
    [] (snd_pcm_playback_ioctl [snd_pcm]) from [] (do_vfs_ioctl+0x3af/0x5c8)

    Fixes: 63e20df1e5b2 ('ALSA: line6: Reorganize PCM stream handling')
    Cc: # v4.0+
    Reviewed-by: Stefan Hajnoczi
    Signed-off-by: Andrej Krutak
    Signed-off-by: Takashi Iwai

    Andrej Krutak
     
  • If there's an error, pcm is released in line6_pcm_acquire already.

    Fixes: 247d95ee6dd2 ('ALSA: line6: Handle error from line6_pcm_acquire()')
    Cc: # v4.0+
    Reviewed-by: Stefan Hajnoczi
    Signed-off-by: Andrej Krutak
    Signed-off-by: Takashi Iwai

    Andrej Krutak
     

12 Aug, 2016

1 commit


09 Aug, 2016

2 commits


25 Jul, 2016

1 commit