All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Hofman <pavel.hofman@ivitera.com>
To: Jonas Petersen <jnsptrsn1@gmail.com>
Cc: alsa-devel <alsa-devel@alsa-project.org>
Subject: Re: M-Audio Audiophile 192 (ice1724)'s broken spdif capture
Date: Thu, 31 Jan 2013 11:33:03 +0100	[thread overview]
Message-ID: <510A485F.9060100@ivitera.com> (raw)
In-Reply-To: <5109BADB.30403@gmail.com>

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.

  reply	other threads:[~2013-01-31 10:33 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-26 16:35 M-Audio Audiophile 192 (ice1724)'s broken spdif capture Jonas Petersen
2013-01-26 19:30 ` Jaroslav Kysela
2013-01-26 21:20   ` Pavel Hofman
2013-01-26 22:37     ` Jonas Petersen
2013-01-27 15:49     ` Jonas Petersen
2013-01-28  9:29       ` Jaroslav Kysela
2013-01-28 12:52         ` Pavel Hofman
2013-01-28 21:25           ` Jonas Petersen
2013-01-29  9:44             ` Pavel Hofman
2013-01-31  1:19               ` Jonas Petersen
2013-01-31  9:04                 ` Pavel Hofman
2013-01-31 20:56                   ` Jonas Petersen
2013-01-28 12:36       ` Pavel Hofman
2013-01-29  0:32         ` Jonas Petersen
2013-01-29  9:39           ` Pavel Hofman
2013-01-29 13:10             ` Jonas Petersen
2013-01-30 10:30               ` Pavel Hofman
2013-01-29 19:14             ` Jonas Petersen
2013-01-30 10:26               ` Pavel Hofman
2013-01-30 15:34                 ` Pavel Hofman
2013-01-31  0:29                 ` Jonas Petersen
2013-01-31 10:33                   ` Pavel Hofman [this message]
2013-01-31 22:25                     ` Jonas Petersen
2013-02-02  1:22                       ` Jonas Petersen
2013-02-02 10:44                         ` Pavel Hofman
2013-02-02 22:47                           ` Jonas Petersen
2013-02-04 16:56                             ` Pavel Hofman
2013-02-23 22:13                               ` Jonas Petersen
2013-02-25 11:47                                 ` Pavel Hofman
2013-01-26 21:29   ` Jonas Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=510A485F.9060100@ivitera.com \
    --to=pavel.hofman@ivitera.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=jnsptrsn1@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.