From patchwork Tue Sep 15 05:19:31 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yusuf Caglar AKYUZ X-Patchwork-Id: 47579 Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8F5Ophp014762 for ; Tue, 15 Sep 2009 05:24:52 GMT Received: from dlep35.itg.ti.com ([157.170.170.118]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id n8F5NJ0t021620; Tue, 15 Sep 2009 00:23:19 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep35.itg.ti.com (8.13.7/8.13.7) with ESMTP id n8F5NINF023404; Tue, 15 Sep 2009 00:23:18 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 91C9B80627; Tue, 15 Sep 2009 00:23:18 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp52.itg.ti.com (dflp52.itg.ti.com [128.247.22.96]) by linux.omap.com (Postfix) with ESMTP id 9A10880626 for ; Tue, 15 Sep 2009 00:23:16 -0500 (CDT) Received: from medina.ext.ti.com (localhost [127.0.0.1]) by dflp52.itg.ti.com (8.13.7/8.13.7) with ESMTP id n8F5NGfH014707 for ; Tue, 15 Sep 2009 00:23:16 -0500 (CDT) Received: from mail159-tx2-R.bigfish.com (mail-tx2.bigfish.com [65.55.88.114]) by medina.ext.ti.com (8.13.7/8.13.7) with ESMTP id n8F5NGPu016265 for ; Tue, 15 Sep 2009 00:23:16 -0500 Received: from mail159-tx2 (localhost.localdomain [127.0.0.1]) by mail159-tx2-R.bigfish.com (Postfix) with ESMTP id 068E17280A0 for ; Tue, 15 Sep 2009 05:23:15 +0000 (UTC) X-SpamScore: -29 X-BigFish: vps-29(z3b68jz328cM1432R9370K98dN14e4M936eMzz1202h10adjzz5a6ciz2fh5fh5eh6bh259h61h) X-Spam-TCS-SCL: 0:0 X-FB-SS: 5, X-MS-Exchange-Organization-Antispam-Report: OrigIP: 209.85.220.208; Service: EHS Received: by mail159-tx2 (MessageSwitch) id 1252992192325636_14598; Tue, 15 Sep 2009 05:23:12 +0000 (UCT) Received: from mail-fx0-f208.google.com (mail-fx0-f208.google.com [209.85.220.208]) by mail159-tx2.bigfish.com (Postfix) with ESMTP id 382EB1C68074 for ; Tue, 15 Sep 2009 05:22:57 +0000 (UTC) Received: by fxm4 with SMTP id 4so2840877fxm.40 for ; Mon, 14 Sep 2009 22:22:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:reply-to:to:subject:date :user-agent:cc:references:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:message-id; bh=M/66dFIsd4tJlefTaluHQdA9mIMDEXY6HhIKfrsVH9o=; b=jGKdpXapePBZgJk6XMa3vru5NqbNocpTh9V72pbzpun85mutS2w/wB+oA9Va/CHP0E C3xNiXWdo3bjFRF2IuxNbQTBiTGMZYJxOerttZiL1wAXelfVRlP6Uh0ImHd1pMkbqREI K8zT6owd7rTK85Koo8cCnCLYbeh9GnyN0kodw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:reply-to:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding :content-disposition:message-id; b=o1lJd2JFvbZyw968Xwhx3Qk5BF/RSn/07sNP8dpdjpuRx70aCtBgvb1TbHnizoJRTW JuL6NLSWSqiVIRUW/q1euR3EOUmFYuD7E6aYQ2mav5Q7ju53kM5o3iIpHhgDwtVzXXot US3d13TVjr/NPKneGtP+NnmGElMMckyV4/eEg= Received: by 10.86.220.1 with SMTP id s1mr5720312fgg.50.1252992176204; Mon, 14 Sep 2009 22:22:56 -0700 (PDT) Received: from gordion.localnet ([85.104.148.246]) by mx.google.com with ESMTPS id e20sm667796fga.15.2009.09.14.22.22.54 (version=SSLv3 cipher=RC4-MD5); Mon, 14 Sep 2009 22:22:55 -0700 (PDT) From: Caglar Akyuz To: yang shaobo Date: Tue, 15 Sep 2009 08:19:31 +0300 User-Agent: KMail/1.9.51 (KDE/4.0.4; ; ) References: <4feed6860909110437u7cdb5900k68479868f0bc9e49@mail.gmail.com> <200909141324.34937.caglarakyuz@gmail.com> <4feed6860909141836w162733fdud52ba1b4891dca02@mail.gmail.com> In-Reply-To: <4feed6860909141836w162733fdud52ba1b4891dca02@mail.gmail.com> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200909150819.32672.caglarakyuz@gmail.com> Cc: davinci-linux-open-source@linux.davincidsp.com Subject: Re: How to disable the signal handler in dsplink X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.4 Precedence: list Reply-To: caglarakyuz@gmail.com List-Id: davinci-linux-open-source.linux.davincidsp.com List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com On Tuesday 15 September 2009 04:36:18 yang shaobo wrote: > Dear caglar : > Thanks a lot for your patch ! > Now the new dsplink works perfectly with my gstreamer. > > According FAQ on DSPLink wiki, the other thing that should be done may > be adding the dsplink cleanup functions to gstreamer core . > I will try this . > I use something like this. Regards, Caglar > 2009/9/14, Caglar Akyuz : > > On Monday 14 September 2009 13:09:28 yang shaobo wrote: > >> Dear Uppal : > >> Thanks for your quick reply. > >> I modified the $(DSPLINK)/config/all/CFG_Linux.c. > >> I changed the Handle signals for cleanup from "TRUE" to "FALSE". > >> And , changed NUMSIGNALS from "8u" to "0u". > >> Then , I recompiled the dsplink , cmem ,dmai , codec_combos, also > >> gstreamer ( I use gstreamer as my application ). > >> However , the gstreamer still can not receive signals. > >> It seemed that nothing is changed. > >> So, I am confused . > > > > I guess you need to change your codec engine configuration. AFAIK, > > $(DSPLINK)/config/all/CFG_Linux.c file is not used while using codec > > engine, > > instead CE provides its own configuration. It was far easier for me to > > modify > > dsplink code for this. Please see the attached patch. > > > > I hope this helps, > > Caglar > > > > --- > > ti-codec-engine-221-r0/codec_engine_2_21/cetools/packages/dsplink/gpp/src > >/api/Linux/drv_api.c 2008-10-24 22:58:03.000000000 +0300 > > +++ > > ti-codec-engine-221-r0/codec_engine_2_21/cetools/packages/dsplink/gpp/src > >/api/Linux/drv_api_mine.c 2009-07-06 15:45:50.000000000 +0300 > > @@ -477,7 +477,8 @@ > > status = DSP_EPOINTER ; > > SET_FAILURE_REASON ; > > } > > - > > + > > + DSPLINK_atExitHandler(); > > TRC_1LEAVE ("DRV_Finalize", status) ; > > > > return status ; > > @@ -1606,7 +1607,7 @@ > > > > TRC_1ENTER ("DRV_installCleanupRoutines", linkCfgPtr) ; > > > > - if (linkCfgPtr->gppObject->gppOsObject->handleSignals == TRUE) { > > + if (0 && linkCfgPtr->gppObject->gppOsObject->handleSignals == TRUE) > > { sigemptyset (&block_mask) ; > > sigfillset( &block_mask) ; > > sigInstaller.sa_flags = (SA_RESTART) ; > > @@ -1619,7 +1620,6 @@ > > NULL) ; > > } > > } > > - atexit (&DSPLINK_atExitHandler) ; > > > > TRC_0LEAVE ("DRV_installCleanupRoutines") ; > > } --- gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiauddec1.c 2009-06-15 22:27:27.000000000 +0300 +++ gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiauddec1_mine.c 2009-07-06 16:13:23.000000000 +0300 @@ -1059,6 +1059,9 @@ if (!gst_tiauddec1_exit_audio(auddec1)) { return GST_STATE_CHANGE_FAILURE; } + if (gst_tiauddec1_codec_stop(auddec1) < 0) { + GST_ERROR("failed to stop codec\n"); + } break; case GST_STATE_CHANGE_READY_TO_PAUSED: @@ -1362,11 +1365,6 @@ gst_ticircbuffer_data_consumed(auddec1->circBuf, encDataWindow, 0); } - /* Initialize codec engine */ - if (gst_tiauddec1_codec_stop(auddec1) < 0) { - GST_ERROR("failed to stop codec\n"); - } - /* Notify main thread if it is waiting on decode thread shut-down */ auddec1->decodeDrained = TRUE; Rendezvous_force(auddec1->waitOnDecodeDrain); --- gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiauddec.c 2009-06-15 22:27:27.000000000 +0300 +++ gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiauddec_mine.c 2009-07-06 16:15:26.000000000 +0300 @@ -1054,6 +1054,10 @@ if (!gst_tiauddec_exit_audio(auddec)) { return GST_STATE_CHANGE_FAILURE; } + /* Stop codec engine */ + if (gst_tiauddec_codec_stop(auddec) < 0) { + GST_ERROR("failed to stop codec\n"); + } break; case GST_STATE_CHANGE_READY_TO_PAUSED: @@ -1360,12 +1364,6 @@ gst_ticircbuffer_data_consumed(auddec->circBuf, encDataWindow, 0); } - /* Initialize codec engine */ - /* Stop codec engine */ - if (gst_tiauddec_codec_stop(auddec) < 0) { - GST_ERROR("failed to stop codec\n"); - } - /* Notify main thread if it is waiting on decode thread shut-down */ auddec->decodeDrained = TRUE; Rendezvous_force(auddec->waitOnDecodeDrain); --- gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgdec1.c 2009-06-15 22:27:27.000000000 +0300 +++ gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgdec1_mine.c 2009-07-06 16:17:11.000000000 +0300 @@ -1216,6 +1216,10 @@ if (!gst_tiimgdec1_exit_image(imgdec1)) { return GST_STATE_CHANGE_FAILURE; } + /* Stop codec engine */ + if (gst_tiimgdec1_codec_stop(imgdec1) < 0) { + GST_ERROR("failed to stop codec\n"); + } break; default: @@ -1539,11 +1543,6 @@ gst_ticircbuffer_data_consumed(imgdec1->circBuf, encDataWindow, 0); } - /* Stop codec engine */ - if (gst_tiimgdec1_codec_stop(imgdec1) < 0) { - GST_ERROR("failed to stop codec\n"); - } - imgdec1->decodeDrained = TRUE; Rendezvous_force(imgdec1->waitOnDecodeDrain); --- gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgdec.c 2009-06-15 22:27:27.000000000 +0300 +++ gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgdec_mine.c 2009-07-06 16:20:09.000000000 +0300 @@ -1216,6 +1216,10 @@ if (!gst_tiimgdec_exit_image(imgdec)) { return GST_STATE_CHANGE_FAILURE; } + /* Stop codec engine */ + if (gst_tiimgdec_codec_stop(imgdec) < 0) { + GST_ERROR("failed to stop codec\n"); + } break; default: @@ -1538,11 +1542,6 @@ gst_ticircbuffer_data_consumed(imgdec->circBuf, encDataWindow, 0); } - /* Stop codec engine */ - if (gst_tiimgdec_codec_stop(imgdec) < 0) { - GST_ERROR("failed to stop codec\n"); - } - imgdec->decodeDrained = TRUE; Rendezvous_force(imgdec->waitOnDecodeDrain); --- gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgenc1.c 2009-06-15 22:27:26.000000000 +0300 +++ gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgenc1_mine.c 2009-07-06 16:21:36.000000000 +0300 @@ -1519,6 +1519,10 @@ if (!gst_tiimgenc1_exit_image(imgenc1)) { return GST_STATE_CHANGE_FAILURE; } + /* Stop codec engine */ + if (gst_tiimgenc1_codec_stop(imgenc1) < 0) { + GST_ERROR("failed to stop codec\n"); + } break; default: @@ -1848,11 +1852,6 @@ gst_ticircbuffer_data_consumed(imgenc1->circBuf, encDataWindow, 0); } - /* Stop codec engine */ - if (gst_tiimgenc1_codec_stop(imgenc1) < 0) { - GST_ERROR("failed to stop codec\n"); - } - imgenc1->encodeDrained = TRUE; Rendezvous_force(imgenc1->waitOnEncodeDrain); --- gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgenc.c 2009-06-15 22:27:27.000000000 +0300 +++ gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgenc_mine.c 2009-07-06 16:22:59.000000000 +0300 @@ -1518,6 +1518,10 @@ if (!gst_tiimgenc_exit_image(imgenc)) { return GST_STATE_CHANGE_FAILURE; } + /* Stop codec engine */ + if (gst_tiimgenc_codec_stop(imgenc) < 0) { + GST_ERROR("failed to stop codec\n"); + } break; default: @@ -1847,11 +1851,6 @@ gst_ticircbuffer_data_consumed(imgenc->circBuf, encDataWindow, 0); } - /* Stop codec engine */ - if (gst_tiimgenc_codec_stop(imgenc) < 0) { - GST_ERROR("failed to stop codec\n"); - } - imgenc->encodeDrained = TRUE; Rendezvous_force(imgenc->waitOnEncodeDrain); --- gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec2.c 2009-06-15 22:27:27.000000000 +0300 +++ gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec2_mine.c 2009-07-06 16:24:54.000000000 +0300 @@ -1112,6 +1112,10 @@ if (!gst_tividdec2_exit_video(viddec2)) { return GST_STATE_CHANGE_FAILURE; } + /* stop codec engine */ + if (gst_tividdec2_codec_stop(viddec2) < 0) { + GST_ERROR("failed to stop codec\n"); + } break; case GST_STATE_CHANGE_READY_TO_PAUSED: @@ -1496,11 +1500,6 @@ gst_ticircbuffer_data_consumed(viddec2->circBuf, encDataWindow, 0); } - /* stop codec engine */ - if (gst_tividdec2_codec_stop(viddec2) < 0) { - GST_ERROR("failed to stop codec\n"); - } - /* Notify main thread if it is waiting on decode thread shut-down */ viddec2->decodeDrained = TRUE; Rendezvous_force(viddec2->waitOnDecodeDrain); --- gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec.c 2009-06-15 22:27:27.000000000 +0300 +++ gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec_mine.c 2009-07-06 16:27:06.000000000 +0300 @@ -1102,6 +1102,10 @@ if (!gst_tividdec_exit_video(viddec)) { return GST_STATE_CHANGE_FAILURE; } + /* stop codec engine */ + if (gst_tividdec_codec_stop(viddec) < 0) { + GST_ERROR("failed to stop codec\n"); + } break; case GST_STATE_CHANGE_READY_TO_PAUSED: @@ -1437,11 +1441,6 @@ gst_ticircbuffer_data_consumed(viddec->circBuf, encDataWindow, 0); } - /* stop codec engine */ - if (gst_tividdec_codec_stop(viddec) < 0) { - GST_ERROR("failed to stop codec\n"); - } - /* Notify main thread if it is waiting on decode thread shut-down */ viddec->decodeDrained = TRUE; Rendezvous_force(viddec->waitOnDecodeDrain); --- gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividenc1.c 2009-06-15 22:27:27.000000000 +0300 +++ gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividenc1_mine.c 2009-07-06 16:28:25.000000000 +0300 @@ -1077,6 +1077,10 @@ if (!gst_tividenc1_exit_video(videnc1)) { return GST_STATE_CHANGE_FAILURE; } + /* Stop codec engine */ + if (gst_tividenc1_codec_stop(videnc1) < 0) { + GST_ERROR("failed to stop codec\n"); + } break; default: @@ -1532,11 +1536,6 @@ Ccv_delete(hCcv); } - /* Stop codec engine */ - if (gst_tividenc1_codec_stop(videnc1) < 0) { - GST_ERROR("failed to stop codec\n"); - } - videnc1->encodeDrained = TRUE; Rendezvous_force(videnc1->waitOnEncodeDrain); Rendezvous_force(videnc1->waitOnQueueThread); --- gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividenc.c 2009-06-15 22:27:27.000000000 +0300 +++ gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividenc_mine.c 2009-07-06 16:29:48.000000000 +0300 @@ -1022,6 +1022,10 @@ if (!gst_tividenc_exit_video(videnc)) { return GST_STATE_CHANGE_FAILURE; } + /* Stop codec engine */ + if (gst_tividenc_codec_stop(videnc) < 0) { + GST_ERROR("failed to stop codec\n"); + } break; default: @@ -1376,11 +1380,6 @@ gst_ticircbuffer_data_consumed(videnc->circBuf, encDataWindow, 0); } - /* Stop codec engine */ - if (gst_tividenc_codec_stop(videnc) < 0) { - GST_ERROR("failed to stop codec\n"); - } - /* Notify main thread if it is waiting on decode thread shut-down */ videnc->encodeDrained = TRUE; Rendezvous_force(videnc->waitOnQueueThread);