From: Vitaly Wool <vital@embeddedalley.com>
To: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: video4linux-list@redhat.com, em28xx@mcentral.de
Subject: Re: em28xx: Compro VideoMate For You sound problems
Date: Wed, 25 Feb 2009 18:46:33 +0300 [thread overview]
Message-ID: <49A567D9.80805@embeddedalley.com> (raw)
In-Reply-To: <20090225090728.7f2b0673@caramujo.chehab.org>
Mauro,
Mauro Carvalho Chehab wrote:
> Ok, so if everything else is properly configured on em28xx, you should have
> audio working.
>
> I've just committed a patch that should automatically load tvaudio for your
> board. Could you please test it?
it looks like I've got the sound coming out of the board with the following piece of hackery:
diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c
index eee8d01..55bcf42 100644
--- a/drivers/media/video/em28xx/em28xx-core.c
+++ b/drivers/media/video/em28xx/em28xx-core.c
@@ -406,6 +406,24 @@ int em28xx_audio_analog_set(struct em28xx *dev)
int ret, i;
u8 xclk;
+ if (dev->i2c_tvaudio_client) {
+ char c;
+ switch (dev->ctl_ainput) {
+ case 0:
+ c = 0xfd;
+ break;
+ case 1:
+ c = 0xfc;
+ break;
+ default:
+ c = 0xfe;
+ break;
+ }
+ if (dev->mute)
+ c = 0xfe;
+ return em28xx_write_regs(dev, 0x08, &c, 1);
+ }
+
if (!dev->audio_mode.has_audio)
return 0;
diff --git a/drivers/media/video/em28xx/em28xx-i2c.c b/drivers/media/video/em28xx/em28xx-i2c.c
index 2dab43d..55e5a2e 100644
--- a/drivers/media/video/em28xx/em28xx-i2c.c
+++ b/drivers/media/video/em28xx/em28xx-i2c.c
@@ -510,12 +510,21 @@ static int attach_inform(struct i2c_client *client)
dprintk1(1, "attach_inform: tvp5150 detected.\n");
break;
+ case 0xb0:
+ dprintk1(1, "attach_inform: tda9874 detected\n");
+ dprintk1(1, "driver id %d\n", client->driver->id);
+ dev->i2c_tvaudio_client = client;
+ if (!dev->tuner_addr)
+ dev->tuner_addr = client->addr;
+ break;
+
default:
if (!dev->tuner_addr)
dev->tuner_addr = client->addr;
dprintk1(1, "attach inform: detected I2C address %x\n",
client->addr << 1);
+ dprintk1(1, "driver id %d\n", client->driver->id);
}
@@ -554,6 +563,7 @@ static char *i2c_devs[128] = {
[0x80 >> 1] = "msp34xx",
[0x88 >> 1] = "msp34xx",
[0xa0 >> 1] = "eeprom",
+ [0xb0 >> 1] = "tvaudio",
[0xb8 >> 1] = "tvp5150a",
[0xba >> 1] = "tvp5150a",
[0xc0 >> 1] = "tuner (analog)",
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index efd6415..5f7f4da 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -540,6 +540,13 @@ static void video_mux(struct em28xx *dev, int index)
&route);
}
+ if (dev->i2c_tvaudio_client) {
+ route.input = dev->ctl_ainput;
+ route.output = 0;
+ em28xx_i2c_call_clients(dev, VIDIOC_INT_S_AUDIO_ROUTING,
+ &route);
+ }
+
em28xx_audio_analog_set(dev);
}
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h
index 3e82d81..67c00af 100644
--- a/drivers/media/video/em28xx/em28xx.h
+++ b/drivers/media/video/em28xx/em28xx.h
@@ -479,6 +479,7 @@ struct em28xx {
/* i2c i/o */
struct i2c_adapter i2c_adap;
struct i2c_client i2c_client;
+ struct i2c_client *i2c_tvaudio_client;
/* video for linux */
int users; /* user count for exclusive use */
struct video_device *vdev; /* video for linux device struct */
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index 100f90a..c263f5d 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -1248,7 +1248,7 @@ struct em28xx_board em28xx_boards[] = {
.input = { {
.type = EM28XX_VMUX_TELEVISION,
.vmux = TVP5150_COMPOSITE0,
- .amux = EM28XX_AMUX_LINE_IN,
+ .amux = EM28XX_AMUX_VIDEO,
}, {
.type = EM28XX_VMUX_SVIDEO,
.vmux = TVP5150_SVIDEO,
Please note the .amux change; my bad it wasn't right from the bery beginning. However, just changing it
doesn't make things work, either with your latest patch or without it. Changes in em28xx_audio_analog_set are
apparently what matter. but I'm not sure.
The other thing is that even with this patch, I'm getting more noise than TV sound. That might be related to
some TDA9874 programming needed and not done, but I'm not sure here either.
Thanks,
Vitaly
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
next prev parent reply other threads:[~2009-02-25 15:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-24 7:47 em28xx: Compro VideoMate For You sound problems Vitaly Wool
2009-02-25 2:42 ` Mauro Carvalho Chehab
2009-02-25 12:42 ` Vitaly Wool
2009-02-25 12:07 ` Mauro Carvalho Chehab
2009-02-25 15:46 ` Vitaly Wool [this message]
2009-02-25 13:18 ` Mauro Carvalho Chehab
2009-02-25 16:58 ` Vitaly Wool
2009-02-25 17:11 ` Vitaly Wool
2009-02-25 18:33 ` Mauro Carvalho Chehab
2009-02-25 19:25 ` Vitaly Wool
2009-02-25 23:40 ` Mauro Carvalho Chehab
2009-02-27 15:12 ` Vitaly Wool
2009-02-27 15:43 ` Vitaly Wool
2009-02-28 0:40 ` Mauro Carvalho Chehab
2009-02-28 4:49 ` Vitaly Wool
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=49A567D9.80805@embeddedalley.com \
--to=vital@embeddedalley.com \
--cc=em28xx@mcentral.de \
--cc=mchehab@infradead.org \
--cc=video4linux-list@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox