Re: [PATCH][RESEND] Use correct sampling rate for TV/FM radio

2009-05-30 Thread hermann pitton

Am Freitag, den 29.05.2009, 09:06 +0200 schrieb Oldrich Jedlicka: 
> Hi,
> 
> On Friday 29 of May 2009 at 01:49:50, hermann pitton wrote:
> > Hi,
> >
> > just some short notes.
> >
> > Am Donnerstag, den 28.05.2009, 18:47 +0200 schrieb Oldrich Jedlicka:
> > > On Wednesday 27 of May 2009 at 21:05:35, Mauro Carvalho Chehab wrote:
> > > > Em Sat, 23 May 2009 19:09:12 +0200
> > > >
> > > > Oldrich Jedlicka  escreveu:
> > > > > On Tuesday 19 of May 2009 at 19:54:18, Oldrich Jedlicka wrote:
> > > > > > On Tuesday 14 of April 2009 at 20:48:14, Oldrich Jedlicka wrote:
> > > > > > > Here is the fix for using the 32kHz sampling rate for TV and FM
> > > > > > > radio (ALSA). The TV uses 32kHz anyway (mode 0; 32kHz demdec on),
> > > > > > > radio works only with 32kHz (mode 1; 32kHz baseband). The ALSA
> > > > > > > wrongly reported 32kHz and 48kHz for everything (TV, radio,
> > > > > > > LINE1/2).
> > > > > > >
> > > > > > > Now it should be possible to just use the card without the need
> > > > > > > to change the capture rate from 48kHz to 32kHz. Enjoy :-)
> > > > >
> > > > > Hi Mauro,
> > > > >
> > > > > I put you on CC in my previous mail, but maybe it would be better to
> > > > > send it directly. So do you have any opinions about the approach
> > > > > described above/below?
> > > >
> > > > I did a look at saa713x datasheet. In thesis, it could be possible to
> > > > program the audio sampling rate divider for several rates including 32
> > > > kHz, 44.1 kHz and 48 kHz.
> > > >
> > > > However, I suspect that only MONO is supported with rates different
> > > > than 32 kHz, since it is said there that AM/FM requires a nominal audio
> > > > sample of 32 kHz, and that NICAM nominal audio sample rate is 32 kHz.
> > > >
> > > > So, IMO, the right patch is just to allow samplings at 32 kHz
> > >
> > > Hi Mauro,
> > >
> > > I'm not good in programming the SAA7134, but I also have the SAA713x
> > > manual :-).
> >
> > If you have the programming manual, not what is for free download but
> > under NDA, you should find exact register settings for 48kHZ stereo over
> > DMA TV sound, if possible at all.
> 
> I have something that is called "SAA7133; SAA7135 PCI audio and video 
> broadcast decoder", Preliminary version, 2003 Sep 09. I've found it on the 
> internet in 2006.
> 
> > > I don't know if the NICAM mode is used for LINE1/LINE2, but if not - and
> > > if it uses the Video-lock mode - it can (or could) operate in 44.1kHz and
> > > 48kHz too.
> >
> > NICAM, on all TV standards that support it, is always at the second
> > soundcarrier. So input must be SIF to isolate the SSIF and decode it
> > from there with the nicam decoder. (amux TV)
> >
> > > The manual talks about Video-mode and here is the note, that the FM/AM
> > > sound decoring requires a nominal audio sample rate of 32kHz. The code
> > > (saa7134-alsa.c) sets to use 32kHz for radio, it is not configurable - so
> > > this is where my patch applies.
> >
> > For all analog audio out from tuner the sampling rate is 32 kHz. That is
> > correct.
> >
> > > The Video-lock mode can use 32kHz, 44.1kHz and 48kHz. The NICAM can use
> > > only the 32kHz. From the code (again the saa7134-alsa.c) the TV sets to
> > > use the DEMDEC 32kHz mode and is not configurable - again my patch
> > > applies.
> > >
> > > So my only question is about the LINE1/LINE2, I do not understand the
> > > coding of SAA713x as much to be able to say anything about the mode of
> > > operation for LINE1/LINE2. Maybe somebody wants to use the 48kHz whenever
> > > possible on LINE1/LINE2 (quality reasons), so maybe limiting it there
> > > isn't good - I don't know, if it is possible to use it.
> >
> > Gerd had working 48kHz audio sampling rate from external audio LINE
> > inputs on his saa7134-oss, at least on the saa7134 chip.
> >
> > This is not working anymore on saa7134-alsa.
> >
> > He was also the opinion, that 48kHz stereo TV sound is not possible over
> > DMA too. IIRC, on broadcast level 32kHz is already up sampled.
> >
> > A limiting factor might also be, that we can't differentiate between
> > saa7133, saa7135 and saa7131e. There are such chip comparing tables I
> > don't have at hand at the moment.
> 
> I cannot find anything specific to setting the DMA for TV in the document, 
> only about the audio clock generation. In NICAM mode (whatever it means) the 
> nominal sample rate is 32kHz. The frequency 32kHz can operate in two modes - 
> with/without DEMDEC enabled (I don't know what the DEMDEC is). The code for 
> TV in saa7134-alsa.c (I only guess, because the register address is 
> completely different) uses the 32kHz with DEMDEC enabled (0x00 for 
> SIF_SAMPLE_FREQ). The LINE1/LINE2 code sets the frequency to 32kHz+DEMDEC 
> disabled (0x01) or 48kHz (0x03). There should be a possibility to set 44.1kHz 
> (0x02) too, but it is not used.

NCIAM is digital audio at SSIF and locked with 32kHz sample size to
video at broadcast level. Needs DEMDEC/SIF input to the NICAM decoder.

DemDec 

Re: [PATCH][RESEND] Use correct sampling rate for TV/FM radio

2009-05-29 Thread Oldrich Jedlicka
Hi,

On Friday 29 of May 2009 at 01:49:50, hermann pitton wrote:
> Hi,
>
> just some short notes.
>
> Am Donnerstag, den 28.05.2009, 18:47 +0200 schrieb Oldrich Jedlicka:
> > On Wednesday 27 of May 2009 at 21:05:35, Mauro Carvalho Chehab wrote:
> > > Em Sat, 23 May 2009 19:09:12 +0200
> > >
> > > Oldrich Jedlicka  escreveu:
> > > > On Tuesday 19 of May 2009 at 19:54:18, Oldrich Jedlicka wrote:
> > > > > On Tuesday 14 of April 2009 at 20:48:14, Oldrich Jedlicka wrote:
> > > > > > Here is the fix for using the 32kHz sampling rate for TV and FM
> > > > > > radio (ALSA). The TV uses 32kHz anyway (mode 0; 32kHz demdec on),
> > > > > > radio works only with 32kHz (mode 1; 32kHz baseband). The ALSA
> > > > > > wrongly reported 32kHz and 48kHz for everything (TV, radio,
> > > > > > LINE1/2).
> > > > > >
> > > > > > Now it should be possible to just use the card without the need
> > > > > > to change the capture rate from 48kHz to 32kHz. Enjoy :-)
> > > >
> > > > Hi Mauro,
> > > >
> > > > I put you on CC in my previous mail, but maybe it would be better to
> > > > send it directly. So do you have any opinions about the approach
> > > > described above/below?
> > >
> > > I did a look at saa713x datasheet. In thesis, it could be possible to
> > > program the audio sampling rate divider for several rates including 32
> > > kHz, 44.1 kHz and 48 kHz.
> > >
> > > However, I suspect that only MONO is supported with rates different
> > > than 32 kHz, since it is said there that AM/FM requires a nominal audio
> > > sample of 32 kHz, and that NICAM nominal audio sample rate is 32 kHz.
> > >
> > > So, IMO, the right patch is just to allow samplings at 32 kHz
> >
> > Hi Mauro,
> >
> > I'm not good in programming the SAA7134, but I also have the SAA713x
> > manual :-).
>
> If you have the programming manual, not what is for free download but
> under NDA, you should find exact register settings for 48kHZ stereo over
> DMA TV sound, if possible at all.

I have something that is called "SAA7133; SAA7135 PCI audio and video 
broadcast decoder", Preliminary version, 2003 Sep 09. I've found it on the 
internet in 2006.

> > I don't know if the NICAM mode is used for LINE1/LINE2, but if not - and
> > if it uses the Video-lock mode - it can (or could) operate in 44.1kHz and
> > 48kHz too.
>
> NICAM, on all TV standards that support it, is always at the second
> soundcarrier. So input must be SIF to isolate the SSIF and decode it
> from there with the nicam decoder. (amux TV)
>
> > The manual talks about Video-mode and here is the note, that the FM/AM
> > sound decoring requires a nominal audio sample rate of 32kHz. The code
> > (saa7134-alsa.c) sets to use 32kHz for radio, it is not configurable - so
> > this is where my patch applies.
>
> For all analog audio out from tuner the sampling rate is 32 kHz. That is
> correct.
>
> > The Video-lock mode can use 32kHz, 44.1kHz and 48kHz. The NICAM can use
> > only the 32kHz. From the code (again the saa7134-alsa.c) the TV sets to
> > use the DEMDEC 32kHz mode and is not configurable - again my patch
> > applies.
> >
> > So my only question is about the LINE1/LINE2, I do not understand the
> > coding of SAA713x as much to be able to say anything about the mode of
> > operation for LINE1/LINE2. Maybe somebody wants to use the 48kHz whenever
> > possible on LINE1/LINE2 (quality reasons), so maybe limiting it there
> > isn't good - I don't know, if it is possible to use it.
>
> Gerd had working 48kHz audio sampling rate from external audio LINE
> inputs on his saa7134-oss, at least on the saa7134 chip.
>
> This is not working anymore on saa7134-alsa.
>
> He was also the opinion, that 48kHz stereo TV sound is not possible over
> DMA too. IIRC, on broadcast level 32kHz is already up sampled.
>
> A limiting factor might also be, that we can't differentiate between
> saa7133, saa7135 and saa7131e. There are such chip comparing tables I
> don't have at hand at the moment.

