[alsa-devel] [PATCH][fix] ALSA: bebob: fix wrong decoding of clock information for Terratec PHASE 88 Rack FW
![](https://secure.gravatar.com/avatar/6ad2911cf7f4e6ac971062aeaaaf334d.jpg?s=120&d=mm&r=g)
Terratec PHASE 88 rack fw has two registers for source of clock, one is for internal/external, and another is for wordclock/spdif for external.
When clock source is internal, information in another register has no meaning. Thus it must be ignored, but current implementation decodes it. This causes over-indexing reference to labels.
Reported-by: András Murányi muranyia@gmail.com Tested-by: András Murányi muranyia@gmail.com Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp --- sound/firewire/bebob/bebob_terratec.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/sound/firewire/bebob/bebob_terratec.c b/sound/firewire/bebob/bebob_terratec.c index 0e4c0bf..9940611 100644 --- a/sound/firewire/bebob/bebob_terratec.c +++ b/sound/firewire/bebob/bebob_terratec.c @@ -24,7 +24,12 @@ phase88_rack_clk_src_get(struct snd_bebob *bebob, unsigned int *id) if (err < 0) goto end;
- *id = (enable_ext & 0x01) | ((enable_word & 0x01) << 1); + if (enable_ext == 0) + *id = 0; + else if (enable_word == 0) + *id = 1; + else + *id = 2; end: return err; }
![](https://secure.gravatar.com/avatar/586424ca0847070dc1868aa58077003e.jpg?s=120&d=mm&r=g)
Takashi Sakamoto wrote:
Terratec PHASE 88 rack fw has two registers for source of clock, one is for internal/external, and another is for wordclock/spdif for external.
When clock source is internal, information in another register has no meaning. Thus it must be ignored, but current implementation decodes it. This causes over-indexing reference to labels.
Reported-by: András Murányi muranyia@gmail.com Tested-by: András Murányi muranyia@gmail.com Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp
Acked-by: Clemens Ladisch clemens@ladisch.de
sound/firewire/bebob/bebob_terratec.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/sound/firewire/bebob/bebob_terratec.c b/sound/firewire/bebob/bebob_terratec.c index 0e4c0bf..9940611 100644 --- a/sound/firewire/bebob/bebob_terratec.c +++ b/sound/firewire/bebob/bebob_terratec.c @@ -24,7 +24,12 @@ phase88_rack_clk_src_get(struct snd_bebob *bebob, unsigned int *id) if (err < 0) goto end;
- *id = (enable_ext & 0x01) | ((enable_word & 0x01) << 1);
- if (enable_ext == 0)
*id = 0;
- else if (enable_word == 0)
*id = 1;
- else
*id = 2;
end: return err; }
![](https://secure.gravatar.com/avatar/5b19e9d0e834ea10ef75803718ad564b.jpg?s=120&d=mm&r=g)
At Sun, 26 Oct 2014 22:49:45 +0900, Takashi Sakamoto wrote:
Terratec PHASE 88 rack fw has two registers for source of clock, one is for internal/external, and another is for wordclock/spdif for external.
When clock source is internal, information in another register has no meaning. Thus it must be ignored, but current implementation decodes it. This causes over-indexing reference to labels.
Reported-by: András Murányi muranyia@gmail.com Tested-by: András Murányi muranyia@gmail.com Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp
Thanks, applied with Clemens' ack now.
Takashi
sound/firewire/bebob/bebob_terratec.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/sound/firewire/bebob/bebob_terratec.c b/sound/firewire/bebob/bebob_terratec.c index 0e4c0bf..9940611 100644 --- a/sound/firewire/bebob/bebob_terratec.c +++ b/sound/firewire/bebob/bebob_terratec.c @@ -24,7 +24,12 @@ phase88_rack_clk_src_get(struct snd_bebob *bebob, unsigned int *id) if (err < 0) goto end;
- *id = (enable_ext & 0x01) | ((enable_word & 0x01) << 1);
- if (enable_ext == 0)
*id = 0;
- else if (enable_word == 0)
*id = 1;
- else
*id = 2;
end: return err; } -- 1.9.1
participants (3)
-
Clemens Ladisch
-
Takashi Iwai
-
Takashi Sakamoto