helpThe OpenVortex Project - Support: sr #103015, SPDIF

 
 

sr #103015: SPDIF

Submitter:  None
Submitted:  Sat 17 Apr 2004 05:46:18 AM UTC
 
Category:  None Priority:  5 - Normal
Severity:  6 - Security Status:  None
Privacy:  Public Assigned to:  None
Originator Email:  -email is unavailable- Open/Closed:  Open
Operating System:  None
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       

 

( Jump to the original submission )

Sun 23 Oct 2005 09:41:54 AM UTC, comment #15: 

FourCC Company name         Description                 Registration date
0x0240 WAVE_FORMAT_RAW_SPORT Aureal Semiconductor Inc. Not specified

http://msdn.microsoft.com/library/en-us/dnwmt/html/registeredfourcccodesandwaveformats.asp?frame=true

Anonymous
Thu 17 Jun 2004 02:40:16 PM UTC, comment #14: 

Which mmio is iec958

VORTEX_SPDIF_FLAGS
or
VORTEX_SPDIF_CFG0, VORTEX_SPDIF_CFG1

static void vortex_spdif_init(vortex_t * vortex, int spdif_sr, int spdif_mode)
{
int i, this_38 = 0, this_04 = 0, this_08 = 0, this_0c = 0;

/* CAsp4Spdif::InitializeSpdifHardware(void) */
hwwrite(vortex->mmio, VORTEX_SPDIF_FLAGS,
hwread(vortex->mmio, VORTEX_SPDIF_FLAGS) & 0xfff3fffd);
for (i=0x291D4; i<0x29200; i+=4)
for (i = 0; i < 11; i++)
hwwrite(vortex->mmio, VORTEX_SPDIF_CFG1 + (i << 2), 0);
hwwrite(vortex->mmio, 0x29190, hwread(vortex->mmio, 0x29190) | 0xc0000);
hwwrite(vortex->mmio, VORTEX_CODEC_EN,
hwread(vortex->mmio, VORTEX_CODEC_EN) | EN_SPDIF);

/* CAsp4Spdif::ProgramSRCInHardware(enum  SPDIF_SR,enum  SPDIFMODE) */
if (this_04 && this_08) {
int edi;

i = (((0x5DC00000 / spdif_sr) + 1) >> 1);
if (i > 0x800) {
if (i < 0x1ffff)
edi = (i >> 1);
else
edi = 0x1ffff;
} else {
i = edi = 0x800;
}
/* this_04 and this_08 are the CASp4Src's (samplerate converters) */
vortex_src_setupchannel(vortex, this_04, edi, 0, 1,
this_0c, 1, 0, edi, 1);
vortex_src_setupchannel(vortex, this_08, edi, 0, 1,
this_0c, 1, 0, edi, 1);
}

i = spdif_sr;
spdif_sr |= 0x8c;
switch (i) {
case 32000:
this_38 &= 0xFFFFFFFE;
this_38 &= 0xFFFFFFFD;
this_38 &= 0xF3FFFFFF;
this_38 |= 0x03000000; /* set 32khz samplerate */
this_38 &= 0xFFFFFF3F;
spdif_sr &= 0xFFFFFFFD;
spdif_sr |= 1;
break;
case 44100:
this_38 &= 0xFFFFFFFE;
this_38 &= 0xFFFFFFFD;
this_38 &= 0xF0FFFFFF;
this_38 |= 0x03000000;
this_38 &= 0xFFFFFF3F;
spdif_sr &= 0xFFFFFFFC;
break;
case 48000:
if (spdif_mode == 1) {
this_38 &= 0xFFFFFFFE;
this_38 &= 0xFFFFFFFD;
this_38 &= 0xF2FFFFFF;
this_38 |= 0x02000000; /* set 48khz samplerate */
this_38 &= 0xFFFFFF3F;
} else {
/* J. Gordon Wolfe: I think this stuff is for AC3 */
this_38 |= 0x00000003;
this_38 &= 0xFFFFFFBF;
this_38 |= 0x80;
}
spdif_sr |= 2;
spdif_sr &= 0xFFFFFFFE;
break;

}
/* looks like the next 2 lines transfer a 16-bit value into 2 8-bit
   registers. seems to be for the standard IEC/SPDIF initialization
   stuff */
hwwrite(vortex->mmio, VORTEX_SPDIF_CFG0, this_38 & 0xffff);
hwwrite(vortex->mmio, VORTEX_SPDIF_CFG1, this_38 >> 0x10);
hwwrite(vortex->mmio, VORTEX_SPDIF_SMPRATE, spdif_sr);
}

