Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
alsaequal problems and workaround
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
jsegrave
n00b
n00b


Joined: 10 Jun 2012
Posts: 6

PostPosted: Mon Aug 26, 2013 9:51 pm    Post subject: alsaequal problems and workaround Reply with quote

I'm recently upgraded to gentoo 3.10 and alsamixer -D equal produced the following error
Code:

jes:/home/jes$ alsamixer -D equal
ALSA lib ctl_equal.c:268:(_snd_ctl_equal_open) Problem with control file .alsaequal.bin, 3  15.
cannot open mixer: Operation not permitted


A bit of playing with ebuild to get the source and examine the line in question in
/var/tmp/portage/media-plugins/alsaequal-0.6-r1/work/alsaequal-amd64/ctl_equal.c

Code:
 
    264                 if(equal->control_data->control[i].type == LADSPA_CNTRL_INPUT) {
    265                         index = equal->control_data->control[i].index;
    266                         if(equal->klass->PortDescriptors[index] !=
    267                                         (LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL)) {
    268                                 SNDERR("Problem with control file %s, %d.", controls, index);
    269                                 return -1;
    270                         }

Updating the SNDERR line to output the hex value of equal->klass->PortDescriptors[index] on errors showed it had a value of 0x15 which is LADSPA_HINT_LOGARITHMIC | LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL, which triggers the error. Altering that line to be:
Code:

    266                      if((0xf & equal->control_data->control[i].type) == LADSPA_CNTRL_INPUT) {


then an ebuild compile/preinst/install/merge and a restart of alsasound restored the alsamixer ncurses equaliser to normal operation
Back to top
View user's profile Send private message
megabaks
Apprentice
Apprentice


Joined: 22 Jan 2012
Posts: 253
Location: Russia && Saint-Petersburg

PostPosted: Mon Aug 26, 2013 11:56 pm    Post subject: Reply with quote

the same problem.
fix don't work
_________________
sorry my bad english
Back to top
View user's profile Send private message
megabaks
Apprentice
Apprentice


Joined: 22 Jan 2012
Posts: 253
Location: Russia && Saint-Petersburg

PostPosted: Tue Aug 27, 2013 12:40 am    Post subject: Reply with quote

caps-plugins-0.4 + 3.10 ---> work fine
_________________
sorry my bad english
Back to top
View user's profile Send private message
lagalopex
Guru
Guru


Joined: 16 Oct 2004
Posts: 512

PostPosted: Mon Jun 02, 2014 4:38 pm    Post subject: Re: alsaequal problems and workaround Reply with quote

jsegrave wrote:
Updating the SNDERR line to output the hex value of equal->klass->PortDescriptors[index] on errors showed it had a value of 0x15 which is LADSPA_HINT_LOGARITHMIC | LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL, which triggers the error.

Its actually a change in media-plugins/caps-plugins which added another value:
Code:
/* extending LADSPA_PORT_* */
#define LADSPA_PORT_GROUP (AUDIO<<1) /* 16 */
#define GROUP    LADSPA_PORT_GROUP

The checks in media-plugins/alsaequal should really only validate the bits they need and not the whole bitset.

/etc/portage/patches/media-plugins/alsaequal/fix-flags.patch:
Code:
diff -Nur a/ctl_equal.c b/ctl_equal.c
--- a/ctl_equal.c   2009-01-31 23:06:47.000000000 +0100
+++ b/ctl_equal.c   2014-06-02 18:42:39.146664059 +0200
@@ -263,7 +263,8 @@
    for(i = 0; i < equal->num_input_controls; i++) {
       if(equal->control_data->control[i].type == LADSPA_CNTRL_INPUT) {
          index = equal->control_data->control[i].index;
-         if(equal->klass->PortDescriptors[index] !=
+         if((equal->klass->PortDescriptors[index] &
+               (LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL)) !=
                (LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL)) {
             SNDERR("Problem with control file %s, %d.", controls, index);
             return -1;
@@ -284,12 +285,14 @@
    }
 
    /* Make sure that the control file makes sense */
-   if(equal->klass->PortDescriptors[equal->control_data->input_index] !=
+   if((equal->klass->PortDescriptors[equal->control_data->input_index] &
+         (LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO)) !=
          (LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO)) {
       SNDERR("Problem with control file %s.", controls);
       return -1;
    }
-   if(equal->klass->PortDescriptors[equal->control_data->output_index] !=
+   if((equal->klass->PortDescriptors[equal->control_data->output_index] &
+         (LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO)) !=
          (LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO)) {
       SNDERR("Problem with control file %s.", controls);
       return -1;
diff -Nur a/ladspa_utils.c b/ladspa_utils.c
--- a/ladspa_utils.c   2009-01-31 22:57:41.000000000 +0100
+++ b/ladspa_utils.c   2014-06-02 18:41:33.486663980 +0200
@@ -354,11 +354,13 @@
                   default_controls->control[index].type = LADSPA_CNTRL_OUTPUT;
                }
                index++;
-            } else if(psDescriptor->PortDescriptors[i] ==
-                  (LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO)) {
+            } else if((psDescriptor->PortDescriptors[i] &
+                  (LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO)) ==
+                  (LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO)){
                default_controls->input_index = i;
-            } else if(psDescriptor->PortDescriptors[i] ==
-                  (LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO)) {
+            } else if((psDescriptor->PortDescriptors[i] &
+                  (LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO)) ==
+                  (LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO)){
                default_controls->output_index = i;
             }
          }
diff -Nur a/pcm_equal.c b/pcm_equal.c
--- a/pcm_equal.c   2010-02-01 23:55:00.000000000 +0100
+++ b/pcm_equal.c   2014-06-02 18:42:11.607664026 +0200
@@ -231,12 +231,14 @@
    }
 
    /* Make sure that the control file makes sense */
-   if(equal->klass->PortDescriptors[equal->control_data->input_index] !=
+   if((equal->klass->PortDescriptors[equal->control_data->input_index] &
+         (LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO)) !=
          (LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO)) {
       SNDERR("Problem with control file %s.", controls);
       return -1;
    }
-   if(equal->klass->PortDescriptors[equal->control_data->output_index] !=
+   if((equal->klass->PortDescriptors[equal->control_data->output_index] &
+         (LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO)) !=
          (LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO)) {
       SNDERR("Problem with control file %s.", controls);
       return -1;

_________________
System: AMD Phenom II X4 840, 16GB RAM, NVidia GeForce GT 520, ASUS M4A87TD/USB3, Raid, Seagate Constellation ES
AMD64 system slow/unresponsive during disk access...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum