Skip to contentSkip to conversation

hdspm: native float

PATCH In review Florian Faber 6 participants 9 messages Apr 14, 2009 – Apr 16, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hdspm: native float

Adds native float support to the driver. The interface has hardware support for CoreAudio[tm], why shouldn't jack users benefit from it.

diff a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c

13a14,16

Quoted 3 lines

* Modified 2009-04-14 for native float support by Florian Faber
* <[email protected]>
*

39a43

Quoted 1 line

#include <sound/pcm_params.h>

198a203

Quoted 1 line

#define HDSPe_FLOAT_FORMAT 0x2000000

3726a3732,3747

Quoted 6 lines

	/* Switch to native float format if requested */
	if (SNDRV_PCM_FORMAT_FLOAT_LE == params_format(params)) {
	  if (!(hdspm->control_register & HDSPe_FLOAT_FORMAT)) {
	    snd_printk(KERN_INFO "hdspm: Switching to native 32bit LE float

format.\n");

Quoted 5 lines
	  }
	  hdspm->control_register |= HDSPe_FLOAT_FORMAT;
	} else if (SNDRV_PCM_FORMAT_S32_LE == params_format(params)) {
	  if (hdspm->control_register & HDSPe_FLOAT_FORMAT) {
	    snd_printk(KERN_INFO "hdspm: Switching to native 32bit LE integer

format.\n");

Quoted 5 lines
	  }
	  hdspm->control_register &= ~HDSPe_FLOAT_FORMAT;
	}
	hdspm_write(hdspm, HDSPM_controlRegister, hdspm->control_register);

3870c3891
< .formats = SNDRV_PCM_FMTBIT_S32_LE,
---

Quoted 1 line

.formats = SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_FLOAT_LE,

3895c3916
< .formats = SNDRV_PCM_FMTBIT_S32_LE,
---

Quoted 1 line

.formats = SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_FLOAT_LE,

Flo

Signature · 2 lines
Machines can do the work, so people have time to think.
public key 6C002249          x-hkp://wwwkeys.eu.pgp.net
#1 lore raw
Quoted 1 line · Florian Faber

diff a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c

Please use unified diff format and add Signed-off-by; see linux/Documentation/SubmittingPatches.

Quoted 3 lines
Quoted 3 lines

* Modified 2009-04-14 for native float support by Florian Faber
* <[email protected]>
*

Changelogs are now in git.

Quoted 3 lines
Quoted 3 lines
	/* Switch to native float format if requested */
...
	hdspm_write(hdspm, HDSPM_controlRegister, hdspm->control_register);

This looks like a global change. What happens when playback and recording want to use different formats?

Best regards,
Clemens

#2 lore raw

Clemens,

Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
	/* Switch to native float format if requested */
...
	hdspm_write(hdspm, HDSPM_controlRegister, hdspm->control_register);

This looks like a global change. What happens when playback and recording want to use different formats?

It is a global change. The only use case is for jack, and jack doesn't use different formats for input/output.

Signature · 1 line
Flo
#3 lore raw
Quoted 9 lines · Florian Faber
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines
	/* Switch to native float format if requested */
...
	hdspm_write(hdspm, HDSPM_controlRegister, hdspm->control_register);

This looks like a global change. What happens when playback and recording want to use different formats?

It is a global change. The only use case is for jack, and jack doesn't use different formats for input/output.

"Using aplay + arecord" is a second use case. :-)

Anyway, at least add a check that the formats are actually the same (like the checks for sample rate and period size).

Best regards,
Clemens

#4 lore raw

Clemens,

Quoted 3 lines
Quoted 2 lines

It is a global change. The only use case is for jack, and jack doesn't use different formats for input/output.

"Using aplay + arecord" is a second use case. :-)

And they would willingly choose different formats?

Quoted 2 lines

Anyway, at least add a check that the formats are actually the same (like the checks for sample rate and period size).

Ok.

I just fixed a bug regarding the clock source anyway (LAC-live-debugging :).

Signature · 1 line
Flo
#5 lore raw

At Thu, 16 Apr 2009 14:12:21 +0200,

Quoted 6 lines · Florian Faber
Quoted 4 lines
Quoted 3 lines

It is a global change. The only use case is for jack, and jack doesn't use different formats for input/output.

"Using aplay + arecord" is a second use case. :-)

And they would willingly choose different formats?

Possibly. It's not always the same user who play and record.

thanks,

Takashi

#6 lore raw
In reply to Florian Faber
Quoted 5 lines · Florian Faber
Quoted 3 lines
Quoted 2 lines

It is a global change. The only use case is for jack, and jack doesn't use different formats for input/output.

"Using aplay + arecord" is a second use case. :-)

And they would willingly choose different formats?

A moderately common case is recording voice quality audio (at 8kHz or so) and playing back higher quality audio.

#7 lore raw
Quoted 10 lines · Mark Brown
Quoted 5 lines · Florian Faber
Quoted 3 lines
Quoted 2 lines

It is a global change. The only use case is for jack, and jack doesn't use different formats for input/output.

"Using aplay + arecord" is a second use case. :-)

And they would willingly choose different formats?

A moderately common case is recording voice quality audio (at 8kHz or so) and playing back higher quality audio.

Perhaps a little less common on a 64-channel MADI interface like this :-)

John

#8 lore raw
In reply to Mark Brown
Quoted 10 lines · Mark Brown
Quoted 5 lines · Florian Faber
Quoted 3 lines
Quoted 2 lines

It is a global change. The only use case is for jack, and jack doesn't use different formats for input/output.

"Using aplay + arecord" is a second use case. :-)

And they would willingly choose different formats?

A moderately common case is recording voice quality audio (at 8kHz or so) and playing back higher quality audio.

Perhaps a little less common on a 64-channel MADI interface like this :-)

John