I cannot find anything specific to setting the DMA for TV in the document, 
only about the audio clock generation. In NICAM mode (whatever it means) the 
nominal sample rate is 32kHz. The frequency 32kHz can operate in two modes - 
with/without DEMDEC enabled (I don't know what the DEMDEC is). The code for 
TV in saa7134-alsa.c (I only guess, because the register address is 
completely different) uses the 32kHz with DEMDEC enabled (0x00 for 
SIF_SAMPLE_FREQ). The LINE1/LINE2 code sets the frequency to 32kHz+DEMDEC 
disabled (0x01) or 48kHz (0x03). There should be a possibility to set 44.1kHz 
(0x02) too, but it is not used.

One of the lines (LINE1/LINE2) captures the radio, but the radio requires 
32kHz (it is the LINE1/LINE2 branch in code - it uses mode 0x01, I don't know 
if the mode 0x00 can be used).

I tried to use the 48kHz for the composite input (digital camera) and it 
doesn't work for me too.

The rest is covered in a big cloud, I don't know much about DMA programming 
nor about the SAA713x programming. The document is n

Re: [PATCH][RESEND] Use correct sampling rate for TV/FM radio

2009-05-28 Thread hermann pitton
Hi,

just some short notes.

Am Donnerstag, den 28.05.2009, 18:47 +0200 schrieb Oldrich Jedlicka:
> On Wednesday 27 of May 2009 at 21:05:35, Mauro Carvalho Chehab wrote:
> > Em Sat, 23 May 2009 19:09:12 +0200
> >
> > Oldrich Jedlicka  escreveu:
> > > On Tuesday 19 of May 2009 at 19:54:18, Oldrich Jedlicka wrote:
> > > > On Tuesday 14 of April 2009 at 20:48:14, Oldrich Jedlicka wrote:
> > > > > Here is the fix for using the 32kHz sampling rate for TV and FM radio
> > > > > (ALSA). The TV uses 32kHz anyway (mode 0; 32kHz demdec on), radio
> > > > > works only with 32kHz (mode 1; 32kHz baseband). The ALSA wrongly
> > > > > reported 32kHz and 48kHz for everything (TV, radio, LINE1/2).
> > > > >
> > > > > Now it should be possible to just use the card without the need to
> > > > > change the capture rate from 48kHz to 32kHz. Enjoy :-)
> > >
> > > Hi Mauro,
> > >
> > > I put you on CC in my previous mail, but maybe it would be better to send
> > > it directly. So do you have any opinions about the approach described
> > > above/below?
> >
> > I did a look at saa713x datasheet. In thesis, it could be possible to
> > program the audio sampling rate divider for several rates including 32 kHz,
> > 44.1 kHz and 48 kHz.
> >
> > However, I suspect that only MONO is supported with rates different than 32
> > kHz, since it is said there that AM/FM requires a nominal audio sample of
> > 32 kHz, and that NICAM nominal audio sample rate is 32 kHz.
> >
> > So, IMO, the right patch is just to allow samplings at 32 kHz
> 
> Hi Mauro,
> 
> I'm not good in programming the SAA7134, but I also have the SAA713x 
> manual :-).

