Pisound-Btn on Arch Linux 64bit

I have Pisound working with a RPI 3 Model B+. I am running 64bit Arch Linux with the raspberry pi kernel. Everything seems to be working great but when I go to compile the pisound-btn, I get the errors listed below. I believe I have all of the correct dependencies installed, including libgpiod. Does anyone have any recommendations on getting this to build? I am wanting to use the button to shutdown the OS so I can run it headless. Thank you.

Robert

pisound-btn.c: In function 'open_rpi_gpiochip':
pisound-btn.c:874:24: error: implicit declaration of function 'gpiod_chip_open_by_label'; did you mean 'gpiod_chip_info_get_label'? [-Wimplicit-function-declaration]
  874 |                 chip = gpiod_chip_open_by_label(gpiochip_names[i]);
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~
      |                        gpiod_chip_info_get_label
pisound-btn.c:874:22: error: assignment to 'struct gpiod_chip *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
  874 |                 chip = gpiod_chip_open_by_label(gpiochip_names[i]);
      |                      ^
pisound-btn.c:880:32: error: implicit declaration of function 'gpiod_line_find'; did you mean 'gpiod_line_config_new'? [-Wimplicit-function-declaration]
  880 |         struct gpiod_line *l = gpiod_line_find("ID_SD");
      |                                ^~~~~~~~~~~~~~~
      |                                gpiod_line_config_new
pisound-btn.c:880:32: error: initialization of 'struct gpiod_line *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
pisound-btn.c:883:24: error: implicit declaration of function 'gpiod_line_get_chip' [-Wimplicit-function-declaration]
  883 |                 chip = gpiod_line_get_chip(l);
      |                        ^~~~~~~~~~~~~~~~~~~
pisound-btn.c:883:22: error: assignment to 'struct gpiod_chip *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
  883 |                 chip = gpiod_line_get_chip(l);
      |                      ^
pisound-btn.c: In function 'gpio_pin_close':
pisound-btn.c:903:17: error: implicit declaration of function 'gpiod_line_release' [-Wimplicit-function-declaration]
  903 |                 gpiod_line_release(pin->line);
      |                 ^~~~~~~~~~~~~~~~~~
pisound-btn.c: In function 'gpio_pin_open_input':
pisound-btn.c:961:18: error: implicit declaration of function 'gpiod_chip_get_line'; did you mean 'gpiod_chip_get_info'? [-Wimplicit-function-declaration]
  961 |         p.line = gpiod_chip_get_line(g_chip, offset);
      |                  ^~~~~~~~~~~~~~~~~~~
      |                  gpiod_chip_get_info
pisound-btn.c:961:16: error: assignment to 'struct gpiod_line *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
  961 |         p.line = gpiod_chip_get_line(g_chip, offset);
      |                ^
pisound-btn.c:973:40: error: 'GPIOD_LINE_REQUEST_FLAG_ACTIVE_LOW' undeclared (first use in this function)
  973 |                 flags |= *active_low ? GPIOD_LINE_REQUEST_FLAG_ACTIVE_LOW : 0;
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pisound-btn.c:973:40: note: each undeclared identifier is reported only once for each function it appears in
pisound-btn.c:979:26: error: 'GPIOD_LINE_REQUEST_FLAG_BIAS_DISABLE' undeclared (first use in this function)
  979 |                 flags |= GPIOD_LINE_REQUEST_FLAG_BIAS_DISABLE;
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pisound-btn.c:982:26: error: 'GPIOD_LINE_REQUEST_FLAG_BIAS_PULL_UP' undeclared (first use in this function)
  982 |                 flags |= GPIOD_LINE_REQUEST_FLAG_BIAS_PULL_UP;
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pisound-btn.c:985:26: error: 'GPIOD_LINE_REQUEST_FLAG_BIAS_PULL_DOWN' undeclared (first use in this function); did you mean 'GPIOD_LINE_BIAS_PULL_DOWN'?
  985 |                 flags |= GPIOD_LINE_REQUEST_FLAG_BIAS_PULL_DOWN;
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                          GPIOD_LINE_BIAS_PULL_DOWN
pisound-btn.c:992:23: error: implicit declaration of function 'gpiod_line_request_rising_edge_events_flags'; did you mean 'gpiod_line_request_read_edge_events'? [-Wimplicit-function-declaration]
  992 |                 err = gpiod_line_request_rising_edge_events_flags(p.line, consumer, flags);
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                       gpiod_line_request_read_edge_events
pisound-btn.c:995:23: error: implicit declaration of function 'gpiod_line_request_falling_edge_events_flags'; did you mean 'gpiod_line_request_wait_edge_events'? [-Wimplicit-function-declaration]
  995 |                 err = gpiod_line_request_falling_edge_events_flags(p.line, consumer, flags);
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                       gpiod_line_request_wait_edge_events
pisound-btn.c:998:23: error: implicit declaration of function 'gpiod_line_request_both_edges_events_flags'; did you mean 'gpiod_line_request_read_edge_events'? [-Wimplicit-function-declaration]
  998 |                 err = gpiod_line_request_both_edges_events_flags(p.line, consumer, flags);
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                       gpiod_line_request_read_edge_events
pisound-btn.c:1011:16: error: implicit declaration of function 'gpiod_line_event_get_fd'; did you mean 'gpiod_line_request_get_fd'? [-Wimplicit-function-declaration]
 1011 |         p.fd = gpiod_line_event_get_fd(p.line);
      |                ^~~~~~~~~~~~~~~~~~~~~~~
      |                gpiod_line_request_get_fd
pisound-btn.c: In function 'gpio_pin_read':
pisound-btn.c:1031:41: error: storage size of 'ev' isn't known
 1031 |                 struct gpiod_line_event ev;
      |                                         ^~
pisound-btn.c:1032:17: error: implicit declaration of function 'gpiod_line_event_read_fd'; did you mean 'gpiod_line_request_get_fd'? [-Wimplicit-function-declaration]
 1032 |                 gpiod_line_event_read_fd(pin->fd, &ev);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~
      |                 gpiod_line_request_get_fd
pisound-btn.c:1033:41: error: 'GPIOD_LINE_EVENT_RISING_EDGE' undeclared (first use in this function); did you mean 'GPIOD_EDGE_EVENT_RISING_EDGE'?
 1033 |                 return ev.event_type == GPIOD_LINE_EVENT_RISING_EDGE;
      |                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                         GPIOD_EDGE_EVENT_RISING_EDGE
make: *** [Makefile:34: pisound-btn] Error 1

What is the version of your libgpiod-dev library?

I have libgpiod 2.1.2-1 installed. I do not see a libgpiod-dev package for Arch Linux. Do I need to manually build and install this dependency? I looked for it prior to my build attempt but then thought that libgpiod provided all of the development headers that were needed. Thanks for your assistance with this.

Robert

The libgpiod version currently in bookworm Debian is 1.6.3. Either the API changed in a later version, or you are missing the -dev library which provides the necessary headers for code to compile. You should have received an error on missing gpiod.h file.

I uninstalled libgpiod 2.1.2-1 and installed libgpiod-1.6.4 from AUR. I am now able to compile the pisound-btn successfully. I plan to install and configure it this weekend when I have a little more time. Thank you for your help with this!

1 Like