Hello Valece,
without the "audio" line in config.txt only a rudimentary DAC-only very simple audio driver is used.
If you have the audio driver already loaded by writing "audio" in config.txt, then you should be set, and I2S and SPDIF outputs should automatically be set on. Still, check that you have the audio driver SYS/AUDIO.DL3 in your VSOS system drive. Please have a look at that you don't get errors from the serial port debug output when you start the board.
To make absolutely sure, you could add the following code to the beginning of your main() function:
Code: Select all
u_int16 *audioLib = NULL;
[...]
if (!(audioLib = LoadLibrary("audio"))) {
printf("Couldn't open AUDIO library\n");
result = S_ERROR;
goto finally;
}
[... add this to finally ...]
finally:
if (audioLib) {
DropLibrary(audioLib);
audioLib = NULL;
}
After this, you should remove the following code, because the audio driver automatically activates both I2S and SPDIF outputs.
Code: Select all
/* You can remove code beginning here */
GpioSetAsPeripheral(0x1b);
GpioSetAsPeripheral(0x1c);
GpioSetAsPeripheral(0x1d);
GpioSetAsPeripheral(0x1e);
PERIP(I2S_CF) = I2S_CF_ENA | I2S_CF_MASTER | I2S_CF_ENAMCK | I2S_CF_32B | I2S_CF_FS;
ior = ioctl(fp, IOCTL_AUDIO_SET_OUTPUTS,(void *)(AOR_DAC | AOR_I2S | AOR_SPDIF ));
/* You can remove code ending here */
We don't yet support I2S input, so that is why your ioctl() for IOCTL_AUDIO_SELECT_INPUT fails. If that is a necessity for your project, let us know, and we'll move it up our audio driver implementation queue.
For a list of what is already supported and what isn't, have a look at
http://www.vlsi.fi/en/support/software/ ... tatus.html
Kind regards,
- Henrik
Good signatures never die. They just fade away.