[Alsa-devel] EWX 24/96 and SPDIF: solved? (with patch)

2003-09-30 Thread Denis Sbragion
Hello Jaroslav and Takashi,

may be I finally nailed down the SPDIF problem with the TerraTec EWX 24/96. 
The problem is caused by the execution of a second CS8427 reset in the 
snd_cs8427_iec958_pcm() function in the cs8427.c file, exactly in the 
following lines of code:

...
reset = chip-rate != rate;
snd_i2c_unlock(cs8427-bus);
if (reset)
snd_cs8427_reset(cs8427);
...
Anyway, I think the problem arise elsewhere, within the ice1712.c file, in 
the snd_ice1712_playback_pro_hw_params(), where there are the following 
lines of code:

...
if (ice-spdif.ops.setup_rate)
ice-spdif.ops.setup_rate(ice, params_rate(hw_params));
...
where the spdif rate is changed without checking if the rate is locked or 
not, i.e. without verifying if the is_pro_rate_locked() function returns 
true. Attached to this e-mail there's the obvious patch for this problem, 
changing the previous line into:

...
if (ice-spdif.ops.setup_rate  !is_pro_rate_locked(ice))
ice-spdif.ops.setup_rate(ice, params_rate(hw_params));
...
With this patch my EWX works flawless with ALSA 0.9.7, anyway I can't check 
if it is going to cause problems with other ICE1712 based soundcards. I 
hope this change is the right one, and not something that makes just my 
soundcard work.

Bye,

ice1712.dif
Description: Binary data
--
Denis Sbragion
InfoTecna
Tel: +39 0362 805396, Fax: +39 0362 805404
URL: http://www.infotecna.it

Re: [Alsa-devel] EWX 24/96 and SPDIF: solved? (with patch)

2003-09-30 Thread Jaroslav Kysela
On Tue, 30 Sep 2003, Denis Sbragion wrote:

 Hello Jaroslav and Takashi,

 may be I finally nailed down the SPDIF problem with the TerraTec EWX 24/96.
 The problem is caused by the execution of a second CS8427 reset in the
 snd_cs8427_iec958_pcm() function in the cs8427.c file, exactly in the
 following lines of code:

 ...
 reset = chip-rate != rate;
 snd_i2c_unlock(cs8427-bus);
 if (reset)
   snd_cs8427_reset(cs8427);
 ...

 Anyway, I think the problem arise elsewhere, within the ice1712.c file, in
 the snd_ice1712_playback_pro_hw_params(), where there are the following
 lines of code:

 ...
 if (ice-spdif.ops.setup_rate)
   ice-spdif.ops.setup_rate(ice, params_rate(hw_params));
 ...

I moved these two lines to snd_ice1712_set_pro_rate() function.

 where the spdif rate is changed without checking if the rate is locked or
 not, i.e. without verifying if the is_pro_rate_locked() function returns
 true. Attached to this e-mail there's the obvious patch for this problem,
 changing the previous line into:

 ...
 if (ice-spdif.ops.setup_rate  !is_pro_rate_locked(ice))
   ice-spdif.ops.setup_rate(ice, params_rate(hw_params));
 ...

 With this patch my EWX works flawless with ALSA 0.9.7, anyway I can't check
 if it is going to cause problems with other ICE1712 based soundcards. I
 hope this change is the right one, and not something that makes just my
 soundcard work.

But I think that we still need to investigate why the second reset of
the CS8427 chip failed.

Jaroslav

-
Jaroslav Kysela [EMAIL PROTECTED]
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs


---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel


Re: [Alsa-devel] EWX 24/96 and SPDIF: solved? (with patch)

2003-09-30 Thread Denis Sbragion
Hello Jaroslav,

At 13.45 30/09/2003 +0200, Jaroslav Kysela wrote:
...
But I think that we still need to investigate why the second reset of
the CS8427 chip failed.
I have double checked your reset code comparing it with the latest data 
sheet, where the weird reset procedure is explained, and in my opinion your 
code is ok. May be this is just a one time procedure, which avoid the 
CS8427 startup problem only the first time it is executed? This seems to be 
loosely confirmed by the fact that if I unload the 8427 kernel module 
(downloading the ICE module first, which uses it) and then reload it, 
sometimes I get weird behaviours, with problems settings the period 
size/buffer size both by arecord and BruteFIR. I know, it seems an 
unrelated problem. I'm supposing here a failure in the 8427 code causing 
also a problem elsewhere.
Anyway, I still don't understand why this second reset is needed, 
base also on the rate value. When the SPDIF is the master clock the rate is 
defined by the input SPDIF stream, so comparing it with the rate requested 
by the program makes no sense to me. Of course I don't know the ALSA 
architecture enough to be sure that doing it it's really a bug.

Bye,
--
Denis Sbragion
InfoTecna
Tel: +39 0362 805396, Fax: +39 0362 805404
URL: http://www.infotecna.it


---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel


Re: [Alsa-devel] EWX 24/96 and SPDIF: solved? (with patch)

2003-09-30 Thread Tommi Sakari Uimonen

 With this patch my EWX works flawless with ALSA 0.9.7, anyway I can't
 check if it is going to cause problems with other ICE1712 based
 soundcards. I hope this change is the right one, and not something that
 makes just my soundcard work.

With 0.9.6

I experienced ice1712 driver hangups when I used two M-Audio cards
connected together through SPDIF and the other card synced it's clock from
SPDIF (Audiophile 2496 and 1010LT). Sometimes in envy24control the
vu-meters freezed, and I needed to do /etc/init.d/alsa restart to get the
cards to respond again.

Sometimes the problem went away without restart when I tried to change the
clock rate from envy24control, but the card didn't always respond,
sometimes the clock changed fine and then the vu meters worked again.

This, I think, caused also ecasound problems; it couldn't stop the
recording and after killing the process I found out that it had not
recorded anything even thougn the engine started fine.
I quess the drivers were halted just after ecasound engine started,
otherwise it might have reported some errors.

(Btw Kai, if you read this, maybe ecasound could have some control ability
to be sure that audio really get's written to harddisk. In my case it just
wrote the wav headers.)

I'm not sure if I used the cards right; modules.conf had settings for both
cards, but when alsa started it reported the cards like this:

Starting ALSA sound driver (version 0.9.6): ice1712 (ice1712)

so I'm not sure if the other card was properly set up. (I assume that the
parenthesis means that driver has some problems. I get (via82xx) if the
motherboard AC97 is disabled from bios, and without parenthesis when it is
enabled)

But still I was able to record from both cards simultaneously when they
were not freezed, and the sample clocks were synced fine.


Tommi Uimonen

ps. Kernel was 2.4.20 with LL patches.


---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel


Re: [Alsa-devel] EWX 24/96 and SPDIF: solved? (with patch)

2003-09-30 Thread Kai Vehmanen
On Tue, 30 Sep 2003, Tommi Sakari Uimonen wrote:

 This, I think, caused also ecasound problems; it couldn't stop the
 recording and after killing the process I found out that it had not
 recorded anything even thougn the engine started fine.
 I quess the drivers were halted just after ecasound engine started,
 otherwise it might have reported some errors.

Ecasound does write all data in the buffers to files upon exit, so most 
it is likely that the audio device has not delivered any data. But, but, 
bugs are always a possibility. You could try running with -z:nodb (only
when testing though) and see whether the behaviour is the same.

-- 
 http://www.eca.cx
 Audio software for Linux!



---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel