All of lore.kernel.org
 help / color / mirror / Atom feed
* Last set of diffs for vt1617, etc.
@ 2005-08-13 21:22 Philip Prindeville
  2005-08-15 12:45 ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Philip Prindeville @ 2005-08-13 21:22 UTC (permalink / raw)
  To: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 869 bytes --]

Ok, so these are the changes for the changed PCI id
for the K8MM-V motherboard and the VT1617A codec.

I still get the warnings, however, about the device not being
able to accept 44.1kHz audio and having to send it at 48kHz
instead.  I suspect that this is a configuration file issue instead.

I tried forcing the patch_vt1617a() routing to set:

    ac97->rates[AC97_RATES_SPDIF] = SNDRV_PCM_RATE_44100;

and it still complained about:

[root@media ~]# aplay -v  -Dhw:0,0 
/usr/share/system-config-soundcard/sound-sample.wav
Playing WAVE '/usr/share/system-config-soundcard/sound-sample.wav' : 
Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
Warning: rate is not accurate (requested = 44100Hz, got = 48000Hz)
        please, try the plug plugin (-Dplug:hw:0,0)
Hardware PCM card 0 'VIA 8237' device 0 subdevice 0

so that might be an orthogonal issue.

-Philip



[-- Attachment #2: vt1617.patch --]
[-- Type: text/x-patch, Size: 3307 bytes --]

*** alsa-kernel/pci/via82xx.c.bak	2005-05-27 04:10:18.000000000 -0600
--- alsa-kernel/pci/via82xx.c	2005-08-12 13:50:42.000000000 -0600
***************
*** 932,943 ****
  
  	if ((rate_changed = via_lock_rate(&chip->rates[0], ac97_rate)) < 0)
  		return rate_changed;
! 	if (rate_changed) {
  		snd_ac97_set_rate(chip->ac97, AC97_PCM_FRONT_DAC_RATE,
  				  chip->no_vra ? 48000 : runtime->rate);
! 		snd_ac97_set_rate(chip->ac97, AC97_SPDIF,
! 				  chip->no_vra ? 48000 : runtime->rate);
! 	}
  	if (runtime->rate == 48000)
  		rbits = 0xfffff;
  	else
--- 932,943 ----
  
  	if ((rate_changed = via_lock_rate(&chip->rates[0], ac97_rate)) < 0)
  		return rate_changed;
! 	if (rate_changed)
  		snd_ac97_set_rate(chip->ac97, AC97_PCM_FRONT_DAC_RATE,
  				  chip->no_vra ? 48000 : runtime->rate);
!         if (chip->spdif_on && viadev->reg_offset == 0x30)
! 		snd_ac97_set_rate(chip->ac97, AC97_SPDIF, runtime->rate);
! 
  	if (runtime->rate == 48000)
  		rbits = 0xfffff;
  	else
***************
*** 2170,2175 ****
--- 2170,2176 ----
  		{ .vendor = 0x1297, .device = 0xc160, .action = VIA_DXS_ENABLE }, /* Shuttle SK41G */
  		{ .vendor = 0x1458, .device = 0xa002, .action = VIA_DXS_ENABLE }, /* Gigabyte GA-7VAXP */
  		{ .vendor = 0x1462, .device = 0x0080, .action = VIA_DXS_SRC }, /* MSI K8T Neo-FIS2R */
+ 		{ .vendor = 0x1462, .device = 0x0430, .action = VIA_DXS_SRC },    /* MSI K8MM-V onboard audio */
  		{ .vendor = 0x1462, .device = 0x3800, .action = VIA_DXS_ENABLE }, /* MSI KT266 */
  		{ .vendor = 0x1462, .device = 0x5901, .action = VIA_DXS_NO_VRA }, /* MSI KT6 Delta-SR */
  		{ .vendor = 0x1462, .device = 0x7023, .action = VIA_DXS_NO_VRA }, /* MSI K8T Neo2-FI */
*** alsa-kernel/pci/ac97/ac97_codec.c.bak	2005-04-25 04:22:20.000000000 -0600
--- alsa-kernel/pci/ac97/ac97_codec.c	2005-08-11 12:56:59.000000000 -0600
***************
*** 157,162 ****
--- 157,163 ----
  { 0x54524123, 0xffffffff, "TR28602",		NULL,		NULL }, // only guess --jk [TR28023 = eMicro EM28023 (new CT1297)]
  { 0x54584e20, 0xffffffff, "TLC320AD9xC",	NULL,		NULL },
  { 0x56494161, 0xffffffff, "VIA1612A",		NULL,		NULL }, // modified ICE1232 with S/PDIF
+ { 0x56494170, 0xffffffff, "VIA1617A",		patch_vt1617a,	NULL }, // modified VT1616 with S/PDIF
  { 0x57454301, 0xffffffff, "W83971D",		NULL,		NULL },
  { 0x574d4c00, 0xffffffff, "WM9701A",		NULL,		NULL },
  { 0x574d4C03, 0xffffffff, "WM9703,WM9707,WM9708,WM9717", patch_wolfson03, NULL},
*** alsa-kernel/pci/ac97/ac97_patch.c.bak	2005-05-27 03:42:45.000000000 -0600
--- alsa-kernel/pci/ac97/ac97_patch.c	2005-08-12 17:45:05.000000000 -0600
***************
*** 558,563 ****
--- 558,572 ----
  }
  
  /*
+  * VT1617A codec
+  */
+ int patch_vt1617a(ac97_t * ac97)
+ {
+ 	ac97->ext_id |= AC97_EI_SPDIF;	/* force the detection of spdif */
+ 	return 0;
+ }
+ 
+ /*
   * Sigmatel STAC97xx codecs
   */
  static int patch_sigmatel_stac9700_3d(ac97_t * ac97)
