Commit graph

27 commits

Author SHA1 Message Date
Takashi Iwai
41960d9592 ALSA: aloop: Drop unnecessary ifdef CONFIG_PROC_FS
Since the compiler can optimize away the unused code, we can reduce
the messy ifdef.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-05-29 07:46:05 +02:00
Takashi Iwai
db974553e3 ALSA: aloop: Use setup_timer() and mod_timer()
No functional change, refactoring with the standard helpers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-19 11:27:31 +01:00
Wolfram Sang
5d5638afa0 ALSA: drivers: drop owner assignment from platform_drivers
A platform_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-10-20 16:21:59 +02:00
Takashi Iwai
5872f3f621 ALSA: drivers: Convert to snd_card_new() with a device pointer
Also remove superfluous snd_card_set_dev() calls.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-12 10:58:20 +01:00
Sachin Kamat
5ed5824bf4 ALSA: aloop: Remove redundant platform_set_drvdata()
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-23 14:34:09 +02:00
Eldad Zack
74c34ca1cc ALSA: pcm_format_to_bits strong-typed conversion
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 <eldad@fogrefinery.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-29 13:36:15 +02:00
Takashi Iwai
edac894389 ALSA: aloop: Fix Oops while PM resume
snd-aloop driver has no proper PM implementation, thus the PM resume
may trigger Oops due to leftover timer instance.  This patch adds the
missing suspend/resume implementation.

Reported-and-tested-by: El boulangero <elboulangero@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-04 10:28:15 +01:00
Bill Pemberton
fbbb01a12d ALSA: drivers: remove __dev* attributes
CONFIG_HOTPLUG is going away as an option.  As result the __dev*
markings will be going away.

Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst,
and __devexit.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-12-07 07:34:32 +01:00
Takashi Iwai
999fc9f6aa ALSA: aloop - Close races at restarting the stream
There are small races opened in the check of running bit and the timer
lock.  Instead of adding yet more flag, just protect the whole racy
codes with the existing cable->lock.  As a bonus, we can get rid of
timer_lock now.

Reported-and-tested-by: Omair Mohammed Abdullah <omair.m.abdullah@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-21 10:53:14 +02:00
Omair Mohammed Abdullah
d4f1e48bd1 ALSA: aloop - add locking to timer access
When the loopback timer handler is running, calling del_timer() (for STOP
trigger) will not wait for the handler to complete before deactivating the
timer. The timer gets rescheduled in the handler as usual. Then a subsequent
START trigger will try to start the timer using add_timer() with a timer pending
leading to a kernel panic.

Serialize the calls to add_timer() and del_timer() using a spin lock to avoid
this.

Signed-off-by: Omair Mohammed Abdullah <omair.m.abdullah@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-06 16:50:28 +02:00
Takashi Iwai
d34e4e00ad ALSA: platform: Check CONFIG_PM_SLEEP instead of CONFIG_PM
When CONFIG_PM is set but CONFIG_PM_SLEEP is unset,
SIMPLE_DEV_PM_OPS() ignores the given functions, and this leads to
compile warnings.

For avoiding this, simply check CONFIG_PM_SLEEP instead of CONFIG_PM.

Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-09 15:47:15 +02:00
Takashi Iwai
284e7ca75f ALSA: convert PM ops of platform_driver to new pm ops
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-03 07:58:19 +02:00
Takashi Iwai
8bf01d8abc ALSA: Add missing .owner=THIS_MODULE to platform_driver definitions
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-02 17:50:05 +02:00
Jaroslav Kysela
b012513c66 ALSA: snd-aloop - improve the sample copy accurracy
Maintain both streams (playback, capture) synchronized. Previous code
didn't take in account the small byte count drifts caused by the irq
position rounding.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-05-15 08:34:38 +02:00
Rusty Russell
a67ff6a540 ALSA: module_param: make bool parameters really bool
module_param(bool) used to counter-intuitively take an int.  In
fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy
trick.

It's time to remove the int/unsigned int option.  For this version
it'll simply give a warning, but it'll break next kernel version.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-12-19 10:34:41 +01:00
Paul Gortmaker
65a772172b sound: fix drivers needing module.h not moduleparam.h
The implicit presence of module.h lured several users into
incorrectly thinking that they only needed/used modparam.h
but once we clean up the module.h presence, these will show
up as build failures, so fix 'em now.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31 19:31:19 -04:00
Takashi Iwai
6b69a0e520 ALSA: aloop - Use vmalloc buffer
snd-aloop driver is virtual and has no need for allocating contiguous
pages.  It'll be more system-friendly to use vmalloc buffers.

Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-09-24 12:16:29 +02:00
Takashi Iwai
98d21df431 ALSA: aloop - Fix possible IRQ lock inversion
loopback_pos_update() can be called in the timer callback, thus the lock
held should be irq-safe.  Otherwise you'll get AB/BA deadlock together
with substream->self_group.lock.

Reported-and-tested-by: Knut Petersen <Knut_Petersen@t-online.de>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-18 07:31:53 +01:00
Jaroslav Kysela
5de9e45fcf ALSA: snd-aloop - add pause support
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-10-20 09:35:43 +02:00
Jaroslav Kysela
dd04bb12d0 ALSA: snd-aloop - fix locking issues (running flag updates)
On SMP machines, the cable->running update must be atomic, otherwise
stream is not started correctly sometimes.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-10-20 09:35:38 +02:00
Jaroslav Kysela
e74670b6fd ALSA: snd-aloop: add cable#0 and cable#1 files to proc card tree
Show some useful runtime information using procfs.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-10-18 11:08:21 +02:00
Jaroslav Kysela
0db7102305 ALSA: snd-aloop - fix issue in the timer start function
In some circumstances (the rate shift value was changed), the irq_pos
value may be higher than the fraction value in the timer start function.
Check for it.

Also, to avoid value overflow, decrease maximum period size.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-10-14 21:54:17 +02:00
Jaroslav Kysela
b1c73fc8e6 ALSA: snd-aloop: Fix hw_params restrictions and checking
This patch fixes the hw_params restrictions when first (or playback) stream
sets the final hardware parameters. Also, fix the hw_params checking
in the trigger callback.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-10-11 10:56:09 +02:00
Jaroslav Kysela
ac446fb7e6 ALSA: snd-aloop - fix "PCM Slave Active" element read value
Simple coding fix.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-10-02 16:07:03 +02:00
Jaroslav Kysela
20d9a26dbb ALSA: snd-aloop - fix capture buffer silence
In a special case, some old samples are left in the capture ring buffer.
Fix it.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-09-30 00:20:17 +02:00
Jaroslav Kysela
1446c5fba7 ALSA: snd-aloop - fix the "PCM Playback Channels" kcontrol
Obvious copy-and-paste error.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-09-15 08:05:03 +02:00
Jaroslav Kysela
597603d615 ALSA: introduce the snd-aloop module for the PCM loopback
The snd-aloop module allows redirecting of the PCM playback in the
kernel back to the user space using the standard ALSA PCM capture API.

The module also allows time synchronization with another timing source
and notifications of playback stream parameter changes.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-08-09 14:21:11 +02:00