Skip to contentSkip to conversation

hdspmixer broken for 96khz

DISCUSSION Tim Blechmann 3 participants 9 messages Apr 2, 2011 – Apr 5, 2011

lore
Share & tools
lore
#0 lore raw

the updated hdspmixer doesn't work for 96khz any more. the 44.1/48 khz versions are drawn correctly, the 88.2/96 khz version hides all controls, so just the menu is visible.

bisecting fails, since some versions of hdspmixer simply segfault. the bisect report gives me:

There are only 'skip'ped commits left to test.
The first bad commit could be any of:
0201fd1778fb536b2b1f2f5305e64a162667769c
69991756aa544021bff485eae64c02ee674c3e30
9ea2fb1f880667388435f4983f6d727d6b55875a
cef20c040c962e3183e20093478d30f2ffc1ee46
073fad25cb1e05c6fa00d9d2f3fb3781156e6988
5d4bcc44ce054cedaa6f998bcb6a7c0746d19f69
3f34b2c0f2aba38b819d4b05a25b2ff2f090f512
4c63a6b7beec6d9402b5e3fd8a5a075e436f6055
3506d3d9a7d13c40f8080bf36e2c745a73310da9
d0d9470deeb06d1cc5405e37695229db68cde3bd
97e96addffef14f71739bdf1e51030cce854904b
f2bb47662d65ecb358f51b66dfd64eed1f38dde1
646eacb626355a7010aab901dbe4dcfa66ede70f

oddly, i cannot get any earler version of hdspmixer working: the version tagged with v1.0.24.1 gives me:
HDSPMixer 1.6 - Copyright (C) 2003 Thomas Charbonnel <[email protected]> This program comes with ABSOLUTELY NO WARRANTY
HDSPMixer is free software, see the file COPYING for details

Looking for RME cards :
Card 0 : HDA Intel at 0xf7ff8000 irq 70
Card 1 : RME Hammerfall DSP + Multiface at 0xfbef0000, irq 16 Uninitialized HDSP card found.
Use hdsploader to upload configuration data to the card. No RME cards found.

hdspconf can connect to the card, though

thoughts?

Signature · 6 lines
[email protected]
http://tim.klingt.org

Your mind will answer most questions if you learn to relax and wait
for the answer.
  William S. Burroughs
#1 lore raw

On Sat, Apr 02, 2011 at 02:28:02PM +0200, Tim Blechmann wrote:

Hi!

Quoted 3 lines

the updated hdspmixer doesn't work for 96khz any more. the 44.1/48 khz versions are drawn correctly, the 88.2/96 khz version hides all controls, so just the menu is visible.

I've seen "both", a *working* hdspmixer at 96k and all hidden controls. The latter could be caused by wrongly initialized or restored presets.

Can you try to activate the controls in the View menu again? Maybe even the shortcuts work: I for Input section, P for Playback and O for Output.

Cheers

Signature · 4 lines
mail: [email protected]  	http://adi.thur.de	PGP/GPG: key via keyserver

The trouble with being punctual is that nobody's there to appreciate it.
                -- Franklin P. Jones
#2 lore raw
Quoted 9 lines
Quoted 3 lines

the updated hdspmixer doesn't work for 96khz any more. the 44.1/48 khz versions are drawn correctly, the 88.2/96 khz version hides all controls, so just the menu is visible.

I've seen "both", a *working* hdspmixer at 96k and all hidden controls. The latter could be caused by wrongly initialized or restored presets.

Can you try to activate the controls in the View menu again? Maybe even the shortcuts work: I for Input section, P for Playback and O for

ok, after removing my old hdspmixer configuration file, it seems to work. would be good to have a more robust behavior, since the current behavior is quite confusing and people may have rather complex mixer setups, which they would need to regenerate.

thnx, tim

Signature · 6 lines
[email protected]
http://tim.klingt.org

The price an artist pays for doing what he wants is that he has to do
it.
  William S. Burroughs

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#3 lore raw
Quoted 7 lines · Tim Blechmann
Quoted 7 lines
Quoted 3 lines

the updated hdspmixer doesn't work for 96khz any more. the 44.1/48 khz versions are drawn correctly, the 88.2/96 khz version hides all controls, so just the menu is visible.

I've seen "both", a *working* hdspmixer at 96k and all hidden controls. The latter could be caused by wrongly initialized or restored presets.

Quoted 7 lines
Quoted 2 lines

Can you try to activate the controls in the View menu again? Maybe even the shortcuts work: I for Input section, P for Playback and O for

ok, after removing my old hdspmixer configuration file, it seems to work. would be good to have a more robust behavior, since the current behavior is quite confusing and people may have rather complex mixer setups, which they would need to regenerate.

I thought I have paid attention to migrate the settings from the old file format to the new one:

http://git.alsa-project.org/?p=alsa-tools.git;a=commit;h=287bc091e9dba539399ba4540c60623dee1a3bc3

I wonder what went wrong. If you like, feel free to further dig into this.

However, the current on-disk format is utterly stupid, it has no meta-information at all, it will break if the order of cards change.

