clap-host icon indicating copy to clipboard operation
clap-host copied to clipboard

No audio input ports

Open cbix opened this issue 3 years ago • 4 comments

clap-host 1.0.2 on Linux + PipeWire (jack/alsa/pulse) doesn't provide any way to connect audio inputs, only outputs are created. This is fine for synthesizer/instrument plugins but not for effects.

Couldn't test latest master since that doesn't build at all.

cbix avatar Dec 24 '22 00:12 cbix

On 1.0.3 with rtaudio 6 no audio ports are created at all and this error printed:

RtApi::openStream: output device ID is invalid.

Still couldn't build latest master:

Show output
[ 80%] Building C object clap/CMakeFiles/clap-plugin-template.dir/src/plugin-template.c.o
cc1: warning: ‘-Werror=’ argument ‘-Werror=non-virtual-dtor’ is not valid for C
cc1: warning: command-line option ‘-Woverloaded-virtual=2’ is valid for C++/ObjC++ but not for C
cc1: warning: command-line option ‘-fvisibility-inlines-hidden’ is valid for C++/ObjC++ but not for C
In file included from /home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/tests/hex-encoder.cc:1:
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh: In function ‘std::string clap::helpers::hex_encode(const void*, std::size_t)’:
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:15:38: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
   15 |       auto start = static_cast<const uint8_t *>(data);
      |                                      ^~~~~~~
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:15:38: error: expected ‘>’ before ‘uint8_t’
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:15:38: error: expected ‘(’ before ‘uint8_t’
   15 |       auto start = static_cast<const uint8_t *>(data);
      |                                      ^~~~~~~
      |                                      (
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:15:38: error: ‘uint8_t’ was not declared in this scope
   15 |       auto start = static_cast<const uint8_t *>(data);
      |                                      ^~~~~~~
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:8:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
    7 | #include <vector>
  +++ |+#include <cstdint>
    8 | 
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:15:47: error: expected primary-expression before ‘>’ token
   15 |       auto start = static_cast<const uint8_t *>(data);
      |                                               ^
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:15:54: error: expected ‘)’ before ‘;’ token
   15 |       auto start = static_cast<const uint8_t *>(data);
      |                                                      ^
      |                                                      )
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh: At global scope:
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:26:11: error: ‘uint8_t’ does not name a type
   26 |    inline uint8_t hex_decode_char(char c) {
      |           ^~~~~~~
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:26:11: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:37:23: error: ‘uint8_t’ was not declared in this scope
   37 |    inline std::vector<uint8_t> hex_decode(const char *str, size_t len) {
      |                       ^~~~~~~
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:37:23: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:37:30: error: template argument 1 is invalid
   37 |    inline std::vector<uint8_t> hex_decode(const char *str, size_t len) {
      |                              ^
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:37:30: error: template argument 2 is invalid
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh: In function ‘int clap::helpers::hex_decode(const char*, size_t)’:
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:43:19: error: ‘uint8_t’ was not declared in this scope
   43 |       std::vector<uint8_t> result;
      |                   ^~~~~~~
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:43:19: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:43:26: error: template argument 1 is invalid
   43 |       std::vector<uint8_t> result;
      |                          ^
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:43:26: error: template argument 2 is invalid
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:44:14: error: request for member ‘reserve’ in ‘result’, which is of non-class type ‘int’
   44 |       result.reserve(len / 2);
      |              ^~~~~~~
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:47:16: error: ‘uint8_t’ does not name a type
   47 |          const uint8_t v1 = hex_decode_char(str[i]);
      |                ^~~~~~~
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:47:16: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:48:16: error: ‘uint8_t’ does not name a type
   48 |          const uint8_t v2 = hex_decode_char(str[i + 1]);
      |                ^~~~~~~
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:48:16: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
In file included from /usr/include/c++/13.2.1/cassert:44,
                 from /home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:3:
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:50:22: error: ‘v1’ was not declared in this scope
   50 |          assert(0 <= v1 && v1 <= 0xF);
      |                      ^~
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:51:22: error: ‘v2’ was not declared in this scope
   51 |          assert(0 <= v2 && v2 <= 0xF);
      |                      ^~
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:53:16: error: ‘uint8_t’ does not name a type
   53 |          const uint8_t v = (v1 << 4) | v2;
      |                ^~~~~~~
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:53:16: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:54:17: error: request for member ‘push_back’ in ‘result’, which is of non-class type ‘int’
   54 |          result.push_back(v);
      |                 ^~~~~~~~~
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:54:27: error: ‘v’ was not declared in this scope
   54 |          result.push_back(v);
      |                           ^
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh: At global scope:
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:59:23: error: ‘uint8_t’ was not declared in this scope
   59 |    inline std::vector<uint8_t> hex_decode(const char *str) {
      |                       ^~~~~~~
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:59:23: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:59:30: error: template argument 1 is invalid
   59 |    inline std::vector<uint8_t> hex_decode(const char *str) {
      |                              ^
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:59:30: error: template argument 2 is invalid
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:63:23: error: ‘uint8_t’ was not declared in this scope
   63 |    inline std::vector<uint8_t> hex_decode(const std::string& str) {
      |                       ^~~~~~~
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:63:23: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:63:30: error: template argument 1 is invalid
   63 |    inline std::vector<uint8_t> hex_decode(const std::string& str) {
      |                              ^
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/hex-encoder.hh:63:30: error: template argument 2 is invalid
[ 82%] Linking CXX shared module clap-plugin-template.clap
[ 85%] Built target clap-plugin-template
[ 87%] Building CXX object clap-helpers/CMakeFiles/clap-helpers-tests.dir/tests/event-list-tests.cc.o
In file included from /home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/tests/event-list-tests.cc:1:
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/event-list.hh: In member function ‘bool clap::helpers::EventList::tryPush(const clap_event_header*)’:
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/include/clap/helpers/event-list.hh:111:21: error: ‘copy_n’ is not a member of ‘std’; did you mean ‘copy’?
  111 |                std::copy_n(ev->buffer, ev->size, buffer);
      |                     ^~~~~~
      |                     copy
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/tests/hex-encoder.cc: In function ‘void {anonymous}::CATCH2_INTERNAL_TEST_0()’:
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/tests/hex-encoder.cc:12:69: error: conversion from ‘int’ to non-scalar type ‘const std::vector<unsigned char>’ requested
   12 |       const std::vector<uint8_t> decoded = clap::helpers::hex_decode(encoded);
      |                                            ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/tests/hex-encoder.cc: In function ‘void {anonymous}::CATCH2_INTERNAL_TEST_2()’:
/home/florian/osamc/archlinux-proaudio/packages/clap-example-host/src/clap-host/clap-helpers/tests/hex-encoder.cc:18:69: error: conversion from ‘int’ to non-scalar type ‘const std::vector<unsigned char>’ requested
   18 |       const std::vector<uint8_t> decoded = clap::helpers::hex_decode("F0A8C40FFF");
      |                                            ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
make[3]: *** [clap-helpers/CMakeFiles/clap-helpers-tests.dir/build.make:96: clap-helpers/CMakeFiles/clap-helpers-tests.dir/tests/hex-encoder.cc.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [clap-helpers/CMakeFiles/clap-helpers-tests.dir/build.make:138: clap-helpers/CMakeFiles/clap-helpers-tests.dir/tests/event-list-tests.cc.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:742: clap-helpers/CMakeFiles/clap-helpers-tests.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:169: clap/CMakeFiles/clap-tests.dir/rule] Error 2
make: *** [Makefile:199: clap-tests] Error 2

Ping @abique

cbix avatar Jan 04 '24 11:01 cbix

I'm on arch linux. I get the same RtApi::getDeviceInfo: deviceId argument not found.

in this function

void AudioSettingsWidget::updateDeviceList() {
   _deviceChooser->clear();

   auto deviceCount = _audio->getDeviceCount();
   bool deviceFound = false;

   // Populate the choices
   for (int i = 0; i < deviceCount; ++i) {
      auto deviceInfo = _audio->getDeviceInfo(i);

For auto deviceCount = _audio->getDeviceCount(); I see my device count of 6

But for each auto deviceInfo = _audio->getDeviceInfo(i); it prints RtApi::getDeviceInfo: deviceId argument not found.

and the resulting deviceInfo struct is empty / zero initialized

digitalsignalperson avatar May 21 '24 17:05 digitalsignalperson

This was a breaking change in RtAudio where the argument in getDeviceInfo(i) is no longer an index, but a device id.

The fix can be like

auto deviceIds = _audio->getDeviceIds();
for (int i : deviceIds) {

digitalsignalperson avatar Jun 29 '24 06:06 digitalsignalperson

@digitalsignalperson thanks for your input (pun intended), for me this fixes the device selection but still no input ports show up in JACK :(

cbix avatar Jul 03 '24 16:07 cbix