Envy24control -SPDIF bug and maybe improvements?
Hi,
Recently I reported a bug with DMX6fire and SPDIF inputs (bugtrack alsa-tools 0001214), and then, as reported there, happened to find the problem myself when perusing the source code.
As a user of the DMX6fire and an electronics engineer, I am newish to Linux and software. However, as I had ended up looking at the source code and had ideas for improvements to the controls and usability of 'e24c', I altered it in stages, and resulted in a neater, easier version for me to use.
How can this alternative be considered/made available for others -for example where could I put a tarball of the 3 major version stages of the changed files? These versions are all up to date with the released alsa-1.0.9.
Is there a better way to approach such development, if I am considering other improvements?
Regards
Alan Horstmann
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
Quoted 12 lines · Alan H
Hi,
Recently I reported a bug with DMX6fire and SPDIF inputs (bugtrack alsa-tools 0001214), and then, as reported there, happened to find the problem myself when perusing the source code.
As a user of the DMX6fire and an electronics engineer, I am newish to Linux and software. However, as I had ended up looking at the source code and had ideas for improvements to the controls and usability of 'e24c', I altered it in stages, and resulted in a neater, easier version for me to use.
Quoted 7 lines
How can this alternative be considered/made available for others -for example where could I put a tarball of the 3 major version stages of the changed files? These versions are all up to date with the released alsa-1.0.9.
Is there a better way to approach such development, if I am considering other improvements?
Please, provide us a patch against ALSA 1.0.9 or better against ALSA CVS.. Patch can be generated via this command:
diff -ru <old_dir> <new_dir>
We will review the patch and if it's ok, we'll apply it to ALSA mainstream.
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
Regarding envy24control SPDIF bug (bugtrack alsa-tools
0001214), attached are 2 patches, and readme file.
AHmod1.2 simply fixes bug but note the snd_ctl_elem_value_set_boolean(spdif_on_off,..) seems to work in reverse elsewhere, which is compensated for here (maybe needs sorting in the driver?).
AHmod2.3 also changes the controls for DMX6fire, to correct breakbox LED and other odds.
Patch needs the -l option for these to suceed; both are against alsa1.0.9.
Version3.2
I also have produced a version with more extensive and general changes/ improvements, but the diff is 50K. It would be helpful if users of envy24control would try this out to see if it is liked, by taking the files from the tarball attached. If there is interest I could try to sort patching.
Regards Alan
Quoted 37 lines · Jaroslav Kysela
Quoted 12 lines · Alan H
Hi,
Recently I reported a bug with DMX6fire and SPDIF inputs (bugtrack alsa-tools 0001214), and then, as reported there, happened to find the problem myself when perusing the source code.
As a user of the DMX6fire and an electronics engineer, I am newish to Linux and software. However, as I had ended up looking at the source code and had ideas for improvements to the controls and usability of 'e24c', I altered it in stages, and resulted in a neater, easier version for me to use.
Quoted 7 lines
How can this alternative be considered/made available for others -for example where could I put a tarball of the 3 major version stages of the changed files? These versions are all up to date with the released alsa-1.0.9.
Is there a better way to approach such development, if I am considering other improvements?
Please, provide us a patch against ALSA 1.0.9 or better against ALSA CVS.. Patch can be generated via this command:
diff -ru <
old_dir> <new_dir>We will review the patch and if it's ok, we'll apply it to ALSA mainstream.
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs
Quoted 9 lines
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel
Notes to go with AHmoded versions of envy24control files
Alan Horstmann
Date 27.7.2005
The associated files contain improved(?) versions of the envy24control utility, in increasing levels of changes.
Version 1.2
This started with bug-fixing SPDIF input on/off not functioning which
turns out to be a simple variable error in hardware.c. However, the snd_ctl_elem_value for spdif_on_off works in reverse (this is seen in alsamixer also) and so I have reversed the action here to compensate. Just these changes are in version 1.2, which simply affects hardware.c in the envy24control files.
Version 2.3
As a Terratec DMX6fire user, some extra controls are presented, and I can compare to the Terratec driver for Microsoft Windows. The 'breakbox LED' is supposed to indicate when front panel input is selected, so in this version that is what happens. The separate user switch has been removed. Also some control label/titles are changed to make more sense with the DMX6fire. Both envy24control.c and hardware.c need to be altered.
Version 3.2
To improve usability further the screen interface has been altered slightly, to permit a smaller minimum screen size, scrolling all pages and splitting input meters from pcm meters. Pop-up menu is enabled. Controls on the hardware page are re-arranged so the most often used can be accessed quickley, and the SPDIF controls combined to a single input selector. The precise size seems to depend on gtk theme used, but is much smaller than before. Finally an extra command line option is added, '-w..' which allows the initial width of the window to be set, either as a number of channels (1-20) or as a pixel number (>20). Changes are thus required to envy24control.c, hardware.c and levelmeters.c.
Both version 2.3 and 3.2 have a temporary mod comment in the 'About' page.
All the above files have been brought up to date to alsa-1.0.9 and have been checked with it.
hardware.c +10 -6
@@ -1,6 +1,6 @@/***************************************************************************** hardware.c - Hardware Settings -Copyright (C) 2000 by Jaroslav Kysela <[email protected]> +Copyright (C) 2000 by Jaroslav Kysela <[email protected]> APH Modded 29.6.05 inc1.0.9 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License
@@ -720,9 +720,11 @@if ((err =snd_ctl_elem_read (ctl, spdif_on_off)) <0 )g_print ("Unable to read S/PDIF on/off switch: %s\n" ,snd_strerror (err));if (snd_ctl_elem_value_get_boolean (spdif_on_off,0 )) { -toggle_set (hw_spdif_switch_on_radio, TRUE); - }else { +/* Logic reversed to correct button action */ +/* The cause is elsewhere. AH 29.6.2005 */ toggle_set (hw_spdif_switch_off_radio, TRUE); + }else { +toggle_set (hw_spdif_switch_on_radio, TRUE); } }
@@ -734,10 +736,12 @@if (!is_active (togglebutton))return ;if (!strcmp (str,"On" )) -snd_ctl_elem_value_set_boolean (spdif_input,0 ,1 ); +snd_ctl_elem_value_set_boolean (spdif_on_off,0 ,0 ); +/* Logic reversed to correct button action */ +/* The cause is elsewhere. AH 29.6.2005 */ else -snd_ctl_elem_value_set_boolean (spdif_input,0 ,0 ); -if ((err =snd_ctl_elem_write (ctl, spdif_input)) <0 ) +snd_ctl_elem_value_set_boolean (spdif_on_off,0 ,1 ); +if ((err =snd_ctl_elem_write (ctl, spdif_on_off)) <0 )g_print ("Unable to write S/PDIF on/off switch: %s\n" ,snd_strerror (err)); }
envy24control.c 2005-07-27 13:01:21.000000000 +0100 renamed from envy24control.c 2005-05-24 17:52:18.000000000 +0100 +15 -15
@@ -3,7 +3,7 @@ Copyright (C) 2000 by Jaroslav Kysela <[email protected]> (2003/03/22) Changed to hbox/vbox layout. - Copyright (C) 2003 by S??ren Wedel Nielsen + Copyright (C) 2003 by S??ren Wedel Nielsen APH mod v2.3 Date 25.7.05 inc1.0.9 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License
@@ -1162,7 +1162,7 @@ if((card_eeprom.subvendor == ICE1712_SUBDEVICE_DELTADIO2496) || (card_eeprom.subvendor == ICE1712_SUBDEVICE_DMX6FIRE)) hide = 0; - frame = gtk_frame_new("S/PDIF Input"); + frame = gtk_frame_new("Front Digital In"); gtk_widget_show(frame); gtk_box_pack_start(GTK_BOX(box), frame, FALSE, TRUE, 0); gtk_container_set_border_width(GTK_CONTAINER(frame), 6);
@@ -1205,7 +1205,7 @@ if( card_eeprom.subvendor == ICE1712_SUBDEVICE_DMX6FIRE) hide = 0; - frame = gtk_frame_new("S/PDIF On/Off"); + frame = gtk_frame_new("Digital Input"); gtk_widget_show(frame); gtk_box_pack_start(GTK_BOX(box), frame, FALSE, TRUE, 0); gtk_container_set_border_width(GTK_CONTAINER(frame), 6);
@@ -1215,29 +1215,29 @@ gtk_container_add(GTK_CONTAINER(frame), vbox); gtk_container_set_border_width(GTK_CONTAINER(vbox), 6); - radiobutton = gtk_radio_button_new_with_label(group, "On"); - hw_spdif_switch_on_radio = radiobutton; + radiobutton = gtk_radio_button_new_with_label(group, "Internal CD"); + hw_spdif_switch_off_radio = radiobutton; group = gtk_radio_button_group(GTK_RADIO_BUTTON(radiobutton)); gtk_widget_show(radiobutton); gtk_box_pack_start(GTK_BOX(vbox), radiobutton, FALSE, FALSE, 0); gtk_signal_connect(GTK_OBJECT(radiobutton), "toggled", (GtkSignalFunc)spdif_on_off_toggled, - (gpointer)"On"); + (gpointer)"Off"); - radiobutton = gtk_radio_button_new_with_label(group, "Off"); - hw_spdif_switch_off_radio = radiobutton; + radiobutton = gtk_radio_button_new_with_label(group, "Front Digital In"); + hw_spdif_switch_on_radio = radiobutton; group = gtk_radio_button_group(GTK_RADIO_BUTTON(radiobutton)); gtk_widget_show(radiobutton); gtk_box_pack_start(GTK_BOX(vbox), radiobutton, FALSE, FALSE, 0); gtk_signal_connect(GTK_OBJECT(radiobutton), "toggled", (GtkSignalFunc)spdif_on_off_toggled, - (gpointer)"Off"); + (gpointer)"On"); if(hide) gtk_widget_hide_all(frame); } -static void create_breakbox_led(GtkWidget *box) +/*static void create_breakbox_led(GtkWidget *box) { GtkWidget *frame; GtkWidget *vbox;
@@ -1278,7 +1278,7 @@ if(hide) gtk_widget_hide_all(frame); -} +}*/ static void create_phono_input(GtkWidget *box) {
@@ -1416,13 +1416,13 @@ create_actual_rate(vbox); create_volume_change(vbox); - create_spdif_output_settings(hbox); + create_spdif_output_settings(hbox); - create_spdif_input_select(vbox2); create_input_interface(vbox2); - create_breakbox_led(vbox2); + /*create_breakbox_led(vbox2);*/ create_phono_input(vbox2); create_spdif_on_off(vbox2); + create_spdif_input_select(vbox2); } static void create_about(GtkWidget *main, GtkWidget *notebook, int page)
@@ -1446,7 +1446,7 @@ gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 6); /* create first line */ - label = gtk_label_new("Envy24 Control Utility " VERSION); + label = gtk_label_new("Envy24 Control Utility APH MOD 2.3-4.7.05 v" VERSION); gtk_widget_show(label); gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, TRUE, 6);
hardware.c 2005-07-27 13:08:50.000000000 +0100 renamed from hardware.c 2004-04-16 14:09:35.000000000 +0100 +24 -15
@@ -1,6 +1,6 @@ /***************************************************************************** hardware.c - Hardware Settings - Copyright (C) 2000 by Jaroslav Kysela <[email protected]> + Copyright (C) 2000 by Jaroslav Kysela <[email protected]> APH Modded v2.3 Date 25.7.05 inc1.0.9 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License
@@ -664,27 +665,33 @@ void analog_input_select_toggled(GtkWidget *togglebutton, gpointer data) { char *what = (char *) data; + int err; if (!is_active(togglebutton)) return; + //g_print("Anal i/p togg"); if (!strcmp(what, "Internal")) { analog_input_select_set(0); + snd_ctl_elem_value_set_boolean(breakbox_led, 0, 0); } else if (!strcmp(what, "Front Input")) { analog_input_select_set(1); + snd_ctl_elem_value_set_boolean(breakbox_led, 0, 1); } else if (!strcmp(what, "Rear Input")) { analog_input_select_set(2); + snd_ctl_elem_value_set_boolean(breakbox_led, 0, 0); } else if (!strcmp(what, "Wave Table")) { analog_input_select_set(3); + snd_ctl_elem_value_set_boolean(breakbox_led, 0, 0); } else { g_print("analog_input_select_toggled: %s ???\n", what); } + if ((err = snd_ctl_elem_write(ctl, breakbox_led)) < 0) + g_print("Unable to write breakbox LED switch: %s\n", snd_strerror(err)); } - -void breakbox_led_update(void) +/*void breakbox_led_update(void) { int err; - if (card_eeprom.subvendor != ICE1712_SUBDEVICE_DMX6FIRE) return; if ((err = snd_ctl_elem_read(ctl, breakbox_led)) < 0)
@@ -695,21 +702,20 @@ toggle_set(hw_breakbox_led_off_radio, TRUE); } } - -void breakbox_led_toggled(GtkWidget *togglebutton, gpointer data) + void breakbox_led_toggled(GtkWidget *togglebutton, gpointer data) { int err; char *str = (char *)data; - if (!is_active(togglebutton)) return; + g_print("LED togg"); if (!strcmp(str, "On")) snd_ctl_elem_value_set_boolean(breakbox_led, 0, 1); else snd_ctl_elem_value_set_boolean(breakbox_led, 0, 0); if ((err = snd_ctl_elem_write(ctl, breakbox_led)) < 0) g_print("Unable to write breakbox LED switch: %s\n", snd_strerror(err)); -} +}*/ void spdif_on_off_update(void) {
@@ -720,9 +726,11 @@ if ((err = snd_ctl_elem_read(ctl, spdif_on_off)) < 0) g_print("Unable to read S/PDIF on/off switch: %s\n", snd_strerror(err)); if (snd_ctl_elem_value_get_boolean(spdif_on_off, 0)) { - toggle_set(hw_spdif_switch_on_radio, TRUE); + /* Logic reversed to correct button action */ + /* The cause is elsewhere. AH 29.6.2005 */ + toggle_set(hw_spdif_switch_off_radio, TRUE); } else { - toggle_set(hw_spdif_switch_off_radio, TRUE); + toggle_set(hw_spdif_switch_on_radio, TRUE); } }
@@ -734,10 +742,12 @@ if (!is_active(togglebutton)) return; if (!strcmp(str, "On")) - snd_ctl_elem_value_set_boolean(spdif_input, 0, 1); - else - snd_ctl_elem_value_set_boolean(spdif_input, 0, 0); - if ((err = snd_ctl_elem_write(ctl, spdif_input)) < 0) + snd_ctl_elem_value_set_boolean(spdif_on_off, 0, 0); + /* Logic reversed to correct button action */ + /* The cause is elsewhere. AH 14.7.2005 */ + else + snd_ctl_elem_value_set_boolean(spdif_on_off, 0, 1); + if ((err = snd_ctl_elem_write(ctl, spdif_on_off)) < 0) g_print("Unable to write S/PDIF on/off switch: %s\n", snd_strerror(err)); }
@@ -841,7 +851,7 @@ spdif_input_update(); spdif_output_update(); analog_input_select_update(); - breakbox_led_update(); + /*breakbox_led_update();*/ spdif_on_off_update(); phono_input_update(); }