Anonymous
Thu 17 Jun 2004 03:10:48 AM UTC, comment #13: 
Anonymous
Thu 10 Jun 2004 05:55:46 PM UTC, comment #12: 
Anonymous
Thu 10 Jun 2004 08:31:14 AM UTC, comment #11: 

#define IEC958_AES0_NONAUDIO   (1<<1)    0 = audio, 1 = non-audio

#define IEC958_AES0_PROFESSIONAL   (1<<0) 0 = consumer, 1 = professional

#define IEC958_AES0_PRO_FS_NOTID   (0<<6)
#define IEC958_AES0_PRO_FS_44100   (1<<6)
#define IEC958_AES0_PRO_FS_48000   (2<<6)
#define IEC958_AES0_PRO_FS_32000   (3<<6)

 this_38 |= 0x00000003;
 this_38 &= 0xFFFFFFBF;        <-- 0xFFFFFF3F
 this_38 |= 0x80;              // #define IEC958_AES0_PRO_FS_48000   (2<<6)

Anonymous
Thu 10 Jun 2004 08:21:11 AM UTC, comment #10: 

If it is IEC958

 #define IEC958_AES3_CON_FS (15<<0) mask - sample frequency

 #define IEC958_AES3_CON_FS_32000   (3<<0)
 #define IEC958_AES3_CON_FS_44100   (0<<0)
 #define IEC958_AES3_CON_FS_48000   (2<<0)

the correct code should be

case 32000:
 this_38 &= 0xF0FFFFFF;
 this_38 |= 0x03000000;

case 44100:
 this_38 &= 0xF0FFFFFF;

case 48000:
 this_38 &= 0xF0FFFFFF;
 this_38 |= 0x02000000; 

Anonymous
Thu 10 Jun 2004 08:16:27 AM UTC, comment #9: 

The only difference is the sample rate at 44100

 case 44100:
 this_38 &= 0xF0FFFFFF; // #define IEC958_AES3_CON_FS_44100 (0<<0)
this_38 |= 0x03000000; <---- is this value correct ???

Anonymous
Thu 10 Jun 2004 08:12:09 AM UTC, comment #8: 

 this_38 &= 0xF3FFFFFF;
 this_38 &= 0xF2FFFFFF; 
 this_38 &= 0xF0FFFFFF;

 #define IEC958_AES3_CON_FS   (15<<0)  mask - sample frequency

Anonymous
Thu 10 Jun 2004 08:07:16 AM UTC, comment #7: 

