В Пнд, 30/05/2005 в 21:17 +0200, hermann pitton пишет:
> Am So, den 29.05.2005 schrieb Nickolay V. Shmyrev um 22:12:
> > В Вск, 29/05/2005 в 21:58 +0200, Hartmut Hackmann пишет:
> > > Hi, Hermann
> > > >
> > > > radio mono works quite nice already, but in all other cases you are
> > > > right, except that I would prefer not to be in the client call for
> > > > BOARD_MD7134 radio fmd_config in saa7134.video.c concerning the port1=0.
> > > >
> > > We can regard this as a mistake i made. In saa7134-video.c, i made this call
> > > depend on the board type, it would be better to make it depend on the tuner.
> >
> > Me is using port1=1 port2=0 with 1256 IH-3. Moreover, I've advised users
> > to change tda9887 config to
> >
> > static struct tvnorm radio = {
> > .name = "radio",
> > .b = ( cFmRadio |
> > cQSS ),
> > .c = ( cDeemphasisOFF ) ,
> > .e = ( cAudioIF_5_5 |
> > cRadioIF_38_90 ),
> > };
> >
> > And got successful reports from them about stereo.
>
> Tried it now and it's getting interesting. It _is_ already stereo!
>
> So I'm happy to know that I didn't have had halluzinations when I
> claimed 1/2 a year ago that I had it in stereo state once when fiddling
> with such stuff, without datasheet, but I didn't get it back and Gerd
> said nope.
>
> tda9885/6/7: configure for: radio
> tda9885/6/7: writing: b=0x4e c=0x0e e=0x1d
> tda9885/6/7: write: byte B 0x4e
> B0 video mode : sound trap
> B1 auto mute fm : yes
> B2 carrier mode : QSS
> B3-4 tv sound/radio : FM/radio
> B5 force mute audio: no
> B6 output port 1 : high (inactive)
> B7 output port 2 : low (active)
> tda9885/6/7: write: byte C 0x0e
> C0-4 top adjustment : -2 dB
> C5-6 de-emphasis : no
> C7 audio gain : 0
> tda9885/6/7: write: byte E 0x1d
> E0-1 sound carrier : 5.5 MHz
> E6 l pll ganting : 13
> E2-4 video if : 44 MHz
> E7 vif agc output : fm radio carrier afc
> --
> saa7134[0]: i2c xfer: < 86 00 4e 0e 1d >
> saa7134[0]: i2c xfer: < 87 =be >
> tda9885/6/7: read: 0xbe
> after power on : no
> afc : + 12.5 kHz
> fmif level : high
> afc window : out
> vfi level : high
> saa7134[0]: i2c xfer: < c1 =74 >
> saa7134[0]: i2c xfer: < 87 =bc >
> saa7134[0]: i2c xfer: < c0 07 0e 8e 19 >
> saa7134[0]: i2c xfer: < c1 =74 >
> saa7134[0]: i2c xfer: < 87 =bc >
> saa7134[0]: i2c xfer: < c1 =74 >
> saa7134[0]: i2c xfer: < 87 =be >
> saa7134[0]: i2c xfer: < c0 07 0e 8e 19 >
> saa7134[0]: i2c xfer: < c1 =74 >
> saa7134[0]: i2c xfer: < 87 =bc >
> saa7134[0]: i2c xfer: < c1 =74 >
> saa7134[0]: i2c xfer: < 87 =bc >
> saa7134[0]: i2c xfer: < c1 =74 >
>
> > About change in tuner
> > part, I am not sure, datasheets clearly explains that config above
> > should be used for tda, but I can't find the place were 0x99 for tuner
> > is specified. Moreover, there are
> > examples of tuner settings including stereo fm setting and it uses 0x19.
>
> To get stereo with the other/patch settings you _have to_ set bit6 to 0.
> Try it out. With 0x19 you don't reach it. (bit 5 and 7 do nothing, so
> use what you want, like 0x59 for mono ...)
>
> It is described in the BandswitchingByte table.
>
> Also look at the big "convenience" ;) table, IF gain bit is 1 in FM
> mode, audio gain is 1 in stereo as I read? The others settings I kept
> also identical with Hartmut's card are Xed and should do nothing, but we
> can't use adjust 0x1f as it causes some distortions.
>
> So if we can't keep in sync with Hartmut's settings we can narrow more
> down to our cards next and see? Do you get anything acceptable without
> high sensitivity (port1=1)? If I use the rabbitears antenna from the
> card and remove the tv cable (both together is worse, because there is
> some frequency offset resulting in noisy sound) with port1=0 I'm reduced
> to 4 stations and only two are good, also stereo. That looks _very_ much
> better with port1=1.
>
> So I _seem_ to know what switches it on with Hartmut's settings, but why
> it starts also working with deemphasisOFF only I don't know yet.
>
> Hermann
>
Actually I don't know. I still believe that only tda setting can do the
work or only tuner, but they can work together. Anyhow, we should test
the patch attached. It definitely requires improvement (I even have not
tested it) like it should provide a way to get stereo/mono settings.
Port1 option is definitely required for me, but there is comment in
tda9887 code that says it brokes some cards. Probably we should also
extend our card description to allow handle such kind of things.
Btw, besides stereo problem there is problem with autoscanning. Do you
have any suggestions or ideas how to solve it?
diff -upr video4linux/saa7134-video.c video4linux.new/saa7134-video.c
--- video4linux/saa7134-video.c 2005-05-25 03:13:30.000000000 +0400
+++ video4linux.new/saa7134-video.c 2005-05-31 02:53:19.000000000 +0400
@@ -2155,6 +2155,7 @@ static int radio_do_ioctl(struct inode *
#endif
return 0;
}
+
case VIDIOC_ENUMINPUT:
{
struct v4l2_input *i = arg;
@@ -2179,13 +2180,20 @@ static int radio_do_ioctl(struct inode *
strcpy(a->name,"Radio");
return 0;
}
+ case VIDIOC_S_AUDIO:
+ {
+ struct v4l2_audio *a = arg;
+
+ saa7134_i2c_call_clients(dev,VIDIOC_S_AUDIO, a);
+
+ return 0;
+ }
case VIDIOC_G_STD:
{
v4l2_std_id *id = arg;
*id = 0;
return 0;
}
- case VIDIOC_S_AUDIO:
case VIDIOC_S_TUNER:
case VIDIOC_S_INPUT:
case VIDIOC_S_STD:
diff -upr video4linux/tda9887.c video4linux.new/tda9887.c
--- video4linux/tda9887.c 2005-05-22 23:24:38.000000000 +0400
+++ video4linux.new/tda9887.c 2005-05-31 03:11:06.000000000 +0400
@@ -62,6 +62,7 @@ struct tda9887 {
unsigned int config;
unsigned int pinnacle_id;
unsigned int using_v4l2;
+ unsigned int radio_mode;
};
struct tvnorm {
@@ -559,6 +560,10 @@ static int tda9887_configure(struct tda9
if (UNSET != t->pinnacle_id) {
tda9887_set_pinnacle(t,buf);
}
+
+ if (t->radio && t->radio_mode == VIDEO_SOUND_STEREO)
+ buf[2] = cDeemphasisOFF;
+
tda9887_set_config(t,buf);
tda9887_set_insmod(t,buf);
@@ -753,6 +758,16 @@ tda9887_command(struct i2c_client *clien
}
break;
}
+ case VIDIOC_S_AUDIO:
+ {
+ struct v4l2_audio* a = arg;
+
+ if (t->radio)
+ t->radio_mode = va->mode;
+
+ tda9887_configure(t);
+ break;
+ }
default:
/* nothing */
break;
diff -upr video4linux/tuner-core.c video4linux.new/tuner-core.c
--- video4linux/tuner-core.c 2005-05-22 23:24:38.000000000 +0400
+++ video4linux.new/tuner-core.c 2005-05-31 03:11:49.000000000 +0400
@@ -387,6 +387,19 @@ tuner_command(struct i2c_client *client,
tuner->rangehigh = tv_range[1] * 16;
break;
}
+ case VIDIOC_S_AUDIO:
+ {
+ struct v4l2_audio *a = arg;
+
+ SWITCH_V4L2;
+
+ if (V4L2_TUNER_RADIO == t->mode && t->has_signal) {
+
+ t->radio_mode = a->mode;
+ if (t->freq)
+ set_freq(client,t->freq);
+ }
+ }
default:
/* nothing */
break;
diff -upr video4linux/tuner.h video4linux.new/tuner.h
--- video4linux/tuner.h 2005-05-29 14:15:33.000000000 +0400
+++ video4linux.new/tuner.h 2005-05-31 03:12:42.000000000 +0400
@@ -160,6 +160,7 @@ struct tuner {
enum v4l2_tuner_type mode;
unsigned int input;
+ unsigned int radio_mode;
/* used by MT2032 */
unsigned int xogc;
diff -upr video4linux/tuner-simple.c video4linux.new/tuner-simple.c
--- video4linux/tuner-simple.c 2005-05-29 14:22:08.000000000 +0400
+++ video4linux.new/tuner-simple.c 2005-05-31 03:14:43.000000000 +0400
@@ -437,18 +437,18 @@ static void default_set_radio_freq(struc
c->addr=0x60; /* Forces usage of I2C FM Tuner which is different from
TV */
/*These values are empirically determinated */
- div = (int)(freq*7.625)- 20;
+ div = (int)(freq*166)/12- 20;
buffer[2] = 0x80; /* could be also 0x88 */
buffer[3] = 0x10; /* could be also 0x18 or 0x19 */
break;
case TUNER_PHILIPS_FM1216ME_MK3:
case TUNER_PHILIPS_FM1236_MK3:
- buffer[3] = 0x19;
+ buffer[3] = (t->radio_mode == VIDEO_SOUND_STEREO) ? 0x99 : 0x19;
break;
case TUNER_PHILIPS_FM1256_IH3:
div = (20 * freq)/16 + 333 * 2;
buffer[2] = 0x80;
- buffer[3] = 0x19;
+ buffer[3] = (t->radio_mode == VIDEO_SOUND_STEREO) ? 0x99 : 0x19;
break;
case TUNER_LG_PAL_FM:
buffer[3] = 0xa5;
--
Unsubscribe mailto:video4linux-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
[Home]
[Older V4L]
[Linux DVB]
[Video Disk Recorder]
[Video Technology]
[Asterisk]
[Photo]
[DCCP]
[Netdev]
[Plasma TVs]
[Video Projectors]
[PDAs]
[Xorg]
[Util Linux NG]
[Xfree86]
[Devices]
[Big List of Linux Books]
[Free Photo Albums]
[LCD TVs]
[Fedora Users]
[Webcams]
[Fedora Women]
[HDTV]
[ALSA Users]
[ALSA Devel]
[Stuff]
[SSH]
[Linux USB]