All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Knoth <adi@drcomp.erfurt.thur.de>
To: alsa-devel@alsa-project.org
Subject: Re: hdspmixer broken for 96khz
Date: Mon, 4 Apr 2011 12:01:32 +0200	[thread overview]
Message-ID: <20110404100132.GQ28811@ltw.loris.tv> (raw)
In-Reply-To: <201104041005.58890.tim@klingt.org>

On Mon, Apr 04, 2011 at 10:05:58AM +0200, Tim Blechmann wrote:

> > Any chance to recover the old broken configuration?
> > Then we can track down the bug.
> attached

This isn't the old configuration, it's the new one. (it has my new magic
code "HDSPMixer v1" right at the beginning)

The foremost question is: when did you wrote your old configuration
file?

What I tried so far: checked out tag 1.0.24, created a conf file, then
checked out HEAD. As expected, hdspmixer correctly loads the file,
switching samplerates works.

Since I only have a RayDAT at hand right now, I cannot test with
anything older than 1.0.24 (to be precise, older than commit
e24e56795ea57e3dd7da45063ab71f04e231192d)

But what I can say for sure is: if you used hdspmixer before 1.0.24 on a
non-MADI card like Multiface/Digiface, loading this preset file in
1.0.24 would break the configuration. Is this what we're talking about?

Reason: defines.h contains HDSP_MAX_CHANNELS, it was 26 until adding
support for MADI cards, bumping this value to 64. And now let's have a
look at the preset load/restore code:

    for (int speed = 0; speed < 3; ++speed) {
	for (int card = 0; card < MAX_CARDS; ++card) {
	    for (int preset = 0; preset < 8; ++preset) {
		for (int channel = 0; channel < HDSP_MAX_CHANNELS; ++channel) {
		    /* inputs pans and volumes */
		    if (fread((void
*)&(inputs->strips[channel]->data[card][speed][preset]->pan_pos[0]),
sizeof(int), 14, file) != 14) {
			goto load_error;
		    }
		    if (fread((void
*)&(inputs->strips[channel]->data[card][speed][preset]->fader_pos[0]),
sizeof(int), 14, file) != 14) {
			goto load_error;
		    }

As I said earlier, the ondisk format is a pure 1:1 memory dump without
any meta information, just an array of integers.

Now that HDSP_MAX_CHANNELS has changed, the size of the final memory
dump differs and different values end up in different places.

The only possible way to circumvent this is to check the file size.
3*3*8*26*some_constant is different than 3*3*8*64*some_constant, and we
would be able to guess if it's a pre-1.0.24 preset file or a newer one.


Cheers

-- 
mail: adi@thur.de  	http://adi.thur.de	PGP/GPG: key via keyserver

  reply	other threads:[~2011-04-04 10:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-02 12:28 hdspmixer broken for 96khz Tim Blechmann
2011-04-03  8:16 ` Adrian Knoth
2011-04-03  9:39   ` Tim Blechmann
2011-04-03 10:25     ` Adrian Knoth
2011-04-04  7:21       ` Tim Blechmann
2011-04-04  7:58     ` Takashi Iwai
2011-04-04  8:05       ` Tim Blechmann
2011-04-04 10:01         ` Adrian Knoth [this message]
2011-04-05 10:29           ` Tim Blechmann

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=20110404100132.GQ28811@ltw.loris.tv \
    --to=adi@drcomp.erfurt.thur.de \
    --cc=alsa-devel@alsa-project.org \
    /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.