i = spdif_sr;
spdif_sr |= 0x8c;
switch (i) {
case 32000:
this_38 &= 0xFFFFFFFE;   // #define IEC958_AES0_PROFESSIONAL   (1<<0)     0 = consumer, 1 = professional
this_38 &= 0xFFFFFFFD;   //  #define IEC958_AES0_NONAUDIO   (1<<1)         0 = audio, 1 = non-audio
this_38 &= 0xF3FFFFFF;  ???
this_38 |= 0x03000000; // #define IEC958_AES3_CON_FS_32000   (3<<0)
this_38 &= 0xFFFFFF3F;  //  #define IEC958_AES0_CON_MODE   (3<<6) mask - mode
spdif_sr &= 0xFFFFFFFD;
spdif_sr |= 1;
break;
case 44100:
this_38 &= 0xFFFFFFFE;
this_38 &= 0xFFFFFFFD;
this_38 &= 0xF0FFFFFF;  // #define IEC958_AES3_CON_FS_44100   (0<<0)
this_38 |= 0x03000000;  ???
this_38 &= 0xFFFFFF3F;
spdif_sr &= 0xFFFFFFFC;
break;
case 48000:
if (spdif_mode == 1) {
this_38 &= 0xFFFFFFFE;
this_38 &= 0xFFFFFFFD;
this_38 &= 0xF2FFFFFF;   ???
this_38 |= 0x02000000; // #define IEC958_AES3_CON_FS_48000   (2<<0)
this_38 &= 0xFFFFFF3F;
} else {
/* J. Gordon Wolfe: I think this stuff is for AC3 */
this_38 |= 0x00000003;
this_38 &= 0xFFFFFFBF;
this_38 |= 0x80;
}
spdif_sr |= 2;
spdif_sr &= 0xFFFFFFFE;
break;

}
/* looks like the next 2 lines transfer a 16-bit value into 2 8-bit
   registers. seems to be for the standard IEC/SPDIF initialization
   stuff */
hwwrite(vortex->mmio, VORTEX_SPDIF_CFG0, this_38 & 0xffff);
hwwrite(vortex->mmio, VORTEX_SPDIF_CFG1, this_38 >> 0x10);
hwwrite(vortex->mmio, VORTEX_SPDIF_SMPRATE, spdif_sr);

Anonymous
Thu 10 Jun 2004 05:39:53 AM UTC, comment #6: 
Anonymous
Fri 21 May 2004 04:00:57 AM UTC, comment #5: 

Why do au88x0 do not have IEC958 when it support SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE ?

http://cvs.sourceforge.net/viewcvs.py/*checkout*/alsa/alsa-kernel/pci/au88x0/au88x0_pcm.c?rev=1.3

static snd_pcm_hardware_t snd_vortex_playback_hw_spdif = {
.info =
    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_RESUME |
     SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_INTERLEAVED |
     SNDRV_PCM_INFO_MMAP_VALID),
.formats =
    SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U8 |
    SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE | SNDRV_PCM_FMTBIT_MU_LAW |
    SNDRV_PCM_FMTBIT_A_LAW,

Anonymous
Fri 30 Apr 2004 03:28:44 PM UTC, comment #4: 

AES0=0x2
         IEC958_AES0_PROFESSIONAL   (1<<0)
       IEC958_AES0_NONAUDIO   (1<<1)
AES1=0x82
  IEC958_AES1_CON_DIGDIGCONV_ID   0x02
  IEC958_AES1_CON_ORIGINAL (1<<7)
AES2=0x0

AES3=0x2
  IEC958_AES3_CON_FS_44100   (0<<0)
  IEC958_AES3_CON_FS_48000   (2<<0)
  IEC958_AES3_CON_FS_32000   (3<<0)

Consumer IEC958 at 48000 Hz for AC3 pass through SPDIF.

Anonymous
Mon 19 Apr 2004 05:40:15 PM UTC, comment #3: 
Anonymous
Mon 19 Apr 2004 08:20:48 AM UTC, comment #2: 

By logging the callback functions in ac97_codec.c during /etc/init.d/alsasound.start , playing AC3 pass=through onboard SPDIF (AC97 2.2) and /etc/init.d/alsasound.stop

snd_ac97_spdif_default_put()
snd_ac97_spdif_default_get()
snd_ac97_put_spsa()
snd_ac97_spdif_cmask_get()
snd_ac97_spdif_pmask_get()

We will need to implement the above callback functions for a new spdif control SNDRV_CTL_ELEM_TYPE_IEC958 in au8830 driver if au8830 support AC3 pass-through.

Anonymous
Sun 18 Apr 2004 12:56:41 PM UTC, comment #1: 