*** alsa-kernel/pci/ac97/ac97_patch.h.bak	2005-04-07 08:53:20.000000000 -0600
--- alsa-kernel/pci/ac97/ac97_patch.h	2005-08-11 12:56:59.000000000 -0600
***************
*** 56,60 ****
--- 56,61 ----
  int patch_cm9761(ac97_t * ac97);
  int patch_cm9780(ac97_t * ac97);
  int patch_vt1616(ac97_t * ac97);
+ int patch_vt1617a(ac97_t * ac97);
  int patch_it2646(ac97_t * ac97);
  int mpatch_si3036(ac97_t * ac97);

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Last set of diffs for vt1617, etc.
  2005-08-13 21:22 Last set of diffs for vt1617, etc Philip Prindeville
@ 2005-08-15 12:45 ` Takashi Iwai
       [not found]   ` <4300E835.5000608@redfish-solutions.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2005-08-15 12:45 UTC (permalink / raw)
  To: Philip Prindeville; +Cc: alsa-devel

At Sat, 13 Aug 2005 15:22:35 -0600,
Philip Prindeville wrote:
> 
> Ok, so these are the changes for the changed PCI id
> for the K8MM-V motherboard and the VT1617A codec.
> 
> I still get the warnings, however, about the device not being
> able to accept 44.1kHz audio and having to send it at 48kHz
> instead.  I suspect that this is a configuration file issue instead.
> 
> I tried forcing the patch_vt1617a() routing to set:
> 
>     ac97->rates[AC97_RATES_SPDIF] = SNDRV_PCM_RATE_44100;
> 
> and it still complained about:

The rates for SPDIF are detected in snd_ac97_determine_spdif_rates()
regarless what you write in that part of patch.
It means that the codec really unlikely supports non-48k Hz for
SPDIF, or a bug in snd_ac97_determine_spdif_rates() function.

Most of your patches are already in CVS.  Please update your CVS tree
and make a unified diff (-u) as a patch, togeter with signed-off-by
line.


