Skip to contentSkip to conversation

hdsp update

PATCH Applied Thomas Charbonnel 2 participants 7 messages Nov 23, 2003 – Nov 25, 2003

lore
Share & tools
lore
#0 lore raw

Hi,

The attach patch fixes problems with speed modes for H9632 cards (many thanks to Pentti Ala-Vannesluoma for testing the driver and helping finding bugs), and the AutoSync mode issue (for all cards) reported by Anders Torger at the end of september.
A new version of hdspmixer is also available here :
http://www.undata.org/~thomas/
It is mostly a bugfix release for H9632 users.
There is also a new version of hdspconf, but it only adds a .desktop file and a nice icon (to bring it to par with the new hdspmixer), so Takashi, feel free not to commit this one if you don't have much time :)

Thomas

hdsp.c renamed from hdsp.c.cvs +20 -11
@@ -1109,16 +1109,17 @@
 		rate_bits = HDSP_Frequency176_4KHz;
 		break;
 	case 192000:
-		if (current_rate != 192000) {
+		if (current_rate < 128000) {
 			reject_if_open = 1;
 		}
 		rate_bits = HDSP_Frequency192KHz;
+		break;
 	default:
 		return -EINVAL;
 	}
 
 	if (reject_if_open && (hdsp->capture_pid >= 0 || hdsp->playback_pid >= 0)) {
-		snd_printk ("cannot change between single- and double-speed mode (capture PID = %d, playback PID = %d)\n",
+		snd_printk ("cannot change speed mode (capture PID = %d, playback PID = %d)\n",
 			    hdsp->capture_pid,
 			    hdsp->playback_pid);
 		return -EBUSY;
@@ -2102,9 +2103,11 @@
 	switch (mode) {
 	case HDSP_CLOCK_SOURCE_AUTOSYNC:
 		if (hdsp_external_sample_rate(hdsp) != 0) {
-		    hdsp->control_register &= ~HDSP_ClockModeMaster;		
-		    hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register);
-		    return 0;
+		    if (!hdsp_set_rate(hdsp, hdsp_external_sample_rate(hdsp), 1)) {
+			hdsp->control_register &= ~HDSP_ClockModeMaster;		
+			hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register);
+			return 0;
+		    }
 		}
 		return -1;
 	case HDSP_CLOCK_SOURCE_INTERNAL_32KHZ:
@@ -4189,30 +4192,36 @@
 static int snd_hdsp_hw_rule_in_channels(snd_pcm_hw_params_t *params,
 					snd_pcm_hw_rule_t *rule)
 {
-	unsigned int list[2];
+	unsigned int list[3];
 	hdsp_t *hdsp = rule->private;
 	snd_interval_t *c = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
 	if (hdsp->io_type == H9632) {
 		list[0] = hdsp->qs_in_channels;
+		list[1] = hdsp->ds_in_channels;
+		list[2] = hdsp->ss_in_channels;
+		return snd_interval_list(c, 3, list, 0);
 	} else {
 		list[0] = hdsp->ds_in_channels;
+		list[1] = hdsp->ss_in_channels;
 	}
-	list[1] = hdsp->ss_in_channels;
 	return snd_interval_list(c, 2, list, 0);
 }
 
 static int snd_hdsp_hw_rule_out_channels(snd_pcm_hw_params_t *params,
 					snd_pcm_hw_rule_t *rule)
 {
-	unsigned int list[2];
+	unsigned int list[3];
 	hdsp_t *hdsp = rule->private;
 	snd_interval_t *c = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
 	if (hdsp->io_type == H9632) {
 		list[0] = hdsp->qs_out_channels;
+		list[1] = hdsp->ds_out_channels;
+		list[2] = hdsp->ss_out_channels;
+		return snd_interval_list(c, 3, list, 0);
 	} else {
 		list[0] = hdsp->ds_out_channels;
+		list[1] = hdsp->ss_out_channels;
 	}
-	list[1] = hdsp->ss_out_channels;
 	return snd_interval_list(c, 2, list, 0);
 }
 
@@ -4229,7 +4238,7 @@
 			.integer = 1,
 		};
 		return snd_interval_refine(c, &t);	
