From mboxrd@z Thu Jan 1 00:00:00 1970 From: Caglar Akyuz 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 Message-ID: <200909091533.58702.caglarakyuz@gmail.com> References: <1251761505-11353-1-git-send-email-troy.kisky@boundarydevices.com> <4AA0113D.9030605@boundarydevices.com> Reply-To: caglarakyuz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org Errors-To: davinci-linux-open-source-bounces-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org To: davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org Cc: "alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org" , Mark Brown List-Id: alsa-devel@alsa-project.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: > [] (dump_backtrace+0x0/0x114) from [] > (dump_stack+0x18/0x1c) r7:86a60000 r6:c77cdae0 r5:00000040 r4:00000000 > [] (dump_stack+0x0/0x1c) from [] (__div0+0x18/0x20) > [] (__div0+0x0/0x20) from [] (Ldiv0+0x8/0x10) > [] (davinci_pcm_enqueue_dma+0x0/0x110) from [] > (davinci_pcm_ prepare+0x2c/0x58) > [] (davinci_pcm_prepare+0x0/0x58) from [] > (soc_pcm_prepare+0 x84/0x184) > r7:c030df38 r6:c030d1b8 r5:c70d3900 r4:00000000 > [] (soc_pcm_prepare+0x0/0x184) from [] > (snd_pcm_do_prepare+0 x1c/0x34) > [] (snd_pcm_do_prepare+0x0/0x34) from [] > (snd_pcm_action_sin gle+0x40/0x7c) > r5:c70d3900 r4:c030cbc8 > [] (snd_pcm_action_single+0x0/0x7c) from [] > (snd_pcm_action_ nonatomic+0x58/0x70) > r7:c70d3900 r6:00000002 r5:c030cbc8 r4:c70d3900 > [] (snd_pcm_action_nonatomic+0x0/0x70) from [] > (snd_pcm_comm on_ioctl1+0x814/0x1308) > r7:c70d3900 r6:0002a690 r5:0002a690 r4:c77b6c80 > [] (snd_pcm_common_ioctl1+0x0/0x1308) from [] > (snd_pcm_captu re_ioctl1+0x44c/0x470) > [] (snd_pcm_capture_ioctl1+0x0/0x470) from [] > (snd_pcm_captu re_ioctl+0x38/0x3c) > r7:c77b6c80 r6:00004140 r5:0002a690 r4:c77b6c80 > [] (snd_pcm_capture_ioctl+0x0/0x3c) from [] > (vfs_ioctl+0x34/ 0x94) > [] (vfs_ioctl+0x0/0x94) from [] > (do_vfs_ioctl+0x56c/0x5c8) r7:c77b6c80 r6:00000004 r5:c77b6c80 r4:c6b8c8a8 > [] (do_vfs_ioctl+0x0/0x5c8) from [] > (sys_ioctl+0x40/0x64) [] (sys_ioctl+0x0/0x64) from [] > (ret_fast_syscall+0x0/0x2c) r7:00000036 r6:bec987d8 r5:0002a468 r4:000b567f > Division by zero in kernel. > Backtrace: > [] (dump_backtrace+0x0/0x114) from [] > (dump_stack+0x18/0x1c) r7:86a62000 r6:c77cdae0 r5:00000040 r4:00000000 > [] (dump_stack+0x0/0x1c) from [] (__div0+0x18/0x20) > [] (__div0+0x0/0x20) from [] (Ldiv0+0x8/0x10) > [] (davinci_pcm_enqueue_dma+0x0/0x110) from [] > (davinci_pcm_ prepare+0x4c/0x58) > [] (davinci_pcm_prepare+0x0/0x58) from [] > (soc_pcm_prepare+0 x84/0x184) > r7:c030df38 r6:c030d1b8 r5:c70d3900 r4:00000000 > [] (soc_pcm_prepare+0x0/0x184) from [] > (snd_pcm_do_prepare+0 x1c/0x34) > [] (snd_pcm_do_prepare+0x0/0x34) from [] > (snd_pcm_action_sin gle+0x40/0x7c) > r5:c70d3900 r4:c030cbc8 > [] (snd_pcm_action_single+0x0/0x7c) from [] > (snd_pcm_action_ nonatomic+0x58/0x70) > r7:c70d3900 r6:00000002 r5:c030cbc8 r4:c70d3900 > [] (snd_pcm_action_nonatomic+0x0/0x70) from [] > (snd_pcm_comm on_ioctl1+0x814/0x1308) > r7:c70d3900 r6:0002a690 r5:0002a690 r4:c77b6c80 > [] (snd_pcm_common_ioctl1+0x0/0x1308) from [] > (snd_pcm_captu re_ioctl1+0x44c/0x470) > [] (snd_pcm_capture_ioctl1+0x0/0x470) from [] > (snd_pcm_captu re_ioctl+0x38/0x3c) > r7:c77b6c80 r6:00004140 r5:0002a690 r4:c77b6c80 > [] (snd_pcm_capture_ioctl+0x0/0x3c) from [] > (vfs_ioctl+0x34/ 0x94) > [] (vfs_ioctl+0x0/0x94) from [] > (do_vfs_ioctl+0x56c/0x5c8) r7:c77b6c80 r6:00000004 r5:c77b6c80 r4:c6b8c8a8 > [] (do_vfs_ioctl+0x0/0x5c8) from [] > (sys_ioctl+0x40/0x64) [] (sys_ioctl+0x0/0x64) from [] > (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[] an, Rate 44100 H(dump_backtrace+0x0/0x114) z, > Stere o > from [] (dump_stack+0x18/0x1c) > r7:86a64000 r6:c77cdae0 r5:00000040 r4:00000000 > [] (dump_stack+0x0/0x1c) from [] (__div0+0x18/0x20) > [] (__div0+0x0/0x20) from [] (Ldiv0+0x8/0x10) > [] (davinci_pcm_enqueue_dma+0x0/0x110) from [] > (davinci_pcm_ dma_irq+0x58/0x80) > [] (davinci_pcm_dma_irq+0x0/0x80) from [] > (dma_irq_handler+0 xec/0x12c) > r5:00000003 r4:00000004 > [] (dma_irq_handler+0x0/0x12c) from [] > (handle_IRQ_event+0x4 4/0x114) > [] (handle_IRQ_event+0x0/0x114) from [] > (handle_edge_irq+0x1 48/0x1b4) > r7:c7007440 r6:00000010 r5:c02ff060 r4:c6baa000 > [] (handle_edge_irq+0x0/0x1b4) from [] > (_text+0x70/0x8c) r7:00000002 r6:00000800 r5:00000000 r4:00000010 > [] (_text+0x0/0x8c) from [] (__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 > [] (snd_pcm_lib_read1+0x0/0x30c) from [] > (snd_pcm_lib_read+0 x60/0x6c) > [] (snd_pcm_lib_read+0x0/0x6c) from [] > (snd_pcm_capture_ioct l1+0xcc/0x470) > r6:bec98ab4 r5:bec98ab4 r4:00000000 > [] (snd_pcm_capture_ioctl1+0x0/0x470) from [] > (snd_pcm_captu re_ioctl+0x38/0x3c) > r7:c77b6c80 r6:800c4151 r5:bec98ab4 r4:c77b6c80 > [] (snd_pcm_capture_ioctl+0x0/0x3c) from [] > (vfs_ioctl+0x34/ 0x94) > [] (vfs_ioctl+0x0/0x94) from [] > (do_vfs_ioctl+0x56c/0x5c8) r7:c77b6c80 r6:00000004 r5:c77b6c80 r4:c6b8c8a8 > [] (do_vfs_ioctl+0x0/0x5c8) from [] > (sys_ioctl+0x40/0x64) [] (sys_ioctl+0x0/0x64) from [] > (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