If you have the programming manual, not what is for free download but
under NDA, you should find exact register settings for 48kHZ stereo over
DMA TV sound, if possible at all.

> I don't know if the NICAM mode is used for LINE1/LINE2, but if not - and if 
> it 
> uses the Video-lock mode - it can (or could) operate in 44.1kHz and 48kHz 
> too.

NICAM, on all TV standards that support it, is always at the second
soundcarrier. So input must be SIF to isolate the SSIF and decode it
from there with the nicam decoder. (amux TV)

> The manual talks about Video-mode and here is the note, that the FM/AM sound 
> decoring requires a nominal audio sample rate of 32kHz. The code 
> (saa7134-alsa.c) sets to use 32kHz for radio, it is not configurable - so 
> this is where my patch applies.

For all analog audio out from tuner the sampling rate is 32 kHz. That is
correct.

> The Video-lock mode can use 32kHz, 44.1kHz and 48kHz. The NICAM can use only 
> the 32kHz. From the code (again the saa7134-alsa.c) the TV sets to use the 
> DEMDEC 32kHz mode and is not configurable - again my patch applies.
> 
> So my only question is about the LINE1/LINE2, I do not understand the coding 
> of SAA713x as much to be able to say anything about the mode of operation for 
> LINE1/LINE2. Maybe somebody wants to use the 48kHz whenever possible on 
> LINE1/LINE2 (quality reasons), so maybe limiting it there isn't good - I 
> don't know, if it is possible to use it.

Gerd had working 48kHz audio sampling rate from external audio LINE
inputs on his saa7134-oss, at least on the saa7134 chip.

This is not working anymore on saa7134-alsa.

He was also the opinion, that 48kHz stereo TV sound is not possible over
DMA too. IIRC, on broadcast level 32kHz is already up sampled.

A limiting factor might also be, that we can't differentiate between
saa7133, saa7135 and saa7131e. There are such chip comparing tables I
don't have at hand at the moment.

Cheers,
Hermann




--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH][RESEND] Use correct sampling rate for TV/FM radio

