[alsa-devel] [PATCH 0/3] hdspm - Series of small corrections
Hi!
Here's a series of small corrections to the hdspm driver. First patch was tested by Joern Nettingsmeier, the remaining two by IOSONO-sound.com together with me.
Cheers
Adrian Knoth (3): ALSA: hdspm - Fix locking in snd_hdspm_midi_input_read ALSA: hdspm - Fix jumping external wordclock frequency in AutoSync mode ALSA: hdspm - Add firmware revision ID for RME MADI PCI version
sound/pci/rme9652/hdspm.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
For the MIDI part, we need to acquire (and release) the hmidi->lock, access to the global hdspm structure is serialized through hmidi->hdspm->lock instead.
Signed-off-by: Adrian Knoth adi@drcomp.erfurt.thur.de
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index 949691a..32d80af 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c @@ -1639,12 +1639,14 @@ static int snd_hdspm_midi_input_read (struct hdspm_midi *hmidi) } } hmidi->pending = 0; + spin_unlock_irqrestore(&hmidi->lock, flags);
+ spin_lock_irqsave(&hmidi->hdspm->lock, flags); hmidi->hdspm->control_register |= hmidi->ie; hdspm_write(hmidi->hdspm, HDSPM_controlRegister, hmidi->hdspm->control_register); + spin_unlock_irqrestore(&hmidi->hdspm->lock, flags);
- spin_unlock_irqrestore (&hmidi->lock, flags); return snd_hdspm_midi_output_write (hmidi); }
When using Word Clock on RME MADI cards, AutoSync mode was alternating betweeen MADI and WC due to a typo: AutoSync is indicated in the second status register (status2), not the first one (status).
While the proc output was always correct, the reported WC frequency to ALSA was unstable as mentioned in
http://mailman.alsa-project.org/pipermail/alsa-devel/2008-March/006723.html
Signed-off-by: Adrian Knoth adi@drcomp.erfurt.thur.de
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index 32d80af..d03ef94 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c @@ -1143,7 +1143,7 @@ static int hdspm_external_sample_rate(struct hdspm *hdspm)
/* if wordclock has synced freq and wordclock is valid */ if ((status2 & HDSPM_wcLock) != 0 && - (status & HDSPM_SelSyncRef0) == 0) { + (status2 & HDSPM_SelSyncRef0) == 0) {
rate_bits = status2 & HDSPM_wcFreqMask;
The PCI version of the RME HDSP MADI card uses 0xcf as revision ID. Just add this to the list of supported cards.
Signed-off-by: Adrian Knoth adi@drcomp.erfurt.thur.de
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index d03ef94..3f08afc 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c @@ -521,6 +521,7 @@ MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}"); #define HDSPM_DMA_AREA_KILOBYTES (HDSPM_DMA_AREA_BYTES/1024)
/* revisions >= 230 indicate AES32 card */ +#define HDSPM_MADI_OLD_REV 207 #define HDSPM_MADI_REV 210 #define HDSPM_RAYDAT_REV 211 #define HDSPM_AIO_REV 212 @@ -6379,6 +6380,7 @@ static int __devinit snd_hdspm_create(struct snd_card *card,
switch (hdspm->firmware_rev) { case HDSPM_MADI_REV: + case HDSPM_MADI_OLD_REV: hdspm->io_type = MADI; hdspm->card_name = "RME MADI"; hdspm->midiPorts = 3;
participants (2)
-
Adrian Knoth
-
Takashi Iwai