From: Caglar Akyuz <caglarakyuz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org
Cc: "alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org"
<alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org>,
Mark Brown
<broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
Subject: Re: [alsa-devel] [PATCH 2/3] ASoC: DaVinci: pcm, rename variables in prep for ping/pong
Date: Wed, 9 Sep 2009 15:33:58 +0300 [thread overview]
Message-ID: <200909091533.58702.caglarakyuz@gmail.com> (raw)
In-Reply-To: <B85A65D85D7EB246BE421B3FB0FBB59301DD74F519-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
On Wednesday 09 September 2009 15:08:42 Nori, Sekhar wrote:
> On Fri, Sep 04, 2009 at 00:25:57, Troy Kisky wrote:
> > Nori, Sekhar wrote:
> > > On Thu, Sep 03, 2009 at 05:45:08, Troy Kisky wrote:
> > >> Mark Brown wrote:
> > >>> On Mon, Aug 31, 2009 at 04:31:44PM -0700, Troy Kisky wrote:
> > >
> > > [...]
> > >
> > >>> I'll probably also apply the first patch since nobody else seems to
> > >>> care one way or another, but I would urge you to look at changing the
> > >>> default for the platform data to at most select the workaround only
> > >>> on CPUs that have problems with channel swapping - it's going to
> > >>> cause confusion for people to have it on by default.
> > >>
> > >> I think the ones without a problem use davinci-mcasp instead of
> > >> davinci-i2s but share davinci-pcm. So, I don't know of any machines to
> > >> exclude in davinci-i2s. But if someone else knows, speak up.
>
> [...]
>
> > > Using EDMA acount=4 instead of 2 (32-bit transfers) did fix that issue
> > > on the OSS drivers but I don't recall the problem morphing into an
> > > "always channel swapped" case.
> > >
> > > Have you tested your patch (1/3) with DM644x EVM? If not, we can do
> > > that and see if it leads to channels being always swapped on that
> > > hardware as well.
> >
> > Yes, I have tested with dm644x, not evm. I haven't tried to hear the
> > channel swap, but I have no doubt that it is.
>
> I finally got around to testing your patch 1/3 on DM6446 EVM.
>
> Without your patch, channel swap is quite easy to reproduce using audio
> loopback:
>
> arecord -fcd | aplay -fcd
>
> The audio source is a PC which speaker balance set to an extreme.
> By starting and stopping this command repeatedly, you can see the audio
> moving from one channel to the other.
>
> Applying your patch fixes this issue.
>
> Also, I did not notice any permanent channel swap. Used aplay to play data
> which was first left-only and then right-only. Plays the same way on a
> Linux PC.
>
> I will test on couple of other platform using davinci-i2s (DM355 etc)
> before acking the patch.
>
> However, with or without your patch, I noticed a segmentation fault for the
> first time the 'arecord | aplay' loop is created. There is no fault the
> second time around. I haven't spent time debugging this yet.
>
This is due to these lines in davinci_pcm_enqueue_dma:
data_type = prtd->params->data_type;
count = period_size / data_type;
First time running data_type is set to 0. This is a long time issue, I
remember modifying my kernels to check for zero before this division..
Regards,
Caglar
> root@arago:~# arecord -fcd | aplay -fcd
> Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
> Division by zero in kernel.
> Backtrace:
> [<c002b784>] (dump_backtrace+0x0/0x114) from [<c0248cf0>]
> (dump_stack+0x18/0x1c) r7:86a60000 r6:c77cdae0 r5:00000040 r4:00000000
> [<c0248cd8>] (dump_stack+0x0/0x1c) from [<c002b8cc>] (__div0+0x18/0x20)
> [<c002b8b4>] (__div0+0x0/0x20) from [<c014b0fc>] (Ldiv0+0x8/0x10)
> [<c01bad64>] (davinci_pcm_enqueue_dma+0x0/0x110) from [<c01baea0>]
> (davinci_pcm_ prepare+0x2c/0x58)
> [<c01bae74>] (davinci_pcm_prepare+0x0/0x58) from [<c01b5260>]
> (soc_pcm_prepare+0 x84/0x184)
> r7:c030df38 r6:c030d1b8 r5:c70d3900 r4:00000000
> [<c01b51dc>] (soc_pcm_prepare+0x0/0x184) from [<c01aac3c>]
> (snd_pcm_do_prepare+0 x1c/0x34)
> [<c01aac20>] (snd_pcm_do_prepare+0x0/0x34) from [<c01aa87c>]
> (snd_pcm_action_sin gle+0x40/0x7c)
> r5:c70d3900 r4:c030cbc8
> [<c01aa83c>] (snd_pcm_action_single+0x0/0x7c) from [<c01abd80>]
> (snd_pcm_action_ nonatomic+0x58/0x70)
> r7:c70d3900 r6:00000002 r5:c030cbc8 r4:c70d3900
> [<c01abd28>] (snd_pcm_action_nonatomic+0x0/0x70) from [<c01ae2cc>]
> (snd_pcm_comm on_ioctl1+0x814/0x1308)
> r7:c70d3900 r6:0002a690 r5:0002a690 r4:c77b6c80
> [<c01adab8>] (snd_pcm_common_ioctl1+0x0/0x1308) from [<c01af20c>]
> (snd_pcm_captu re_ioctl1+0x44c/0x470)
> [<c01aedc0>] (snd_pcm_capture_ioctl1+0x0/0x470) from [<c01af268>]
> (snd_pcm_captu re_ioctl+0x38/0x3c)
> r7:c77b6c80 r6:00004140 r5:0002a690 r4:c77b6c80
> [<c01af230>] (snd_pcm_capture_ioctl+0x0/0x3c) from [<c00a2680>]
> (vfs_ioctl+0x34/ 0x94)
> [<c00a264c>] (vfs_ioctl+0x0/0x94) from [<c00a2d44>]
> (do_vfs_ioctl+0x56c/0x5c8) r7:c77b6c80 r6:00000004 r5:c77b6c80 r4:c6b8c8a8
> [<c00a27d8>] (do_vfs_ioctl+0x0/0x5c8) from [<c00a2de0>]
> (sys_ioctl+0x40/0x64) [<c00a2da0>] (sys_ioctl+0x0/0x64) from [<c0027ea0>]
> (ret_fast_syscall+0x0/0x2c) r7:00000036 r6:bec987d8 r5:0002a468 r4:000b567f
> Division by zero in kernel.
> Backtrace:
> [<c002b784>] (dump_backtrace+0x0/0x114) from [<c0248cf0>]
> (dump_stack+0x18/0x1c) r7:86a62000 r6:c77cdae0 r5:00000040 r4:00000000
> [<c0248cd8>] (dump_stack+0x0/0x1c) from [<c002b8cc>] (__div0+0x18/0x20)
> [<c002b8b4>] (__div0+0x0/0x20) from [<c014b0fc>] (Ldiv0+0x8/0x10)
> [<c01bad64>] (davinci_pcm_enqueue_dma+0x0/0x110) from [<c01baec0>]
> (davinci_pcm_ prepare+0x4c/0x58)
> [<c01bae74>] (davinci_pcm_prepare+0x0/0x58) from [<c01b5260>]
> (soc_pcm_prepare+0 x84/0x184)
> r7:c030df38 r6:c030d1b8 r5:c70d3900 r4:00000000
> [<c01b51dc>] (soc_pcm_prepare+0x0/0x184) from [<c01aac3c>]
> (snd_pcm_do_prepare+0 x1c/0x34)
> [<c01aac20>] (snd_pcm_do_prepare+0x0/0x34) from [<c01aa87c>]
> (snd_pcm_action_sin gle+0x40/0x7c)
> r5:c70d3900 r4:c030cbc8
> [<c01aa83c>] (snd_pcm_action_single+0x0/0x7c) from [<c01abd80>]
> (snd_pcm_action_ nonatomic+0x58/0x70)
> r7:c70d3900 r6:00000002 r5:c030cbc8 r4:c70d3900
> [<c01abd28>] (snd_pcm_action_nonatomic+0x0/0x70) from [<c01ae2cc>]
> (snd_pcm_comm on_ioctl1+0x814/0x1308)
> r7:c70d3900 r6:0002a690 r5:0002a690 r4:c77b6c80
> [<c01adab8>] (snd_pcm_common_ioctl1+0x0/0x1308) from [<c01af20c>]
> (snd_pcm_captu re_ioctl1+0x44c/0x470)
> [<c01aedc0>] (snd_pcm_capture_ioctl1+0x0/0x470) from [<c01af268>]
> (snd_pcm_captu re_ioctl+0x38/0x3c)
> r7:c77b6c80 r6:00004140 r5:0002a690 r4:c77b6c80
> [<c01af230>] (snd_pcm_capture_ioctl+0x0/0x3c) from [<c00a2680>]
> (vfs_ioctl+0x34/ 0x94)
> [<c00a264c>] (vfs_ioctl+0x0/0x94) from [<c00a2d44>]
> (do_vfs_ioctl+0x56c/0x5c8) r7:c77b6c80 r6:00000004 r5:c77b6c80 r4:c6b8c8a8
> [<c00a27d8>] (do_vfs_ioctl+0x0/0x5c8) from [<c00a2de0>]
> (sys_ioctl+0x40/0x64) [<c00a2da0>] (sys_ioctl+0x0/0x64) from [<c0027ea0>]
> (ret_fast_syscall+0x0/0x2c) r7:00000036 r6:bec987d8 r5:0002a468 r4:000b567f
> Division by zero in kernel.
> Playing WAVE 'stBacktrace: din' : Signed 16
> bit Little Endi[<c002b784>] an, Rate 44100 H(dump_backtrace+0x0/0x114) z,
> Stere o
> from [<c0248cf0>] (dump_stack+0x18/0x1c)
> r7:86a64000 r6:c77cdae0 r5:00000040 r4:00000000
> [<c0248cd8>] (dump_stack+0x0/0x1c) from [<c002b8cc>] (__div0+0x18/0x20)
> [<c002b8b4>] (__div0+0x0/0x20) from [<c014b0fc>] (Ldiv0+0x8/0x10)
> [<c01bad64>] (davinci_pcm_enqueue_dma+0x0/0x110) from [<c01bb0bc>]
> (davinci_pcm_ dma_irq+0x58/0x80)
> [<c01bb064>] (davinci_pcm_dma_irq+0x0/0x80) from [<c0031904>]
> (dma_irq_handler+0 xec/0x12c)
> r5:00000003 r4:00000004
> [<c0031818>] (dma_irq_handler+0x0/0x12c) from [<c0068ee8>]
> (handle_IRQ_event+0x4 4/0x114)
> [<c0068ea4>] (handle_IRQ_event+0x0/0x114) from [<c006ab74>]
> (handle_edge_irq+0x1 48/0x1b4)
> r7:c7007440 r6:00000010 r5:c02ff060 r4:c6baa000
> [<c006aa2c>] (handle_edge_irq+0x0/0x1b4) from [<c0027070>]
> (_text+0x70/0x8c) r7:00000002 r6:00000800 r5:00000000 r4:00000010
> [<c0027000>] (_text+0x0/0x8c) from [<c0027aac>] (__irq_svc+0x4c/0x90)
> Exception stack(0xc6babdf0 to 0xc6babe38)
> bde0: 00000001 00000000 c6baa000
> 40000013 be00: 00000800 c76f2800 00000800 c70d3900 00000000 00000800
> 00000000 c6babe8c be20: c6baa000 c6babe38 c01b16f4 c01b1714 40000013
> ffffffff
> r5:fec48000 r4:ffffffff
> [<c01b1548>] (snd_pcm_lib_read1+0x0/0x30c) from [<c01b1934>]
> (snd_pcm_lib_read+0 x60/0x6c)
> [<c01b18d4>] (snd_pcm_lib_read+0x0/0x6c) from [<c01aee8c>]
> (snd_pcm_capture_ioct l1+0xcc/0x470)
> r6:bec98ab4 r5:bec98ab4 r4:00000000
> [<c01aedc0>] (snd_pcm_capture_ioctl1+0x0/0x470) from [<c01af268>]
> (snd_pcm_captu re_ioctl+0x38/0x3c)
> r7:c77b6c80 r6:800c4151 r5:bec98ab4 r4:c77b6c80
> [<c01af230>] (snd_pcm_capture_ioctl+0x0/0x3c) from [<c00a2680>]
> (vfs_ioctl+0x34/ 0x94)
> [<c00a264c>] (vfs_ioctl+0x0/0x94) from [<c00a2d44>]
> (do_vfs_ioctl+0x56c/0x5c8) r7:c77b6c80 r6:00000004 r5:c77b6c80 r4:c6b8c8a8
> [<c00a27d8>] (do_vfs_ioctl+0x0/0x5c8) from [<c00a2de0>]
> (sys_ioctl+0x40/0x64) [<c00a2da0>] (sys_ioctl+0x0/0x64) from [<c0027ea0>]
> (ret_fast_syscall+0x0/0x2c) r7:00000036 r6:00000000 r5:0002a4b8 r4:0002a468
> arecord: pcm_read:1529: read error: Input/output error
> root@arago:~#
>
> Thanks,
> Sekhar
>
> > > One feedback we have received on this solution is that it does not work
> > > for 24-bit audio. In which case, implementing the workaround described
> > > in the errata is the only way around.
> >
> > Yes, you cannot shift more than 32 bits at once, so 48 bits is out.
> > Although 24 bit format would be easy to add, currently only 8, 16, and 32
> > are supported by davinci-i2s.
> >
> > > Thanks,
> > > Sekhar
>
> _______________________________________________
> Davinci-linux-open-source mailing list
> Davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org
> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
next prev parent reply other threads:[~2009-09-09 12:33 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-31 23:31 [PATCH 1/3] ASoC: DaVinci: i2s, reduce underruns by combining into 1 element Troy Kisky
2009-08-31 23:31 ` [PATCH 2/3] ASoC: DaVinci: pcm, rename variables in prep for ping/pong Troy Kisky
2009-08-31 23:31 ` [PATCH 3/3] ASoC: DaVinci: pcm, fix underrun by using sram Troy Kisky
2009-09-02 22:01 ` [PATCH 2/3] ASoC: DaVinci: pcm, rename variables in prep for ping/pong Mark Brown
2009-09-03 0:15 ` Troy Kisky
2009-09-03 12:17 ` Mark Brown
[not found] ` <4A9F0A8C.1040509-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
2009-09-03 16:43 ` [alsa-devel] " Nori, Sekhar
2009-09-03 18:55 ` Troy Kisky
[not found] ` <4AA0113D.9030605-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
2009-09-09 12:08 ` [alsa-devel] " Nori, Sekhar
[not found] ` <B85A65D85D7EB246BE421B3FB0FBB59301DD74F519-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2009-09-09 12:33 ` Caglar Akyuz [this message]
[not found] ` <200909091533.58702.caglarakyuz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-09-09 13:05 ` Nori, Sekhar
[not found] ` <B85A65D85D7EB246BE421B3FB0FBB59301DD74F59E-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2009-09-09 13:22 ` Narnakaje, Snehaprabha
2009-09-09 13:28 ` Mark Brown
2009-09-29 10:46 ` [alsa-devel] " Nori, Sekhar
[not found] ` <B85A65D85D7EB246BE421B3FB0FBB59301DDAB3EB5-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2009-09-29 15:21 ` Mani, Arun
[not found] ` <7A436F7769CA33409C6B44B358BFFF0C012A458365-EovWT4A8QTWIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2009-10-01 18:13 ` Nori, Sekhar
[not found] ` <B85A65D85D7EB246BE421B3FB0FBB59301DDB71445-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2009-10-01 18:46 ` Steve Chen
2009-09-29 22:09 ` Troy Kisky
[not found] ` <4AC28588.9030802-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
2009-09-29 22:25 ` [alsa-devel] " Steve Chen
2009-09-29 22:31 ` Troy Kisky
[not found] ` <4AC28AD0.7000600-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
2009-09-29 23:24 ` [alsa-devel] " Steve Chen
2009-09-03 19:06 ` David Brownell
2009-09-03 19:24 ` Troy Kisky
2009-09-03 21:36 ` David Brownell
2009-09-03 22:38 ` Troy Kisky
2009-09-01 10:53 ` [PATCH 1/3] ASoC: DaVinci: i2s, reduce underruns by combining into 1 element Mark Brown
2009-09-01 18:23 ` Troy Kisky
2009-09-01 19:03 ` Mark Brown
2009-09-01 19:19 ` Troy Kisky
2009-09-01 20:28 ` Mark Brown
2009-09-01 20:42 ` Troy Kisky
2009-09-01 21:22 ` Mark Brown
2009-09-01 21:34 ` Troy Kisky
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=200909091533.58702.caglarakyuz@gmail.com \
--to=caglarakyuz-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
--cc=broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org \
--cc=davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.