2009-05-28 Thread Oldrich Jedlicka
On Wednesday 27 of May 2009 at 21:05:35, Mauro Carvalho Chehab wrote:
> Em Sat, 23 May 2009 19:09:12 +0200
>
> Oldrich Jedlicka  escreveu:
> > On Tuesday 19 of May 2009 at 19:54:18, Oldrich Jedlicka wrote:
> > > On Tuesday 14 of April 2009 at 20:48:14, Oldrich Jedlicka wrote:
> > > > Here is the fix for using the 32kHz sampling rate for TV and FM radio
> > > > (ALSA). The TV uses 32kHz anyway (mode 0; 32kHz demdec on), radio
> > > > works only with 32kHz (mode 1; 32kHz baseband). The ALSA wrongly
> > > > reported 32kHz and 48kHz for everything (TV, radio, LINE1/2).
> > > >
> > > > Now it should be possible to just use the card without the need to
> > > > change the capture rate from 48kHz to 32kHz. Enjoy :-)
> >
> > Hi Mauro,
> >
> > I put you on CC in my previous mail, but maybe it would be better to send
> > it directly. So do you have any opinions about the approach described
> > above/below?
>
> I did a look at saa713x datasheet. In thesis, it could be possible to
> program the audio sampling rate divider for several rates including 32 kHz,
> 44.1 kHz and 48 kHz.
>
> However, I suspect that only MONO is supported with rates different than 32
> kHz, since it is said there that AM/FM requires a nominal audio sample of
> 32 kHz, and that NICAM nominal audio sample rate is 32 kHz.
>
> So, IMO, the right patch is just to allow samplings at 32 kHz

Hi Mauro,

I'm not good in programming the SAA7134, but I also have the SAA713x 
manual :-).

I don't know if the NICAM mode is used for LINE1/LINE2, but if not - and if it 
uses the Video-lock mode - it can (or could) operate in 44.1kHz and 48kHz 
too.

The manual talks about Video-mode and here is the note, that the FM/AM sound 
decoring requires a nominal audio sample rate of 32kHz. The code 
(saa7134-alsa.c) sets to use 32kHz for radio, it is not configurable - so 
this is where my patch applies.

The Video-lock mode can use 32kHz, 44.1kHz and 48kHz. The NICAM can use only 
the 32kHz. From the code (again the saa7134-alsa.c) the TV sets to use the 
DEMDEC 32kHz mode and is not configurable - again my patch applies.

So my only question is about the LINE1/LINE2, I do not understand the coding 
of SAA713x as much to be able to say anything about the mode of operation for 
LINE1/LINE2. Maybe somebody wants to use the 48kHz whenever possible on 
LINE1/LINE2 (quality reasons), so maybe limiting it there isn't good - I 
don't know, if it is possible to use it.
 
Cheers,
Oldrich.
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH][RESEND] Use correct sampling rate for TV/FM radio

2009-05-27 Thread Mauro Carvalho Chehab
Em Sat, 23 May 2009 19:09:12 +0200
Oldrich Jedlicka  escreveu:

> On Tuesday 19 of May 2009 at 19:54:18, Oldrich Jedlicka wrote:
> > On Tuesday 14 of April 2009 at 20:48:14, Oldrich Jedlicka wrote:
> > > Here is the fix for using the 32kHz sampling rate for TV and FM radio
> > > (ALSA). The TV uses 32kHz anyway (mode 0; 32kHz demdec on), radio works
> > > only with 32kHz (mode 1; 32kHz baseband). The ALSA wrongly reported 32kHz
> > > and 48kHz for everything (TV, radio, LINE1/2).
> > >
> > > Now it should be possible to just use the card without the need to change
> > > the capture rate from 48kHz to 32kHz. Enjoy :-)
> >
> 
> Hi Mauro,
> 
> I put you on CC in my previous mail, but maybe it would be better to send it 
> directly. So do you have any opinions about the approach described 
> above/below?

I did a look at saa713x datasheet. In thesis, it could be possible to program
the audio sampling rate divider for several rates including 32 kHz, 44.1 kHz
and 48 kHz.

However, I suspect that only MONO is supported with rates different than 32
kHz, since it is said there that AM/FM requires a nominal audio sample of
32 kHz, and that NICAM nominal audio sample rate is 32 kHz.

So, IMO, the right patch is just to allow samplings at 32 kHz



