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);
}
|
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);
|
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/
|