thanks,

Takashi


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Last set of diffs for vt1617, etc.
       [not found]   ` <4300E835.5000608@redfish-solutions.com>
@ 2005-08-16 10:09     ` Takashi Iwai
  2005-08-18  0:06       ` Philip Prindeville
  0 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2005-08-16 10:09 UTC (permalink / raw)
  To: Philip Prindeville; +Cc: alsa-devel

At Mon, 15 Aug 2005 13:08:37 -0600,
Philip Prindeville wrote:
> 
> Even though I've run "aclocal" and "autoconf" previously.  It seems it needs
> to be run every time???

No, once you update the tree and run cvscompile, you need to run only
make after that.

>  And the version of /usr/share/gettext/gettext.h on
> FC3 isn't compatible with alsa-utils/include/gettext.h because the N_ macro
> isn't defined.

It's not that package.  Did you install gettext-devel.rpm?

> Not sure what the first paragraph is about.
> 
> So I've tried all of this, with the diffs attached, and I still have 
> problems
> playing 44.1kHz sound.
> 
> The next question is, how do we go about figuring out if the codec doesn't
> like 44.1kHz, or if there really is a bug in 
> snd_ac97_determine_spdif_rates()?

Needs a datasheet.

As a test, you can add the line to force to reset the SPDIF_RATES
value after the line calling snd_ac97_determine_spdif_rates(), and try
aplay again.


> Thanks,
> 
> -Philip
> 
> P.S. I've turned off "oss" in the diffs just because I'm trying to 
> isolate ALSA.

Use "cvs diff".  Also, use -u option to get the unified diff style.


Takashi


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Last set of diffs for vt1617, etc.
  2005-08-16 10:09     ` Takashi Iwai
