On Mon, Jul 27, 2009 at 09:28:11PM -0300, Mauro Carvalho Chehab wrote: > Hi Acano, Tested-by: Angelo Cano <acano@xxxxxxxxxxx> 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;