It seem that it search for ctl_type SNDRV_CTL_ELEM_TYPE_IEC958 when using AC3 pass-through.

http://cvs.sourceforge.net/viewcvs.py/*checkout*/alsa/alsa-kernel/pci/au88x0/au88x0_pcm.c?content-type=text%2Fplain&rev=1.3

/* SPDIF kcontrol */
static int
snd_vortex_spdif_info(snd_kcontrol_t * kcontrol, snd_ctl_elem_info_t * uinfo)
{
static char *texts[] = { "32000", "44100", "48000" };

uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;

Anonymous
Sat 17 Apr 2004 05:46:18 AM UTC, original submission:  

mplayer -ao alsa9:hw:0,0 -ac hwac3   

same error with different option
-ao alsa9:hw:0,1
-ao alsa9:hw:0,2
-ao alsa9:hw:0,3

Forced audio codec: hwac3
Opening audio decoder: [hwac3] AC3/DTS pass-through SP/DIF
No accelerated IMDCT transform found
hwac3: switched to AC3, 448000 bps, 48000 Hz
AUDIO: 48000 Hz, 2 ch, 16 bit (0x400), ratio: 56000->192000 (448.0 kbit)
Selected audio codec: [hwac3] afm:hwac3 (AC3 through SPDIF)

Checking audio filter chain for 48000Hz/2ch/16bit -> 48000Hz/2ch/16bit...
AF_pre: af format: 2 bps, 2 ch, 48000 hz, big endian AC3
AF_pre: 48000Hz 2ch AC3
alsa-init: requested format: 48000 Hz, 2 channels, AC3
alsa-init: soundcard set to iec958:AES0=0x2,AES1=0x82,AES2=0x0,AES3=0x2

snd_config_search_alias_hooks : err=0 key=iec958 base=pcm
snd_config_search err : -2

ALSA lib conf.c:2671:(snd_config_hooks_call) function snd_config_hook_load_for_all_cards returned error: Invalid argument
ALSA lib pcm.c:1841:(snd_pcm_open_conf) Invalid type for PCM iec958:AES0=0x2,AES1=0x82,AES2=0x0,AES3=0x2 definition (id: iec958, value: cards.pcm.iec958)
alsa-init: playback open error: Invalid argument
Could not open/initialize audio device -> no sound.
Audio: no sound

It's not mplayer bugs, using mplayer with snd-intel8x0 with ac97 v2.2 codec

Forced audio codec: hwac3
Opening audio decoder: [hwac3] AC3/DTS pass-through SP/DIF
No accelerated IMDCT transform found
hwac3: switched to AC3, 448000 bps, 48000 Hz
AUDIO: 48000 Hz, 2 ch, 16 bit (0x400), ratio: 56000->192000 (448.0 kbit)
Selected audio codec: [hwac3] afm:hwac3 (AC3 through SPDIF)

Checking audio filter chain for 48000Hz/2ch/16bit -> 48000Hz/2ch/16bit...
AF_pre: af format: 2 bps, 2 ch, 48000 hz, big endian AC3
AF_pre: 48000Hz 2ch AC3
alsa-init: requested format: 48000 Hz, 2 channels, AC3
alsa-init: soundcard set to iec958:AES0=0x2,AES1=0x82,AES2=0x0,AES3=0x2
alsa9: 48000 Hz/2 channels/4 bpf/65536 bytes buffer/Signed 16 bit Little Endian
AO: [alsa9] 48000Hz 2ch AC3 (2 bps)
Building audio filter chain for 48000Hz/2ch/16bit -> 48000Hz/2ch/16bit...

Is it related to conf files ?

/usr/share/alsa/alsa.conf
/usr/share/alsa/cards/AU8830.conf
/usr/share/alsa/pcm/ice958.conf

or

SPDIF is defined in AC 97 v2.2 but au8830 with AC97 v2.1 codec

http://www.intel.com/labs/media/audio/

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

 

 

 

No changes have been made to this item

Back to the top

Powered by Savane 3.10