04 Feb, 2016
1 commit
-
We use the devm_snd_dmaengine_pcm_register() for platform,
don't use devm_snd_soc_register_platform(), their close
funtion is different. One will release the dma channel,
but another one won't release channel.When system enter suspend mode, alsa library is in draining
state, it will not resume alsa driver in system resume, just
call close directly. But the alsa driver is in state
SNDRV_PCM_STATE_SUSPENDED, which is not a running state, so
the trigger stop is not called, and dmaengine_terminate_all()
is not called, then dma resource is not released. Which cause
that in the next playback the sdma driver will not be started.
Then there is a lot of SAI underrun error.If we use the devm_snd_soc_register_platform() for platfrom
driver, there will be no issue, because it will release dma
channel, release dma resource. But we use the
devm_snd_dmaengine_pcm_register() for platform driver. So this
patch is to add dmaengine_terminate_all() in the
snd_dmaengine_pcm_close() to fix this issue.Signed-off-by: Shengjiu Wang
(cherry picked from commit ff62968ea8c8b5414f3f049e61addcd4d2bec3b9)
15 Jan, 2016
2 commits
-
cherry-pick below patch from imx_3.14.y
ENGR00307835-2 ASoC: dmaengine: Add two function for dmaengine_pcmAdd check_xrun and device_reset for dmaengine_pcm
Signed-off-by: Shengjiu Wang
(cherry picked from commit 405588f31e432e5c6634a0817e4d804ead87882b) -
There is occasion that dma callback come late after the substream is released.
Then there will be kernel dump.[] (imx_pcm_dma_complete) from [] (sdma_handle_channel_loop.isra.25+0x48/0x54)
[] (sdma_handle_channel_loop.isra.25) from [] (sdma_tasklet+0xa0/0x1d4)
[] (sdma_tasklet) from [] (tasklet_action+0x64/0xf8)
[] (tasklet_action) from [] (__do_softirq+0x104/0x218)
[] (__do_softirq) from [] (irq_exit+0xa8/0xec)
[] (irq_exit) from [] (handle_IRQ+0x3c/0x90)
[] (handle_IRQ) from [] (gic_handle_irq+0x28/0x5c)
[] (gic_handle_irq) from [] (__irq_svc+0x40/0x70)The reason is the sdma tasklet is async with audio substream release. ALSA
think when terminate dma, the dma should be stopped and no callback be called.This patch is to add new api dma_sync_wait_tasklet(), which is called in
snd_dmaengine_pcm_close(). It will make sure the callback not be called
after this funtion. Tasklet_kill is to wait scheduled tasklet end.Tasklet_kill can't be added to terminate dma function, because terminate dma
function may be called in interrupt, but tasklet_kill can't be called in
interrupt context.Signed-off-by: Shengjiu Wang
(cherry picked from commit 9815881b6acaa72a705e1fa3c26a852fc81bfce5)
11 Aug, 2015
1 commit
-
commit 67756e3191c90e7c0b94b8b2fb63de255b6cd337 upstream.
With the nonatomic PCM ops, the system may spew lockdep warnings like:
=============================================
[ INFO: possible recursive locking detected ]
4.2.0-rc1-jeejaval3 #12 Not tainted
---------------------------------------------
aplay/4029 is trying to acquire lock:
(snd_pcm_link_rwsem){.+.+.+}, at: [] snd_pcm_stream_lock+0x43/0x60but task is already holding lock:
(snd_pcm_link_rwsem){.+.+.+}, at: [] snd_pcm_action_nonatomic+0x29/0x80other info that might help us debug this:
Possible unsafe locking scenario:CPU0
----
lock(snd_pcm_link_rwsem);
lock(snd_pcm_link_rwsem);Although this is false-positive as the rwsem is taken always as
read-only for these code paths, it's certainly annoying to see this at
any occasion. A simple fix is to use down_read_nested() in
snd_pcm_stream_lock() that can be called inside another lock.Reported-by: Vinod Koul
Reported-by: Jeeja Kp
Tested-by: Jeeja Kp
Signed-off-by: Takashi Iwai
Signed-off-by: Greg Kroah-Hartman
22 Jul, 2015
1 commit
-
commit 60b93030b44a8c2cd015cebe5624fd7552ec67ec upstream.
The pcm_class sysfs of each PCM substream gives only "none" since the
recent code change to embed the struct device. Fix the code to point
directly to the embedded device object properly.Fixes: ef46c7af93f9 ('ALSA: pcm: Embed struct device')
Signed-off-by: Takashi Iwai
Signed-off-by: Greg Kroah-Hartman
19 May, 2015
1 commit
-
Currently in snd_pcm_update_hw_ptr0 during interrupt,
we consider there were double acknowledged interrupts when:
1. HW reported pointer is smaller than expected, and
2. Time from last update time (hdelta) is over half a buffer time.However, when HW reported pointer is only a few bytes smaller than
expected, and when hdelta is just a little larger than half a buffer time
(e.g. ping-pong buffer), it wrongly treats this IRQ as double acknowledged.The condition #2 uses jiffies, but jiffies is not high resolution
since it is integer. We should consider jiffies inaccuracy.Signed-off-by: Koro Chen
Signed-off-by: Takashi Iwai
16 Apr, 2015
1 commit
-
Pull sound updates from Takashi Iwai:
"There have been major modernization with the standard bus: in ALSA
sequencer core and HD-audio. Also, HD-audio receives the regmap
support replacing the in-house cache register cache code. These
changes shouldn't impact the existing behavior, but rather
refactoring.In addition, HD-audio got the code split to a core library part and
the "legacy" driver parts. This is a preliminary work for adapting
the upcoming ASoC HD-audio driver, and the whole transition is still
work in progress, likely finished in 4.1.Along with them, there are many updates in ASoC area as usual, too:
lots of cleanups, Intel code shuffling, etc.Here are some highlights:
ALSA core:
- PCM: the audio timestamp / wallclock enhancement
- PCM: fixes in DPCM management
- Fixes / cleanups of user-space control element management
- Sequencer: modernization using the standard busHD-audio:
- Modernization using the standard bus
- Regmap support
- Use standard runtime PM for codec power saving
- Widget-path based power-saving for IDT, VIA and Realtek codecs
- Reorganized sysfs entries for each codec object
- More Dell headset supportASoC:
- Move of jack registration to the card level
- Lots of ASoC cleanups, mainly moving things from the CODEC level to
the card level
- Support for DAPM routes specified by both the machine driver and DT
- Continuing improvements to rcar
- pcm512x enhacements
- Intel platforms updates
- rt5670 updates / fixes
- New platforms / devices: some non-DSP Qualcomm platforms, Google's
Storm platform, Maxmim MAX98925 CODECs and the Ingenic JZ4780 SoCMisc:
- ice1724: Improved ESI W192M support
- emu10k1: Emu 1010 fixes/enhancement"* tag 'sound-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (411 commits)
ALSA: hda - set GET bit when adding a vendor verb to the codec regmap
ALSA: hda/realtek - Enable the ALC292 dock fixup on the Thinkpad T450
ALSA: hda - Fix another race in runtime PM refcounting
ALSA: hda - Expose codec type sysfs
ALSA: ctl: fix to handle several elements added by one operation for userspace element
ASoC: Intel: fix array_size.cocci warnings
ASoC: n810: Automatically disconnect non-connected pins
ASoC: n810: Consistently pass the card DAPM context to n810_ext_control()
ASoC: davinci-evm: Use card DAPM context to access widgets
ASoC: mop500_ab8500: Use card DAPM context to access widgets
ASoC: wm1133-ev1: Use card DAPM context to access widgets
ASoC: atmel: Improve machine driver compile test coverage
ASoC: atmel: Add dependency to SND_SOC_I2C_AND_SPI where necessary
ALSA: control: Fix a typo of SNDRV_CTL_ELEM_ACCESS_TLV_* with SNDRV_CTL_TLV_OP_*
ALSA: usb-audio: Don't attempt to get Microsoft Lifecam Cinema sample rate
ASoC: rnsd: fix build regression without CONFIG_OF
ALSA: emu10k1: add toggles for E-mu 1010 optical ports
ALSA: ctl: fill identical information to return value when adding userspace elements
ALSA: ctl: fix a bug to return no identical information in info operation for userspace controls
ALSA: ctl: confirm to return all identical information in 'activate' event
...
13 Apr, 2015
1 commit
-
An element instance can have several elements with the same feature.
Some userspace applications can add such an element instance by add
operation with the number of elements. Then, the element instance
gets a memory object to keep states of these elements.But the element instance has just one memory object for the elements.
This causes the same result to each read/write operations to the
different elements.This commit fixes this bug by allocating enough memory objects to the
element instance for each of elements.Signed-off-by: Takashi Sakamoto
Signed-off-by: Takashi Iwai
12 Apr, 2015
3 commits
-
The commit [39d118677baa: ALSA: ctl: evaluate macro instead of
numerical value] replaced the numbers with constants, but one place
was replaced wrongly with a different type. Fixed now.Fixes: 39d118677baa ('ALSA: ctl: evaluate macro instead of numerical value')
Signed-off-by: Takashi Iwai -
readv() and writev() should _not_ ignore all but the first ->iov_len,
among other things. Really weird abuse of those syscalls - it
expects a vector element per channel, with identical lengths (it
actually assumes them to be identical - no checking is done).
readv() and writev() are really bad match for that. Unfortunately,
userland API is userland API and we can't do anything about them.Converted to ->read_iter/->write_iter. Please, _please_ don't do
anything of that kind when designing new interfaces.Signed-off-by: Al Viro
11 Apr, 2015
4 commits
-
currently some members related identical information are not fiiled
in returned parameter of SNDRV_CTL_IOCTL_ELEM_ADD. This is not better
for userspace application.This commit copies information to returned value. When failing to copy
into userspace, the added elements are going to be removed. Then, no
applications can lock these elements between adding and removing because
these are already locked.Signed-off-by: Takashi Sakamoto
Signed-off-by: Takashi Iwai -
In operations of SNDRV_CTL_IOCTL_ELEM_INFO, identical information in
returned value is cleared. This is not better to userspace application.This commit confirms to return full identical information to the
operations.Signed-off-by: Takashi Sakamoto
Signed-off-by: Takashi Iwai -
When event originator doesn't set numerical ID in identical information,
the event data includes no numerical ID, thus userspace applications
cannot identify the control just by unique ID in event data.This commit fix this bug so as the event data includes all of identical
information.Signed-off-by: Takashi Sakamoto
Signed-off-by: Takashi Iwai -
The returned value of 'get/seq client pool' operation has zeroed value
for its client ID, against requested client ID.This commit fix the bug by filling it with index value of referred
client object.Signed-off-by: Takashi Sakamoto
Signed-off-by: Takashi Iwai
10 Apr, 2015
1 commit
-
SNDRV_CTL_TLV_OP_XXX is defined but not used in core code. Instead,
raw numerical value is evaluated.This commit replaces these values to these macros for better looking.
Signed-off-by: Takashi Sakamoto
Signed-off-by: Takashi Iwai
26 Mar, 2015
1 commit
-
struct kiocb now is a generic I/O container, so move it to fs.h.
Also do a #include diet for aio.h while we're at it.Signed-off-by: Christoph Hellwig
Signed-off-by: Al Viro
16 Mar, 2015
1 commit
13 Mar, 2015
1 commit
-
In the commit [2225e79b9b03: 'ALSA: core: reduce stack usage related
to snd_ctl_new()'], the id field of the newly added kctl is untouched,
thus all attribute like name string remain empty. The fix is just to
add the forgotten memcpy of the id field.Fixes: 2225e79b9b03 ('ALSA: core: reduce stack usage related to snd_ctl_new()')
Reviewed-by: Takashi Sakamoto
Signed-off-by: Takashi Iwai
12 Mar, 2015
2 commits
-
There was no check about the id string of user control elements, so we
accepted even a control element with an empty string, which is
obviously bogus. This patch adds more sanity checks of id strings.Cc:
Signed-off-by: Takashi Iwai
11 Mar, 2015
1 commit
-
When the sequencer driver is built in kernel, it may panic at boot
because of the uninitialized snd_seq_bus_type. Initialize it properly
via subsys_initcall() instead of module_init() to assure that the bus
is registered beforehand.Reported-by: Fengguang Wu
Fixes: 7c37ae5c625a ('ALSA: seq: Rewrite sequencer device binding with standard bus')
Signed-off-by: Takashi Iwai
10 Mar, 2015
5 commits
-
The kernel memory allocators already report the errors when the
requested allocation fails, thus we don't need to warn it again in
each caller side.Signed-off-by: Takashi Iwai
-
The kernel memory allocators already report the errors when the
requested allocation fails, thus we don't need to warn it again in
each caller side.Signed-off-by: Takashi Iwai
-
The kernel memory allocators already report the errors when the
requested allocation fails, thus we don't need to warn it again in
each caller side.Signed-off-by: Takashi Iwai
-
The callers of snd_ctl_new() need to have 'struct snd_kcontrol' data,
and pass the data as template. Then, the function allocates the structure
data again and copy from the template. This is a waste of resources.
Especially, the callers use large stack for the template.This commit removes a need of template for the function, thus, changes
the prototype of snd_ctl_new(). Furthermore, this commit changes
the code of callers, snd_ctl_new1() and snd_ctl_elem_add() for better
shape.Signed-off-by: Takashi Sakamoto
Signed-off-by: Takashi Iwai -
The parameters can be decided in compile time.
This commit adds precomputed table to reduce calculating time.
Signed-off-by: Takashi Sakamoto
Signed-off-by: Takashi Iwai
06 Mar, 2015
1 commit
-
ASoC: Changes for v4.1
A selection of changes for v4.1 so far. The main things are:
- Move of jack registration to the card where it belongs.
- Support for DAPM routes specified by both the machine driver and DT.
04 Mar, 2015
1 commit
-
This patch fix spelling typo found in alsa-driver-api.xml.
It is because this file is generated from comments in source files,
I have to fix source files.Signed-off-by: Masanari Iida
Signed-off-by: Takashi Iwai
03 Mar, 2015
1 commit
-
Revive snd_device_disconnect() again so that it can be called from the
individual driver. This time, HD-audio will need it.Signed-off-by: Takashi Iwai
23 Feb, 2015
4 commits
-
When a PCM draining is performed to an empty stream that has been
already in PREPARED state, the current code just ignores and leaves as
it is, although the drain is supposed to set all such streams to SETUP
state. This patch covers that overlooked case.Cc:
Signed-off-by: Takashi Iwai
21 Feb, 2015
6 commits
-
Some codes in snd_pcm_dev_disconnect() are still valid even for
internal PCMs, but they are skipped because of the check of
list_empty(&pcm->list) at the beginning. Remove this check and put
pcm->internal checks appropriately for internal PCM object to process
through this function.Acked-by: Liam Girdwood
Signed-off-by: Takashi Iwai -
Notifier shouldn't listen to the changes of internal PCMs.
Acked-by: Liam Girdwood
Signed-off-by: Takashi Iwai -
An internal PCM object shouldn't be added to the PCM device list, as
it's never accessed directly from the user-space, and it has no proc
or any similar accesses. Currently, it's excluded in snd_pcm_get()
and snd_pcm_next(), but it's easier not to add such an object to the
list.Actually, the whole snd_pcm_dev_register() can be skipped for an
internal PCM. So this patch changes the code there, but also
addresses the uninitialized list_head access.Acked-by: Liam Girdwood
Signed-off-by: Takashi Iwai -
No functional changes at all.
Acked-by: Liam Girdwood
Signed-off-by: Takashi Iwai -
Introduce more generic .get_time_info to retrieve
system timestamp and audio timestamp in single routine.
Backwards compatibility is preserved with same functionality
as with .wall_clock method (to be removed in following commits
to avoid breaking git bisect)Signed-off-by: Pierre-Louis Bossart
Signed-off-by: Takashi Iwai -
Let userspace select audio timestamp config, ignore and zero all
other fields
Use audio_tstamp_data to retrieve config and pass report back to
user spaceSigned-off-by: Pierre-Louis Bossart
Signed-off-by: Takashi Iwai