22 Aug, 2016
1 commit
-
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
21 Apr, 2015
1 commit
-
Roland SC-D70 reports its device class as vendor specific class and
the quirk QUIRK_AUDIO_FIXED_ENDPOINT was used for audio output.In the quirks table the sampling rate was hard-coded to 44100 Hz
and therefore not worked when the sound module was in 48000 Hz mode.In this change the quirk is changed to QUIRK_AUDIO_STANDARD_INTERFACE
but as the sound module reports incorrect bSubframeSize in its
descriptors, additional change is made in format.c to detect it and
to override it (which uses the existing code for Edirol SD-90).Tested both when the sound module was in 44100 Hz mode and 48000 Hz
mode and both audio input and output. MIDI related part of the driver
is not touched.Signed-off-by: Takamichi Horikawa
Signed-off-by: Takashi Iwai
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
14 Jan, 2014
1 commit
-
Creative Live! Cam Vista IM (VF0420) reports rate of 16kHz while working
at 8kHz. The patch adds its USB ID to the existing quirk.Signed-off-by: Pavel Hofman
Signed-off-by: Takashi Iwai
28 Jun, 2013
1 commit
-
Instead of reading bInterfaceProtocol from the descriptor whenever it's
needed, store this value in the audioformat structure. Besides
simplifying some code, this will allow us to correctly handle vendor-
specific devices where the descriptors are marked with other values.Signed-off-by: Clemens Ladisch
29 Apr, 2013
1 commit
-
Add a function to handle conversion from snd_pcm_format_t
to bitwise with proper typing.Change such conversions to use this function and silence sparse
warnings.Signed-off-by: Eldad Zack
Signed-off-by: Takashi Iwai
18 Apr, 2013
1 commit
-
Unfortunately, none of the UAC standards provides a way to identify DSD
(Direct Stream Digital) formats. Hence, this patch adds a quirks
handler to identify USB interfaces that are capable of handling DSD.That quirks handler can augment the already parsed formats bit-field,
by any of the new SNDRV_PCM_FMTBIT_DSD_{U8_U16} and setting the dsd_dop
flag in the audio format, if the driver should take care for the DOP
byte stuffing.The only devices that are known to work with this are the ones with
a 'Playback Designs' vendor id.Signed-off-by: Daniel Mack
Signed-off-by: Takashi Iwai
04 Apr, 2013
1 commit
-
Move the check that parse_audio_format_rates_v2() do after
receiving the clock source entity ID directly into the find
function and add a validation flag to the function.This patch does not introduce any logic flow change.
It is provided to allow introducing automatic clock switching
easier later. By moving this uac_clock_source_is_valid callsite,
2 additional callsites can be avoided.Signed-off-by: Eldad Zack
Signed-off-by: Takashi Iwai
18 Mar, 2013
2 commits
-
UAC2 compliant audio devices may announce the capability to transport
raw audio data on their endpoints. Catch this and handle it as
'special' stream on the ALSA side.Signed-off-by: Daniel Mack
Reported-by: Andreas Koch
Signed-off-by: Takashi Iwai -
This field may use up to 32 bits, so it should be handled as unsigned
int.Signed-off-by: Daniel Mack
Reported-by: Andreas Koch
Signed-off-by: Takashi Iwai
21 Nov, 2012
1 commit
-
Also, silences the following smatch warning:
sound/usb/format.c:170 parse_audio_format_rates_v1() warn:
returning -1 instead of -ENOMEM is sloppySigned-off-by: Sachin Kamat
Signed-off-by: Takashi Iwai
15 Feb, 2012
1 commit
-
A malicious USB device could feed in a large nr_rates value. This would
cause the subsequent call to kmemdup() to allocate a smaller buffer than
expected, leading to out-of-bounds access.This patch validates the nr_rates value and reuses the limit introduced
in commit 4fa0e81b ("ALSA: usb-audio: fix possible hang and overflow
in parse_uac2_sample_rate_range()").Signed-off-by: Xi Wang
Signed-off-by: Takashi Iwai
08 Jan, 2012
1 commit
-
A malicious USB device may feed in carefully crafted min/max/res values,
so that the inner loop in parse_uac2_sample_rate_range() could run for
a long time or even never terminate, e.g., given max = INT_MAX.Also nr_rates could be a large integer, which causes an integer overflow
in the subsequent call to kmalloc() in parse_audio_format_rates_v2().
Thus, kmalloc() would allocate a smaller buffer than expected, leading
to a memory corruption.To exploit the two vulnerabilities, an attacker needs physical access
to the machine to plug in a malicious USB device.This patch makes two changes.
1) The type of "rate" is changed to unsigned int, so that the loop could
stop once "rate" is larger than INT_MAX.2) Limit nr_rates to 1024.
Suggested-by: Takashi Iwai
Signed-off-by: Xi Wang
Signed-off-by: Takashi Iwai
27 Sep, 2011
1 commit
-
There are certain devices that are reportedly so slow that they need
more than 100 ms to handle control transfers. Therefore, increase the
timeout in mixer(_quirks).c to 1000 ms.The timeout parameter of snd_usb_ctl_msg() is now constant, so we can
drop it.Reported-by: Felipe Balbi
Signed-off-by: Clemens Ladisch
Signed-off-by: Takashi Iwai
22 May, 2011
1 commit
18 May, 2011
1 commit
-
Just in case a prototype changes, we'll be warned. This also fixes a
sparse warning.Signed-off-by: Daniel Mack
Signed-off-by: Takashi Iwai
29 Apr, 2011
1 commit
-
This patch adds support for the Terratec Aureon 7.1 USB which uses a
C-Media cm6206 and needs all the quirks already found in the past.Signed-off-by: Wolfgang Breyha
Signed-off-by: Takashi Iwai
10 Jan, 2011
1 commit
-
Add support for the 24-bit audio I/Os of the Edirol SD-90 interface.
Reported-any-tested-by: Jim Grusendorf
Signed-off-by: Clemens Ladisch
Signed-off-by: Takashi Iwai
04 Sep, 2010
1 commit
-
The Audio Class v2 support code in 2.6.35 added checks for the
bInterfaceProtocol field. However, there are devices (usually those
detected by vendor-specific quirks) that do not have one of the
predefined values in this field, which made the driver reject them.To fix this regression, restore the old behaviour, i.e., assume that
a device with an unknown bInterfaceProtocol field (other than
UAC_VERSION_2) has more or less UAC-v1-compatible descriptors.[compile warning fixes by tiwai]
Signed-off-by: Clemens Ladisch
Cc: Daniel Mack
Cc:
Signed-off-by: Takashi Iwai
15 Aug, 2010
1 commit
-
Gcc complains that ret might be used uninitialized:
sound/usb/format.c: In function ‘snd_usb_parse_audio_format’:
sound/usb/format.c:354: warning: ‘ret’ may be used uninitialized in this function
sound/usb/format.c:354: note: ‘ret’ was declared here
sound/usb/format.c:414: warning: ‘ret’ may be used uninitialized in this function
sound/usb/format.c:414: note: ‘ret’ was declared hereI suppose it could be uninitialized if there is ever a UAC_VERSION_3
released. Anyway this patch is worthwhile if only to silence the gcc
warning.Signed-off-by: Dan Carpenter
Acked-by: Daniel Mack
Signed-off-by: Takashi Iwai
23 Jun, 2010
1 commit
-
As the control interface is now carried in struct snd_usb_audio, we can
simplify the API a little and also drop the private ctrlif field from
struct usb_mixer_interface.Also remove a left-over function prototype in pcm.h.
Signed-off-by: Daniel Mack
Signed-off-by: Takashi Iwai
12 Jun, 2010
3 commits
-
A device may report its supported sample rates in ranges rather than in
discrete triplets. The code used to only parse the MIN field instead of
properly paying attention to the MAX and RES values.Also, handle RES values of 1 correctly and announce a continous sample
rate range in this case.Signed-off-by: Daniel Mack
Reported-by: Alex Lee
Signed-off-by: Takashi Iwai -
Control messages directed to an interface must have the interface number
set in the lower 8 bits of wIndex. This wasn't done correctly for some
clock and mixer messages.Signed-off-by: Daniel Mack
Reported-by: Alex Lee
Signed-off-by: Takashi Iwai -
Signed-off-by: Daniel Mack
Signed-off-by: Takashi Iwai
01 Jun, 2010
1 commit
-
Audio devices which comply to the UAC2 standard can export complex clock
topologies in its descriptors and set up links between them.The entities that are defined are
- clock sources, which define the end-leafs.
- clock selectors, which act as switch to select one out of many
possible clocks sources.
- clock multipliers, which have an input clock source, and act as clock
source again. They can be used to derive one clock from another.All sample rate changes, clock validity queries and the like must go to
clock source elements, while clock selectors and multipliers can be used
as terminal clock source.The following patch adds a parser for these elements and functions to
iterate over the tree and find the leaf nodes (clock sources).The samplerate set functions were moved to the new clock.c file.
Signed-off-by: Daniel Mack
Signed-off-by: Takashi Iwai
27 May, 2010
2 commits
-
-1 is not a good return value as it means -EPERM, "not permitted".
Choose -ENOTSUPP instead, which is what the code really wants to tell
its callers.Signed-off-by: Daniel Mack
Signed-off-by: Takashi Iwai -
Signed-off-by: Daniel Mack
Signed-off-by: Takashi Iwai
29 Mar, 2010
1 commit
-
Signed-off-by: Stephen Rothwell
Signed-off-by: Takashi Iwai
12 Mar, 2010
2 commits
-
No need for the private enum.
Signed-off-by: Daniel Mack
Cc: Clemens Ladisch
Signed-off-by: Takashi Iwai -
- Split the audio.h file in two to clearly denote the differences
between the standards.
- Add many more defines to audio-v2.h. Most of them are not currently
used.
- Replaced a magic value with a proper defineSigned-off-by: Daniel Mack
Acked-by: Greg Kroah-Hartman
Cc: Clemens Ladisch
Signed-off-by: Takashi Iwai
05 Mar, 2010
3 commits
-
Change the parser to correctly handle v2 descriptors with multiple
format bits set.Signed-off-by: Clemens Ladisch
Signed-off-by: Takashi Iwai -
In preparation for USB audio 2.0 support, change the audioformat
structure so that it uses a bitmask to specify possible formats.Signed-off-by: Clemens Ladisch
Signed-off-by: Takashi Iwai -
Clean up the usb audio driver by factoring out a lot of functions to
separate files. Code for procfs, quirks, urbs, format parsers etc all
got a new home now.Moved almost all special quirk handling to quirks.c and introduced new
generic functions to handle them, so the exceptions do not pollute the
whole driver.Renamed usbaudio.c to card.c because this is what it actually does now.
Renamed usbmidi.c to midi.c for namespace clarity.
Removed more things from usbaudio.h.The non-standard drivers were adopted accordingly.
Signed-off-by: Daniel Mack
Cc: Clemens Ladisch
Signed-off-by: Takashi Iwai