Cheers,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH][RESEND] Use correct sampling rate for TV/FM radio

2009-05-23 Thread Oldrich Jedlicka
On Tuesday 19 of May 2009 at 19:54:18, Oldrich Jedlicka wrote:
> On Tuesday 14 of April 2009 at 20:48:14, Oldrich Jedlicka wrote:
> > Here is the fix for using the 32kHz sampling rate for TV and FM radio
> > (ALSA). The TV uses 32kHz anyway (mode 0; 32kHz demdec on), radio works
> > only with 32kHz (mode 1; 32kHz baseband). The ALSA wrongly reported 32kHz
> > and 48kHz for everything (TV, radio, LINE1/2).
> >
> > Now it should be possible to just use the card without the need to change
> > the capture rate from 48kHz to 32kHz. Enjoy :-)
>

Hi Mauro,

I put you on CC in my previous mail, but maybe it would be better to send it 
directly. So do you have any opinions about the approach described 
above/below?

Thanks!

Cheers,
Oldrich.

> Hi Mauro,
>
> are there some comments for/against this patch? It is rather long time when
> I sent it, so I would like to know some opinions.
>
> The reason behind this patch is that the code uses 32kHz for TV and for
> radio (the radio cannot use other frequency as far as I know). ALSA then
> reports both 32kHz and 48kHz for TV/radio, but 48kHz cannot be used.
>
> Thanks!
>
> Cheers,
> Oldrich.
>
> > Now without word-wrapping.
> >
> > Signed-off-by: Oldřich Jedlička 
> > ---
> > diff -r dba0b6fae413 linux/drivers/media/video/saa7134/saa7134-alsa.c
> > --- a/linux/drivers/media/video/saa7134/saa7134-alsa.c  Thu Apr 09
> > 08:21:42 2009 -0300 +++
> > b/linux/drivers/media/video/saa7134/saa7134-alsa.c  Mon Apr 13 23:07:22
> > 2009 +0200 @@ -465,6 +465,29 @@
> > .periods_max =  1024,
> >  };
> >
> > +static struct snd_pcm_hardware snd_card_saa7134_capture_32kHz_only =
> > +{
> > +   .info = (SNDRV_PCM_INFO_MMAP |
> > SNDRV_PCM_INFO_INTERLEAVED
> >
> > | +  SNDRV_PCM_INFO_BLOCK_TRANSFER |
> >
> > +SNDRV_PCM_INFO_MMAP_VALID),
> > +   .formats =  SNDRV_PCM_FMTBIT_S16_LE | \
> > +   SNDRV_PCM_FMTBIT_S16_BE | \
> > +   SNDRV_PCM_FMTBIT_S8 | \
> > +   SNDRV_PCM_FMTBIT_U8 | \
> > +   SNDRV_PCM_FMTBIT_U16_LE | \
> > +   SNDRV_PCM_FMTBIT_U16_BE,
> > +   .rates =SNDRV_PCM_RATE_32000,
> > +   .rate_min = 32000,
> > +   .rate_max = 32000,
> > +   .channels_min = 1,
> > +   .channels_max = 2,
> > +   .buffer_bytes_max = (256*1024),
> > +   .period_bytes_min = 64,
> > +   .period_bytes_max = (256*1024),
> > +   .periods_min =  4,
> > +   .periods_max =  1024,
> > +};
> > +
> >  static void snd_card_saa7134_runtime_free(struct snd_pcm_runtime
> > *runtime) {
> > snd_card_saa7134_pcm_t *pcm = runtime->private_data;
> > @@ -651,7 +674,13 @@
> > pcm->substream = substream;
> > runtime->private_data = pcm;
> > runtime->private_free = snd_card_saa7134_runtime_free;
> > -   runtime->hw = snd_card_saa7134_capture;
> > +
> > +   if (amux == TV || &card(dev).radio == dev->input) {
> > +   /* TV uses 32kHz sampling, AM/FM radio is locked to 32kHz */
> > +   runtime->hw = snd_card_saa7134_capture_32kHz_only;
> > +   } else {
> > +   runtime->hw = snd_card_saa7134_capture;
> > +   }
> >
> > if (dev->ctl_mute != 0) {
> > saa7134->mute_was_on = 1;
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-media" in
> > the body of a message to majord...@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH][RESEND] Use correct sampling rate for TV/FM radio

2009-05-19 Thread Oldrich Jedlicka
On Tuesday 14 of April 2009 at 20:48:14, Oldrich Jedlicka wrote:
> Here is the fix for using the 32kHz sampling rate for TV and FM radio
> (ALSA). The TV uses 32kHz anyway (mode 0; 32kHz demdec on), radio works
> only with 32kHz (mode 1; 32kHz baseband). The ALSA wrongly reported 32kHz
> and 48kHz for everything (TV, radio, LINE1/2).
>
> Now it should be possible to just use the card without the need to change
> the capture rate from 48kHz to 32kHz. Enjoy :-)
>