The whole hdspmixer is a dead-end, even supporting more than one card in a single app complicates things like hell (I have an upcoming patch series. Took me 6hrs or so just to get switching back/forth between two cards right).

So the next thing I'd like to implement is to limit hdspmixer to a single card and then run a new instance on the second, third, 4th a.s.o. card. Like alsamixer -c 1: hdspmixer -c 1, maybe -c reflecting the ALSA card number as found in /proc/asound/cards.

Anyway, the whole codebase is subtle broken, and the best approach would be a rewrite from scratch. Maybe it makes sense to merge hdsp and hdspm, first. Comments welcome. ;)

Cheers

Signature · 1 line
mail: [email protected]  	http://adi.thur.de	PGP/GPG: key via keyserver
#4 lore raw
Quoted 10 lines

I wonder what went wrong. If you like, feel free to further dig into this.

However, the current on-disk format is utterly stupid, it has no meta-information at all, it will break if the order of cards change.

The whole hdspmixer is a dead-end, even supporting more than one card in a single app complicates things like hell (I have an upcoming patch series. Took me 6hrs or so just to get switching back/forth between two cards right).

the hdspmixer is not perfect, but it more or less worked for years and it is used in `production' environments. so breaking the parts that are currently working is quite annoying for users.

Quoted 8 lines

So the next thing I'd like to implement is to limit hdspmixer to a single card and then run a new instance on the second, third, 4th a.s.o. card. Like alsamixer -c 1: hdspmixer -c 1, maybe -c reflecting the ALSA card number as found in /proc/asound/cards.

Anyway, the whole codebase is subtle broken, and the best approach would be a rewrite from scratch. Maybe it makes sense to merge hdsp and hdspm, first. Comments welcome. ;)

rewriting the hdspmixer doesn't sound like a bad idea to me. reworking the sampling rate switching would be a great help as well: the hdsp is the only device i know, which requires an external program to switch the sampling rate. a few years ago i had a brief look at the driver, but this seemed to be a non- trivial problem.

cheers, tim

Signature · 7 lines
[email protected]
http://tim.klingt.org

Most of the trouble in this world has been caused by folks who can't
mind their own business, because they have no business of their own to
mind, any more than a smallpox virus has.
  William S. Burroughs
#5 lore raw
In reply to Tim Blechmann

At Sun, 3 Apr 2011 11:39:41 +0200,

Quoted 8 lines · Tim Blechmann
Quoted 8 lines
Quoted 4 lines

the updated hdspmixer doesn't work for 96khz any more. the 44.1/48 khz versions are drawn correctly, the 88.2/96 khz version hides all controls, so just the menu is visible.

I've seen "both", a *working* hdspmixer at 96k and all hidden controls. The latter could be caused by wrongly initialized or restored presets.

Quoted 7 lines
Quoted 2 lines

Can you try to activate the controls in the View menu again? Maybe even the shortcuts work: I for Input section, P for Playback and O for

ok, after removing my old hdspmixer configuration file, it seems to work. would be good to have a more robust behavior, since the current behavior is quite confusing and people may have rather complex mixer setups, which they would need to regenerate.

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

thanks,

Takashi

#6 lore raw
Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
Quoted 3 lines

the updated hdspmixer doesn't work for 96khz any more. the 44.1/48 khz versions are drawn correctly, the 88.2/96 khz version hides all controls, so just the menu is visible.

I've seen "both", a *working* hdspmixer at 96k and all hidden controls. The latter could be caused by wrongly initialized or restored presets.

Can you try to activate the controls in the View menu again? Maybe even the shortcuts work: I for Input section, P for Playback and O for

Quoted 7 lines
Quoted 4 lines

ok, after removing my old hdspmixer configuration file, it seems to work. would be good to have a more robust behavior, since the current behavior is quite confusing and people may have rather complex mixer setups, which they would need to regenerate.

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

attached

tim

Signature · 5 lines
[email protected]
http://tim.klingt.org

I don't write music for sissy ears.
  Charles Ives

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#7 lore raw
Quoted 3 lines · Tim Blechmann
Quoted 2 lines

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

Signature · 1 line
mail: [email protected]  	http://adi.thur.de	PGP/GPG: key via keyserver
#8 lore raw
Quoted 9 lines
Quoted 3 lines
Quoted 2 lines

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?

hm, good question! i have been using this preset file for years, maybe i've stored it with the new hdspmixer. but with this preset file, the 96khz mixer was not shown.

Quoted 3 lines

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?

exactly!

Quoted 4 lines

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:

oh shit :/

Quoted 3 lines

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.

that sounds reasonable. at least printing a big fat warning would be appreciated!

btw, when working on the hdspmixer it would be cool, if you keep the fireface in mind. someone seems to work on ffado support and i suppose the fireface mixer can share some code with the hdspmixer.

cheers, tim

Signature · 12 lines
[email protected]
http://tim.klingt.org

Contrary to general belief, an artist is never ahead of his time but
most people are far behind theirs.
  Edgar Varèse


_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel