From: Stas Sergeev <stsp@aknet.ru>
To: Takashi Iwai <tiwai@suse.de>
Cc: Theodore Tso <tytso@mit.edu>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Roberto Oppedisano <roberto.oppedisano@infracom.it>,
alsa-devel@alsa-project.org
Subject: [patch] snd-pcsp: put back the compatibility code
Date: Fri, 16 May 2008 22:11:31 +0400 [thread overview]
Message-ID: <482DCE53.1000406@aknet.ru> (raw)
In-Reply-To: <s5h8wybr0c2.wl%tiwai@suse.de>
[-- Attachment #1: Type: text/plain, Size: 352 bytes --]
Hello.
The attached patch adds back the
compatibility code, allowing the
driver to work with older alsa-libs.
The removal was premature, it breaks
the real-life configs, I am sorry
about that.
Takashi, could you please apply?
It is a straight-forward revert of:
http://hg-mirror.alsa-project.org/alsa-kernel/diff/26b0243ab4fa/drivers/pcsp/pcsp_lib.c
[-- Attachment #2: pcsp_s16_back.diff --]
[-- Type: text/x-patch, Size: 2344 bytes --]
# HG changeset patch
# User Stas Sergeev <stsp@users.sourceforge.net>
# Date 1210960913 -14400
# Node ID 3887126bbd9ca422208e651d46f9f5385d409efe
# Parent 1ffcb28969441147a0480f0ad7bdc52093d1e4ee
snd-pcsp: put back the compatibility code for the older alsa-libs.
Signed-off-by: Stas Sergeev <stsp@aknet.ru>
diff -r 1ffcb2896944 -r 3887126bbd9c drivers/pcsp/pcsp_lib.c
--- a/drivers/pcsp/pcsp_lib.c Fri May 16 12:34:47 2008 +0200
+++ b/drivers/pcsp/pcsp_lib.c Fri May 16 22:01:53 2008 +0400
@@ -17,6 +17,8 @@ module_param(nforce_wa, bool, 0444);
module_param(nforce_wa, bool, 0444);
MODULE_PARM_DESC(nforce_wa, "Apply NForce chipset workaround "
"(expect bad sound)");
+
+#define DMIX_WANTS_S16 1
static void pcsp_start_timer(unsigned long dummy)
{
@@ -47,7 +49,7 @@ enum hrtimer_restart pcsp_do_timer(struc
{
unsigned long flags;
unsigned char timer_cnt, val;
- int periods_elapsed;
+ int fmt_size, periods_elapsed;
u64 ns;
size_t period_bytes, buffer_bytes;
struct snd_pcm_substream *substream;
@@ -92,8 +94,11 @@ enum hrtimer_restart pcsp_do_timer(struc
goto exit_nr_unlock2;
runtime = substream->runtime;
- /* assume it is u8 mono */
- val = runtime->dma_area[chip->playback_ptr];
+ fmt_size = snd_pcm_format_physical_width(runtime->format) >> 3;
+ /* assume it is mono! */
+ val = runtime->dma_area[chip->playback_ptr + fmt_size - 1];
+ if (snd_pcm_format_signed(runtime->format))
+ val ^= 0x80;
timer_cnt = val * CUR_DIV() / 256;
if (timer_cnt && chip->enable) {
@@ -111,7 +116,7 @@ enum hrtimer_restart pcsp_do_timer(struc
period_bytes = snd_pcm_lib_period_bytes(substream);
buffer_bytes = snd_pcm_lib_buffer_bytes(substream);
- chip->playback_ptr += PCSP_INDEX_INC();
+ chip->playback_ptr += PCSP_INDEX_INC() * fmt_size;
periods_elapsed = chip->playback_ptr - chip->period_ptr;
if (periods_elapsed < 0) {
printk(KERN_WARNING "PCSP: playback_ptr inconsistent "
@@ -270,7 +275,11 @@ static struct snd_pcm_hardware snd_pcsp_
.info = (SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_HALF_DUPLEX |
SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID),
- .formats = SNDRV_PCM_FMTBIT_U8,
+ .formats = (SNDRV_PCM_FMTBIT_U8
+#if DMIX_WANTS_S16
+ | SNDRV_PCM_FMTBIT_S16_LE
+#endif
+ ),
.rates = SNDRV_PCM_RATE_KNOT,
.rate_min = PCSP_DEFAULT_SRATE,
.rate_max = PCSP_DEFAULT_SRATE,
next prev parent reply other threads:[~2008-05-16 18:11 UTC|newest]
Thread overview: 108+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-11 19:56 2.6.26-rc1-git9: Reported regressions from 2.6.25 Rafael J. Wysocki
2008-05-11 19:57 ` [Bug #10493] mips BCM47XX compile error Rafael J. Wysocki
2008-05-12 6:14 ` Adrian Bunk
2008-05-11 20:04 ` [Bug #10582] INFO: task pdflush:27505 blocked for more than 120 seconds Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10598] Huawei CDMA PCMCIA card oops Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10557] [regression] latest git couse kernel oops Rafael J. Wysocki
2008-05-11 21:11 ` Al Viro
2008-05-11 20:04 ` [Bug #10606] 2.6.26-rc1 regression: ACPI fails to load SDT. - Dell M1530 Rafael J. Wysocki
2008-05-11 21:34 ` Nigel Cunningham
2008-05-11 21:35 ` Rafael J. Wysocki
2008-05-11 22:43 ` Nigel Cunningham
2008-05-11 20:04 ` [Bug #10495] Voyager phys_cpu_present_map compile error Rafael J. Wysocki
2008-05-12 2:42 ` WANG Cong
2008-05-11 20:04 ` [Bug #10627] 2.6.26-rc1 c67x00-ll-hpi compilation failure Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10624] DVB build issue Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10613] BIOS bug, APIC version is 0 for CPU#0! Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10623] k8-bus_64.c(?) spams dmesg in 2.6.26-rc1 Rafael J. Wysocki
2008-05-12 7:16 ` Thomas Gleixner
2008-05-12 19:24 ` Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10621] WARNING: at include/linux/blkdev.h:443 Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10620] X does not resume (intel chipset) Rafael J. Wysocki
2008-05-14 21:11 ` Theodore Tso
2008-05-11 20:04 ` [Bug #10616] Horrendous Audio Stutter - current git Rafael J. Wysocki
2008-05-11 21:28 ` Parag Warudkar
2008-05-11 21:41 ` Adrian Bunk
2008-05-11 21:59 ` Parag Warudkar
2008-05-13 13:35 ` Adrian Bunk
2008-05-13 21:44 ` Frans Pop
2008-05-11 20:04 ` [Bug #10619] [regression] ata2: device not ready (errno=-16), forcing hardreset Rafael J. Wysocki
2008-05-11 21:20 ` Jeff Garzik
2008-05-11 21:25 ` Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10615] Oops with strace_test Rafael J. Wysocki
2008-05-12 7:14 ` Thomas Gleixner
2008-05-12 19:23 ` Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10622] [BUG 2.6.26-rc1] scsi (or sysfs or vm?) oops in sr_probe() Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10634] volanoMark regression with kernel 2.6.26-rc1 Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10639] parisc DISCONTIGMEM compile breakage Rafael J. Wysocki
2008-05-11 21:20 ` Adrian Bunk
2008-05-11 20:04 ` [Bug #10631] Please revert 709f744 (x86: bitops asm constraint fixes) Rafael J. Wysocki
2008-05-12 7:17 ` Thomas Gleixner
2008-05-12 19:26 ` Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10632] [2.6.26-rc1] Output to console stops when booted without 'vga=791' Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10630] USB devices plugged into dock are not discoverred until reload of ehci-hcd Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10640] audio skipping on 2.6.26-rc1 Rafael J. Wysocki
2008-05-11 22:12 ` Parag Warudkar
2008-05-12 7:52 ` Ingo Molnar
2008-05-12 19:29 ` Rafael J. Wysocki
2008-05-12 19:32 ` Miklos Szeredi
2008-05-11 20:04 ` [Bug #10628] 2.6.26-rc1-git1 -- trying to get vblank count for disabled pipe 0 Rafael J. Wysocki
2008-05-11 22:18 ` Miles Lane
2008-05-11 20:04 ` [Bug #10633] Problem mounting ext2 using ext3 (or any failure to mount a partition) leads to an oops Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10638] sysbench+mysql(oltp, readonly) 30% regression with 2.6.26-rc1 Rafael J. Wysocki
2008-05-12 7:38 ` Ingo Molnar
2008-05-11 20:04 ` [Bug #10629] 2.6.26-rc1-$sha1: RIP __d_lookup+0x8c/0x160 Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10642] general protection fault: 0000 [1] PREEMPT SMP DEBUG_PAGEALLOC Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10648] CONFIG_PRINTK_TIME broken on git HEAD ? Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10672] 2.6.26-rc1 regression: ISA DMA broken (bisected) Rafael J. Wysocki
2008-05-12 7:37 ` Thomas Gleixner
2008-05-11 20:04 ` [Bug #10670] BUG: linux-2.6.26-rc1 oops at thinkpad_acpi:led_set_status Rafael J. Wysocki
2008-05-12 4:17 ` Henrique de Moraes Holschuh
2008-05-14 23:30 ` Adrian Bunk
2008-05-15 0:49 ` Henrique de Moraes Holschuh
2008-05-15 19:35 ` Henrique de Moraes Holschuh
2008-05-11 20:04 ` [Bug #10643] s390 kvm_virtio.c build error Rafael J. Wysocki
2008-05-11 21:32 ` Adrian Bunk
2008-05-11 20:04 ` [Bug #10651] 2.6.26-git: ata_piix link is slow to respond regression Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10675] ppc compile failure (__flush_icache_range etc undeclared) Rafael J. Wysocki
2008-05-14 10:07 ` Meelis Roos
2008-05-11 20:04 ` [Bug #10650] 2.6.26-rcX VC console scrolling regression Rafael J. Wysocki
2008-05-11 23:23 ` Jan Engelhardt
2008-05-12 19:30 ` Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10676] 2.6.26-rc1 on x86: ld: warning: dot moved backwards before `.text' Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10673] build issue #380 for v2.6.26-rc1-279-g28a4acb : mach-voyager: multiple definition of `phys_cpu_present_map' Rafael J. Wysocki
2008-05-12 9:48 ` Thomas Gleixner
2008-05-12 19:31 ` Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10645] 2.6.26-rc1 lost half the RAM on UltraSPARC 5 Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10674] /proc/kallsyms broken in 2.6.26-rc1-git6 Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10669] ACPI: kmemcheck: Caught 16-bit read from freed memory (f7c12ec6) Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10678] 2.6.26-rc1: warnings from sysfs, bluetooth related Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10641] [BUG] 2.6.26-rc1-git4 - task blocked on powerpc for more than 120 seconds Rafael J. Wysocki
2008-05-11 21:21 ` Adrian Bunk
2008-05-11 21:39 ` Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10671] [2.6.26-rc1] WARNING: at drivers/base/sys.c:183 Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10649] lxfb driver regression Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10677] Error in save_stack_trace() on x86_64? Rafael J. Wysocki
2008-05-11 20:04 ` [Bug #10679] 2.6.26-rc1 regression: e5e1d3cb20034a3cbcfff1f0bae12201aa2ce17e breaks artsd Rafael J. Wysocki
2008-05-13 10:46 ` Takashi Iwai
2008-05-14 21:20 ` Theodore Tso
2008-05-15 5:41 ` Takashi Iwai
2008-05-15 13:06 ` Theodore Tso
2008-05-15 16:36 ` Takashi Iwai
2008-05-15 18:23 ` Stas Sergeev
2008-05-16 18:11 ` Stas Sergeev [this message]
2008-05-16 18:20 ` [alsa-devel] [patch] snd-pcsp: put back the compatibility code Rene Herman
2008-05-17 20:47 ` [Bug #10679] 2.6.26-rc1 regression: e5e1d3cb20034a3cbcfff1f0bae12201aa2ce17e breaks artsd Dave Jones
2008-05-17 21:02 ` Stas Sergeev
2008-05-17 21:32 ` Dave Jones
2008-05-17 22:05 ` Stas Sergeev
2008-05-17 22:09 ` Stas Sergeev
2008-05-18 3:13 ` Stas Sergeev
2008-05-18 7:49 ` Takashi Iwai
2008-05-15 17:24 ` Stas Sergeev
2008-05-15 18:26 ` Theodore Tso
2008-05-15 19:08 ` [patch] snd-pcsp: adjust help texts to frighten users Stas Sergeev
2008-05-15 19:53 ` Theodore Tso
2008-05-15 20:14 ` Stas Sergeev
2008-05-15 21:40 ` Theodore Tso
2008-05-16 17:48 ` Stas Sergeev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=482DCE53.1000406@aknet.ru \
--to=stsp@aknet.ru \
--cc=alsa-devel@alsa-project.org \
--cc=linux-kernel@vger.kernel.org \
--cc=roberto.oppedisano@infracom.it \
--cc=tiwai@suse.de \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox