[alsa-devel] M-Audio Audiophile 192 (ice1724)'s broken spdif capture

Pavel Hofman pavel.hofman at ivitera.com
Thu Jan 31 11:33:03 CET 2013


On 31.1.2013 01:29, Jonas Petersen wrote:
> Am 30.01.2013 11:26, schrieb Pavel Hofman:
>> On 29.1.2013 20:14, Jonas Petersen wrote:
>>
> 
> Pavel, I applied your patch (including the correction in the other
> post). It did not work out of the box. I had to do a lot of debugging
> and changes to it to make it compile and then more of that fun to make
> it not crash alsa. 

Sorry, I did not test any compilation/running. The changes were rather
simple though. Thanks for sorting out.
> 
> When it finally compiled and was running, I had an ak4114 file in proc.
> 
> Unfortunately it's full of 0x00's:
> 
> /proc/asound/Audiophile192/ak4114:
> 
> 0x00 = 0x00
> 0x02 = 0x00
> [...]
> 0x1e = 0x00
> 0x1f = 0x00
> 
> (32 lines total)
> 
> There is also no change in the spdif capture behaviour.

OK, it looks we have a problem in communication with the chip. IMO the
4wire_start and 4wire_finish code is incorrect. As chip-select it takes
VT1724_REVO_CS1, but for ak4114 it should be VT1724_REVO_CS3 (as defined
in revo.h)

IMO the two methods should be:
static unsigned int ap192_4wire_start(struct snd_ice1712 *ice)
{
	unsigned int tmp;

	snd_ice1712_save_gpio_status(ice);
	tmp = snd_ice1712_gpio_read(ice);
	tmp |= VT1724_REVO_CCLK; /* high at init */
	tmp |= VT1724_REVO_CS0;
	tmp &= ~VT1724_REVO_CS3;
	snd_ice1712_gpio_write(ice, tmp);
	udelay(1);
	return tmp;
}

static void ap192_4wire_finish(struct snd_ice1712 *ice, unsigned int tmp)
{
	tmp |= VT1724_REVO_CS0;
	tmp |= VT1724_REVO_CS3;
	snd_ice1712_gpio_write(ice, tmp);
	udelay(1);
	snd_ice1712_restore_gpio_status(ice);
}

Provided that VT1724_REVO_CS0 is chip-select for AK4358 DAC and
VT1724_REVO_CS3 chip-select for AK4114. The AK5385 ADC has no control.


IMO the ak4xxx config section should use VT1724_REVO_CS3 instead of
VT1724_REVO_CS1 too:

static struct snd_ak4xxx_private akm_ap192_priv = {
	.caddr = 2,
	.cif = 0,
	.data_mask = VT1724_REVO_CDOUT,
	.clk_mask = VT1724_REVO_CCLK,
	.cs_mask = VT1724_REVO_CS0 | VT1724_REVO_CS3,
	.cs_addr = VT1724_REVO_CS3,
	.cs_none = VT1724_REVO_CS0 | VT1724_REVO_CS3,
	.add_flags = VT1724_REVO_CCLK, /* high at init */
	.mask_flags = 0,
};

If I am not mistaken VT1724_REVO_CS1 is not used on ap192 at all. Is
that correct?

Sorry for not using proper patches but I cannot test the result anyway.


Thanks,

Pavel.


More information about the Alsa-devel mailing list