From patchwork Wed Jul 29 00:07:53 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: acano@fastmail.fm X-Patchwork-Id: 38036 X-Patchwork-Delegate: mchehab@redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6T0CR2M008371 for ; Wed, 29 Jul 2009 00:12:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753234AbZG2AIL (ORCPT ); Tue, 28 Jul 2009 20:08:11 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753217AbZG2AIK (ORCPT ); Tue, 28 Jul 2009 20:08:10 -0400 Received: from out1.smtp.messagingengine.com ([66.111.4.25]:48901 "EHLO out1.smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753234AbZG2AIJ (ORCPT ); Tue, 28 Jul 2009 20:08:09 -0400 Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 1062B3BDBF9; Tue, 28 Jul 2009 20:08:09 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 28 Jul 2009 20:08:09 -0400 X-Sasl-enc: 56vQxBBlgpsCL066dYcCwkrf4k50gcJrQgMgdybn4z0T 1248826088 Received: from localhost.localdomain (ool-457b4d55.dyn.optonline.net [69.123.77.85]) by mail.messagingengine.com (Postfix) with ESMTPSA id C7B8BD4E0; Tue, 28 Jul 2009 20:08:08 -0400 (EDT) Received: from acano by localhost.localdomain with local (Exim 4.69) (envelope-from ) id 1MVwi1-0006OD-MW; Tue, 28 Jul 2009 20:07:53 -0400 Date: Tue, 28 Jul 2009 20:07:53 -0400 From: acano@fastmail.fm To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org Subject: Re: [PATCH] em28xx: enable usb audio for plextor px-tv100u Message-ID: <20090729000753.GA24496@localhost.localdomain> References: <20090718173758.GA32708@localhost.localdomain> <20090727212811.5b7dc041@pedra.chehab.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20090727212811.5b7dc041@pedra.chehab.org> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On Mon, Jul 27, 2009 at 09:28:11PM -0300, Mauro Carvalho Chehab wrote: > Hi Acano, Tested-by: Angelo Cano works great > > + /*FIXME hack to unmute usb audio stream */ > > + em28xx_set_ctrl(dev, ctrl); > > Hmm... this function were removed. In thesis, you shouldn't need to > do anything to unmute. > I still need it, see attachment. > > Could you please try the enclosed patch and see if this is enough to fix for > Plextor? If so, please send me a Tested-by: tag for me to add it at > 2.6.31 fix patches. > Like I said the patch works great, and also solves my audio volume problem. With your patch the volume is set to a sane value (presumably 0db) and the distortion/clipping is gone. Thanks man. The volume problem was driving me crazy. diff -r fd96af63f79b linux/drivers/media/video/em28xx/em28xx-cards.c --- a/linux/drivers/media/video/em28xx/em28xx-cards.c Fri Jun 19 19:56:56 2009 +0000 +++ b/linux/drivers/media/video/em28xx/em28xx-cards.c Tue Jul 28 19:26:58 2009 -0400 @@ -639,22 +639,27 @@ struct em28xx_board em28xx_boards[] = { }, [EM2861_BOARD_PLEXTOR_PX_TV100U] = { .name = "Plextor ConvertX PX-TV100U", - .valid = EM28XX_BOARD_NOT_VALIDATED, .tuner_type = TUNER_TNF_5335MF, + .xclk = EM28XX_XCLK_I2S_MSB_TIMING | + EM28XX_XCLK_FREQUENCY_12MHZ, .tda9887_conf = TDA9887_PRESENT, .decoder = EM28XX_TVP5150, + .has_msp34xx = 1, .input = { { .type = EM28XX_VMUX_TELEVISION, .vmux = TVP5150_COMPOSITE0, .amux = EM28XX_AMUX_LINE_IN, + .gpio = pinnacle_hybrid_pro_analog, }, { .type = EM28XX_VMUX_COMPOSITE1, .vmux = TVP5150_COMPOSITE1, .amux = EM28XX_AMUX_LINE_IN, + .gpio = pinnacle_hybrid_pro_analog, }, { .type = EM28XX_VMUX_SVIDEO, .vmux = TVP5150_SVIDEO, .amux = EM28XX_AMUX_LINE_IN, + .gpio = pinnacle_hybrid_pro_analog, } }, }, @@ -1948,9 +1953,8 @@ void em28xx_pre_card_setup(struct em28xx /* request some modules */ switch (dev->model) { case EM2861_BOARD_PLEXTOR_PX_TV100U: - /* FIXME guess */ - /* Turn on analog audio output */ - em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd); + /* Sets the msp34xx I2S speed */ + dev->i2s_speed = 2048000; break; case EM2861_BOARD_KWORLD_PVRTV_300U: case EM2880_BOARD_KWORLD_DVB_305U: diff -r fd96af63f79b linux/drivers/media/video/em28xx/em28xx-video.c --- a/linux/drivers/media/video/em28xx/em28xx-video.c Fri Jun 19 19:56:56 2009 +0000 +++ b/linux/drivers/media/video/em28xx/em28xx-video.c Tue Jul 28 19:26:58 2009 -0400 @@ -1123,8 +1123,32 @@ static int vidioc_s_ctrl(struct file *fi else rc = 1; - /* It were not an AC97 control. Sends it to the v4l2 dev interface */ + /* It we're not an AC97 control. Sends it to the v4l2 dev interface */ if (rc == 1) { + /* hack ac97_set_ctrl() call to unmute usb audio for Plextor ConvertX + * PX-TV100U + * + * need to eventually reach em28xx_audio_analog_set() + * + * and: + ***************** + * xclk = dev->board.xclk & 0x7f; + * if (!dev->mute) + * xclk |= EM28XX_XCLK_AUDIO_UNMUTE; + * + * ret = em28xx_write_reg(dev, EM28XX_R0F_XCLK, xclk); + * if (ret < 0) + * return ret; + * msleep(10); + ***************** + * + * included here as a simple call ac97_set_ctrl() since the path to + * em28xx_audio_analog_set() has the necessary conditional checks + * which I don't want to bother duplicating, and in case I needed + * something else besides unmuting. + */ + ac97_set_ctrl(dev, ctrl); + v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_ctrl, ctrl); /* FIXME: should be returning a meaninful value */ rc = 0;