-	} else if (r->min > 48000) {
+	} else if (r->min > 48000 && r->max <= 96000) {
 		snd_interval_t t = {
 			.min = hdsp->ds_in_channels,
 			.max = hdsp->ds_in_channels,
@@ -4260,7 +4269,7 @@
 			.integer = 1,
 		};
 		return snd_interval_refine(c, &t);	
-	} else if (r->min > 48000) {
+	} else if (r->min > 48000 && r->max <= 96000) {
 		snd_interval_t t = {
 			.min = hdsp->ds_out_channels,
 			.max = hdsp->ds_out_channels,
#1 lore raw

At Sun, 23 Nov 2003 18:21:01 +0100,

Quoted 8 lines · Thomas Charbonnel

[1 <text/plain; us-ascii (7bit)>]
Hi,

The attach patch fixes problems with speed modes for H9632 cards (many thanks to Pentti Ala-Vannesluoma for testing the driver and helping finding bugs), and the AutoSync mode issue (for all cards) reported by Anders Torger at the end of september.

thanks, patch is applied to cvs now.

Quoted 6 lines

A new version of hdspmixer is also available here :
http://www.undata.org/~thomas/
It is mostly a bugfix release for H9632 users.
There is also a new version of hdspconf, but it only adds a .desktop file and a nice icon (to bring it to par with the new hdspmixer), so Takashi, feel free not to commit this one if you don't have much time :)

i'll check this, too.

Takashi

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/

#2 lore raw

At Mon, 24 Nov 2003 12:40:15 +0100,

Quoted 9 lines · I wrote:
Quoted 7 lines

A new version of hdspmixer is also available here :
http://www.undata.org/~thomas/
It is mostly a bugfix release for H9632 users.
There is also a new version of hdspconf, but it only adds a .desktop file and a nice icon (to bring it to par with the new hdspmixer), so Takashi, feel free not to commit this one if you don't have much time :)

i'll check this, too.

ok, now they are on cvs.
i modified the configure to add --with-desktop-dir and --with-pixmap-dir options, so that they can be specified separately. also, the --with-soundbase option works properly now.

there were several compile warnings in hdspmixer, namely, non-used static variables defined in some header files for label, etc. i added ifdef for each of them to shut up the warnings.

still there is a warning which must be fixed. HDSPMixerCard::getAutosyncSpeed() returns no value if external_rate =
6. i assume it's 0 since the minus value will result in the error at starting. please let me know the correct value it should be.

Takashi

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/

#3 lore raw
Quoted 22 lines · Takashi Iwai a

At Mon, 24 Nov 2003 12:40:15 +0100,

Quoted 8 lines · I wrote:
Quoted 6 lines

A new version of hdspmixer is also available here :
http://www.undata.org/~thomas/
It is mostly a bugfix release for H9632 users.
There is also a new version of hdspconf, but it only adds a .desktop file and a nice icon (to bring it to par with the new hdspmixer), so Takashi, feel free not to commit this one if you don't have much time :)

i'll check this, too.

ok, now they are on cvs.
i modified the configure to add --with-desktop-dir and --with-pixmap-dir options, so that they can be specified separately. also, the --with-soundbase option works properly now.

there were several compile warnings in hdspmixer, namely, non-used static variables defined in some header files for label, etc. i added ifdef for each of them to shut up the warnings.

Quoted 7 lines

still there is a warning which must be fixed. HDSPMixerCard::getAutosyncSpeed() returns no value if external_rate =
6. i assume it's 0 since the minus value will result in the error at starting. please let me know the correct value it should be.

Takashi

I updated hdspmixer and hdspconf to fix all these problems :
http://www.undata.org/~thomas/
I just checked cvs to send you a clean patch instead, but the latest changes were not in there yet. Sorry for the extra workload this gives you.

Thanks,
Thomas

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/

Applied
#4 lore raw

At Mon, 24 Nov 2003 18:48:04 +0100,

Quoted 30 lines · Thomas Charbonnel
Quoted 28 lines · Takashi Iwai a

At Mon, 24 Nov 2003 12:40:15 +0100,

Quoted 8 lines · I wrote:
Quoted 6 lines

A new version of hdspmixer is also available here :
http://www.undata.org/~thomas/
It is mostly a bugfix release for H9632 users.
There is also a new version of hdspconf, but it only adds a .desktop file and a nice icon (to bring it to par with the new hdspmixer), so Takashi, feel free not to commit this one if you don't have much time :)

i'll check this, too.

ok, now they are on cvs.
i modified the configure to add --with-desktop-dir and --with-pixmap-dir options, so that they can be specified separately. also, the --with-soundbase option works properly now.

there were several compile warnings in hdspmixer, namely, non-used static variables defined in some header files for label, etc. i added ifdef for each of them to shut up the warnings.

still there is a warning which must be fixed. HDSPMixerCard::getAutosyncSpeed() returns no value if external_rate =
6. i assume it's 0 since the minus value will result in the error at starting. please let me know the correct value it should be.

Quoted 4 lines
Quoted 1 line

Takashi

I updated hdspmixer and hdspconf to fix all these problems :
http://www.undata.org/~thomas/

applied to cvs. thanks!

Quoted 2 lines

I just checked cvs to send you a clean patch instead, but the latest changes were not in there yet. Sorry for the extra workload this gives you.

no problem at all. (blame to sourceforge :)

ciao,

Takashi

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/

#5 lore raw
Quoted 11 lines · Takashi Iwai
Quoted 3 lines

I updated hdspmixer and hdspconf to fix all these problems :
http://www.undata.org/~thomas/

applied to cvs. thanks!

Quoted 1 line

I just checked cvs to send you a clean patch instead, but the latest changes were not in there yet. Sorry for the extra workload this gives you.

Quoted 6 lines

no problem at all. (blame to sourceforge :)

ciao,

Takashi

Thanks !
While we're at we should shut up the warnings in hdsploader too. Trivial diff attached.

Thomas

hdsploader.c renamed from hdsploader.c.cvs +1 -3
@@ -31,14 +31,13 @@
 
 void upload_firmware(int card)
 {
-    int err, i;
+    int err;
     snd_hwdep_t *hw;
     snd_hwdep_info_t *info;
     char card_name[6];
     hdsp_version_t version;
     
     hdsp_firmware_t firmware;
-    hdsp_config_info_t config_info;
     
     snd_hwdep_info_alloca(&info);
     snprintf(card_name, 6, "hw:%i", card);
@@ -97,7 +96,6 @@
 
     snd_ctl_card_info_t *info;
     snd_pcm_info_t *pcminfo;
-    int cards = 0;
     
     snd_ctl_card_info_alloca(&info);
     snd_pcm_info_alloca(&pcminfo);    
Applied
#6 lore raw

At Mon, 24 Nov 2003 19:37:37 +0100,

Quoted 18 lines · Thomas Charbonnel

[1 <text/plain; us-ascii (7bit)>]

Quoted 15 lines · Takashi Iwai
Quoted 3 lines

I updated hdspmixer and hdspconf to fix all these problems :
http://www.undata.org/~thomas/

applied to cvs. thanks!

Quoted 2 lines

I just checked cvs to send you a clean patch instead, but the latest changes were not in there yet. Sorry for the extra workload this gives you.

no problem at all. (blame to sourceforge :)

Quoted 7 lines
Quoted 3 lines

ciao,

Takashi

Thanks !
While we're at we should shut up the warnings in hdsploader too. Trivial diff attached.

applied. thanks!

Takashi

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/