Hi Mauro,

are there some comments for/against this patch? It is rather long time when I 
sent it, so I would like to know some opinions.

The reason behind this patch is that the code uses 32kHz for TV and for radio 
(the radio cannot use other frequency as far as I know). ALSA then reports 
both 32kHz and 48kHz for TV/radio, but 48kHz cannot be used.

Thanks!

Cheers,
Oldrich.

> Now without word-wrapping.
>
> Signed-off-by: Oldřich Jedlička 
> ---
> diff -r dba0b6fae413 linux/drivers/media/video/saa7134/saa7134-alsa.c
> --- a/linux/drivers/media/video/saa7134/saa7134-alsa.cThu Apr 09 
> 08:21:42
> 2009 -0300 +++ b/linux/drivers/media/video/saa7134/saa7134-alsa.c Mon Apr
> 13 23:07:22 2009 +0200 @@ -465,6 +465,29 @@
>   .periods_max =  1024,
>  };
>
> +static struct snd_pcm_hardware snd_card_saa7134_capture_32kHz_only =
> +{
> + .info = (SNDRV_PCM_INFO_MMAP | 
> SNDRV_PCM_INFO_INTERLEAVED
> | +SNDRV_PCM_INFO_BLOCK_TRANSFER |
> +  SNDRV_PCM_INFO_MMAP_VALID),
> + .formats =  SNDRV_PCM_FMTBIT_S16_LE | \
> + SNDRV_PCM_FMTBIT_S16_BE | \
> + SNDRV_PCM_FMTBIT_S8 | \
> + SNDRV_PCM_FMTBIT_U8 | \
> + SNDRV_PCM_FMTBIT_U16_LE | \
> + SNDRV_PCM_FMTBIT_U16_BE,
> + .rates =SNDRV_PCM_RATE_32000,
> + .rate_min = 32000,
> + .rate_max = 32000,
> + .channels_min = 1,
> + .channels_max = 2,
> + .buffer_bytes_max = (256*1024),
> + .period_bytes_min = 64,
> + .period_bytes_max = (256*1024),
> + .periods_min =  4,
> + .periods_max =  1024,
> +};
> +
>  static void snd_card_saa7134_runtime_free(struct snd_pcm_runtime *runtime)
>  {
>   snd_card_saa7134_pcm_t *pcm = runtime->private_data;
> @@ -651,7 +674,13 @@
>   pcm->substream = substream;
>   runtime->private_data = pcm;
>   runtime->private_free = snd_card_saa7134_runtime_free;
> - runtime->hw = snd_card_saa7134_capture;
> +
> + if (amux == TV || &card(dev).radio == dev->input) {
> + /* TV uses 32kHz sampling, AM/FM radio is locked to 32kHz */
> + runtime->hw = snd_card_saa7134_capture_32kHz_only;
> + } else {
> + runtime->hw = snd_card_saa7134_capture;
> + }
>
>   if (dev->ctl_mute != 0) {
>   saa7134->mute_was_on = 1;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html