[alsa-devel] hdspmixer broken for 96khz
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 thomas@undata.org 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?
On Sat, Apr 02, 2011 at 02:28:02PM +0200, Tim Blechmann wrote:
Hi!
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
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
On Sun, Apr 03, 2011 at 11:39:41AM +0200, Tim Blechmann wrote:
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.
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=287bc091e9dba539399...
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
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.
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
At Sun, 3 Apr 2011 11:39:41 +0200, Tim Blechmann wrote:
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.
Any chance to recover the old broken configuration? Then we can track down the bug.
thanks,
Takashi
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.
Any chance to recover the old broken configuration? Then we can track down the bug.
attached
tim
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
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.
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!
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 :/
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
participants (3)
-
Adrian Knoth
-
Takashi Iwai
-
Tim Blechmann