@ 2005-08-18  0:06       ` Philip Prindeville
  2005-08-18  9:43         ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Philip Prindeville @ 2005-08-18  0:06 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

Takashi Iwai wrote:

>At Mon, 15 Aug 2005 13:08:37 -0600,
>Philip Prindeville wrote:
>  
>
>>Even though I've run "aclocal" and "autoconf" previously.  It seems it needs
>>to be run every time???
>>    
>>
>
>No, once you update the tree and run cvscompile, you need to run only
>make after that.
>
>  
>
>> And the version of /usr/share/gettext/gettext.h on
>>FC3 isn't compatible with alsa-utils/include/gettext.h because the N_ macro
>>isn't defined.
>>    
>>
>
>It's not that package.  Did you install gettext-devel.rpm?
>
>  
>
>>Not sure what the first paragraph is about.
>>
>>So I've tried all of this, with the diffs attached, and I still have 
>>problems
>>playing 44.1kHz sound.
>>
>>The next question is, how do we go about figuring out if the codec doesn't
>>like 44.1kHz, or if there really is a bug in 
>>snd_ac97_determine_spdif_rates()?
>>    
>>
>
>Needs a datasheet.
>
>As a test, you can add the line to force to reset the SPDIF_RATES
>value after the line calling snd_ac97_determine_spdif_rates(), and try
>aplay again.
>
>
>  
>
>>Thanks,
>>
>>-Philip
>>
>>P.S. I've turned off "oss" in the diffs just because I'm trying to 
>>isolate ALSA.
>>    
>>
>
>Use "cvs diff".  Also, use -u option to get the unified diff style.
>
>
>Takashi
>  
>

I applied the following "patch":

[root@media alsa]# diff -u alsa-driver/pci/ac97/ac97_codec.c.bak 
alsa-driver/pci/ac97/ac97_codec.c
--- alsa-driver/pci/ac97/ac97_codec.c.bak       2005-08-15 
10:27:41.000000000 -0600
+++ alsa-driver/pci/ac97/ac97_codec.c   2005-08-17 17:57:01.000000000 -0600
@@ -1521,6 +1521,8 @@
                        /* consumer,PCM audio,no copyright,no 
preemphasis,PCM coder,original,48000Hz */
                        snd_ac97_write_cache(ac97, AC97_SPDIF, 0x2a20);
                        ac97->rates[AC97_RATES_SPDIF] = 
snd_ac97_determine_spdif_rates(ac97);
+// tweak...
+ac97->rates[AC97_RATES_SPDIF] = SNDRV_PCM_RATE_44100;
                }
                ac97->spdif_status = SNDRV_PCM_DEFAULT_CON_SPDIF;
        }
[root@media alsa]#

and when I ran "aplay", this is what I got:

[root@media alsa]# aplay -v -D spdif 
/usr/share/system-config-soundcard/sound-sample.wav
Playing WAVE '/usr/share/system-config-soundcard/sound-sample.wav' : 
Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
Hooks PCM
Its setup is:
stream       : PLAYBACK
access       : RW_INTERLEAVED
format       : S16_LE
subformat    : STD
channels     : 2
rate         : 44100
exact rate   : 44100 (44100/1)
msbits       : 16
buffer_size  : 16384
period_size  : 4096
period_time  : 92879
tick_time    : 1000
tstamp_mode  : NONE
period_step  : 1
sleep_min    : 0
avail_min    : 4096
xfer_align   : 4096
start_threshold  : 16384
stop_threshold   : 16384
silence_threshold: 0
silence_size : 0
boundary     : 4611686018427387904
Slave: Hardware PCM card 0 'VIA 8237' device 0 subdevice 3

Its setup is:
stream       : PLAYBACK
access       : RW_INTERLEAVED
format       : S16_LE
subformat    : STD
channels     : 2
rate         : 44100
exact rate   : 44100 (44100/1)
msbits       : 16
buffer_size  : 16384
period_size  : 4096
period_time  : 92879
tick_time    : 1000
tstamp_mode  : NONE
period_step  : 1
sleep_min    : 0
avail_min    : 4096
xfer_align   : 4096
start_threshold  : 16384
stop_threshold   : 16384
silence_threshold: 0
silence_size : 0
boundary     : 4611686018427387904
[root@media alsa]#

However my receiver says "PCM [48kHz]" in the LED display.

I'm wondering if there might be other things that need to be changed
as well...  Config files?

-Philip



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Last set of diffs for vt1617, etc.
  2005-08-18  0:06       ` Philip Prindeville
@ 2005-08-18  9:43         ` Takashi Iwai
  0 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2005-08-18  9:43 UTC (permalink / raw)
  To: Philip Prindeville; +Cc: alsa-devel

At Wed, 17 Aug 2005 18:06:58 -0600,
Philip Prindeville wrote:
> 
> Takashi Iwai wrote:
> 
> >At Mon, 15 Aug 2005 13:08:37 -0600,
> >Philip Prindeville wrote:
> >  
> >
> >>Even though I've run "aclocal" and "autoconf" previously.  It seems it needs
> >>to be run every time???
> >>    
> >>
> >
> >No, once you update the tree and run cvscompile, you need to run only
> >make after that.
> >
> >  
> >
> >> And the version of /usr/share/gettext/gettext.h on
> >>FC3 isn't compatible with alsa-utils/include/gettext.h because the N_ macro
> >>isn't defined.
> >>    
> >>
> >
> >It's not that package.  Did you install gettext-devel.rpm?
> >
> >  
> >
> >>Not sure what the first paragraph is about.
> >>
> >>So I've tried all of this, with the diffs attached, and I still have 
> >>problems
> >>playing 44.1kHz sound.
> >>
> >>The next question is, how do we go about figuring out if the codec doesn't
> >>like 44.1kHz, or if there really is a bug in 
> >>snd_ac97_determine_spdif_rates()?
> >>    
> >>
> >
> >Needs a datasheet.
> >
> >As a test, you can add the line to force to reset the SPDIF_RATES
> >value after the line calling snd_ac97_determine_spdif_rates(), and try
> >aplay again.
> >
> >
> >  
> >
> >>Thanks,
> >>
> >>-Philip
> >>
> >>P.S. I've turned off "oss" in the diffs just because I'm trying to 
> >>isolate ALSA.
> >>    
> >>
> >
> >Use "cvs diff".  Also, use -u option to get the unified diff style.
> >
> >
> >Takashi
> >  
> >
> 
> I applied the following "patch":
> 
> [root@media alsa]# diff -u alsa-driver/pci/ac97/ac97_codec.c.bak 
> alsa-driver/pci/ac97/ac97_codec.c
> --- alsa-driver/pci/ac97/ac97_codec.c.bak       2005-08-15 
> 10:27:41.000000000 -0600
> +++ alsa-driver/pci/ac97/ac97_codec.c   2005-08-17 17:57:01.000000000 -0600
> @@ -1521,6 +1521,8 @@
>                         /* consumer,PCM audio,no copyright,no 
> preemphasis,PCM coder,original,48000Hz */
>                         snd_ac97_write_cache(ac97, AC97_SPDIF, 0x2a20);
>                         ac97->rates[AC97_RATES_SPDIF] = 
> snd_ac97_determine_spdif_rates(ac97);
> +// tweak...
> +ac97->rates[AC97_RATES_SPDIF] = SNDRV_PCM_RATE_44100;
>                 }
>                 ac97->spdif_status = SNDRV_PCM_DEFAULT_CON_SPDIF;
>         }
> [root@media alsa]#
> 
> and when I ran "aplay", this is what I got:
> 
> [root@media alsa]# aplay -v -D spdif 
> /usr/share/system-config-soundcard/sound-sample.wav
> Playing WAVE '/usr/share/system-config-soundcard/sound-sample.wav' : 
> Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
> Hooks PCM
> Its setup is:
> stream       : PLAYBACK
> access       : RW_INTERLEAVED
> format       : S16_LE
> subformat    : STD
> channels     : 2
> rate         : 44100
> exact rate   : 44100 (44100/1)
> msbits       : 16
> buffer_size  : 16384
> period_size  : 4096
> period_time  : 92879
> tick_time    : 1000
> tstamp_mode  : NONE
> period_step  : 1
> sleep_min    : 0
> avail_min    : 4096
> xfer_align   : 4096
> start_threshold  : 16384
> stop_threshold   : 16384
> silence_threshold: 0
> silence_size : 0
> boundary     : 4611686018427387904
> Slave: Hardware PCM card 0 'VIA 8237' device 0 subdevice 3
> 
> Its setup is:
> stream       : PLAYBACK
> access       : RW_INTERLEAVED
> format       : S16_LE
> subformat    : STD
> channels     : 2
> rate         : 44100
> exact rate   : 44100 (44100/1)
> msbits       : 16
> buffer_size  : 16384
> period_size  : 4096
> period_time  : 92879
> tick_time    : 1000
> tstamp_mode  : NONE
> period_step  : 1
> sleep_min    : 0
> avail_min    : 4096
> xfer_align   : 4096
> start_threshold  : 16384
> stop_threshold   : 16384
> silence_threshold: 0
> silence_size : 0
> boundary     : 4611686018427387904
> [root@media alsa]#
> 
> However my receiver says "PCM [48kHz]" in the LED display.
> 
> I'm wondering if there might be other things that need to be changed
> as well...  Config files?

No, I think the codec simply doesn't support non-48k...


Takashi


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-08-18  9:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-13 21:22 Last set of diffs for vt1617, etc Philip Prindeville
2005-08-15 12:45 ` Takashi Iwai
     [not found]   ` <4300E835.5000608@redfish-solutions.com>
2005-08-16 10:09     ` Takashi Iwai
2005-08-18  0:06       ` Philip Prindeville
2005-08-18  9:43         ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.