Error "That device is not compatible" in classify.py on RasperryPiB3+

I’m trying to use Edge Impulse to grab data from the microphone and classify it in realtime on RaspberryPi3B+ (Raspbian GNU/Linux 11 (bullseye)). Successfully installed Edge Impulse for Linux, able to connect the board to Edge Impulse Studio and record voice samples (edge-impulse-linux --disable-camera). I also can run edge-impulse-linux-runner:

**rpi@nnrpi**:**~/NN/fairytale_v2-v3 $** edge-impulse-linux-runner
Edge Impulse Linux runner v1.4.7
[RUN] Already have model /home/rpi/.ei-linux-runner/models/268016/v4/model.eim not downloading...
[RUN] Starting the audio classifier for Dmitry Sukhov / FairyTale_v2 (v4)
[RUN] Parameters freq 16000Hz window length 1000ms. classes [ 'Noise', 'Repeat', 'TellStory', 'Unknown' ]
[RUN] **Using microphone hw:2,0**
classifyRes 3ms. {
Noise: '0.0000',
Repeat: '0.0000',
TellStory: '0.0000',
Unknown: '0.0000'
}

I’ve also install Linux Python SDK and when I try to use the same model on the same HW (python3 classify.py modelfile.eim) I get error when try to select right audio device:

3 --> USB PnP Sound Device: Audio (hw:2,0)
8 --> pulse
12 --> default
Type the id of the audio device you want to use:
3
That device is not compatible
3 --> **USB PnP Sound Device: Audio (hw:2,0)**
8 --> pulse
12 --> default
Type the id of the audio device you want to use:

As audio device I use CM108AH based sound card. It perfectly works with RPi itself (record and play sounds in various python scripts) and with edge-impulse-linux-runner but doesn’t work with python script.
If I use Logitech CH270 webcam both linux-runner and python example works fine. If both are connected, I can choose input device (the card – fails as described, webcam works fine).
I would prefer to use in the project CH108 sound card instead of Logitech webcam…

What might be wrong? How to fix it?

Hi @DmitrSou,

It looks like your CM108AH is not supported in PyAudio, at least using the parameters as required by your model and Edge Impulse project. You can see that check performed here: https://github.com/edgeimpulse/linux-sdk-python/blob/1f63670f13b0ae7818ace010de966c9ee78ca98f/edge_impulse_linux/audio.py#L40

For troubleshooting, I might recommend the following:

  • See if you can use PyAudio to create a simple recording from your microphone and then play it back.
  • From that recording, check the following parameters: sample rate, number of channels, format.
  • In your model_parameters file (or from your Edge Impulse project), check to see if the sample rate (frequency), number of channels, and format (e.g. PCM int16) match what the microphone supports.
  • Those parameters must match for the microphone to work with your model.

@shawn_edgeimpulse thank you for quick reply.

  • I checked – the CM108AH microphone adapter perfectly works with PyAudio: records and plays back sounds

  • Sample rate, number of channels, format – I set all these parameters in the python script (can set/get 16000, 16 bit, 1 channel as well).

It’s strange to me that the error “That device is not compatible” I get only when running the standard demonstration python script (python3 classify.py modelfile.eim), at the same time everything works fine when using edge-impulse-linux-runner (as shown in the log file snippets above).
Of course, I can record sound samples in the Edge Impulse Studio using this microphone adapter. The only problem I’ve encountered so far is the inability to use it just when running a python script (and no problem at all when running python script/command line with Logitech web camera).
Perhaps there are other ideas what can be checked?

Hi @DmitrSou,

If you set the sample rate and PCM type in the Edge Impulse-provided script, it will not change the settings of the microphone. I checked your project, and it looks like the input sample rate is set at 16 kHz. I suspect that your microphone does not support a 16 kHz sampling rate.

As I do not have a CM108AH to check myself, could you try running the following program (ChatGPT generated, so let me know if it does not work):

Copy code
import pyaudio

def main():
    p = pyaudio.PyAudio()

    info = p.get_host_api_info_by_index(0)
    num_devices = info.get('deviceCount')

    for i in range(0, num_devices):
        if p.get_device_info_by_host_api_device_index(0, i).get('maxInputChannels') > 0:
            device_name = p.get_device_info_by_host_api_device_index(0, i).get('name')
            device_rate = p.get_device_info_by_host_api_device_index(0, i).get('defaultSampleRate')
            print(f"Input Device: {device_name}")
            print(f"Sample Rate: {device_rate}")

            # Print available formats (PCM types)
            formats = [
                ("8 bit", pyaudio.paInt8),
                ("16 bit", pyaudio.paInt16),
                ("24 bit", pyaudio.paInt24),
                ("32 bit float", pyaudio.paFloat32)
            ]
            
            print("Supported PCM Types:")
            for name, fmt in formats:
                try:
                    if p.is_format_supported(rate=device_rate, input_device=i, input_channels=1, input_format=fmt):
                        print(f"- {name}")
                except ValueError:
                    pass
            print("--------------")

    p.terminate()

if __name__ == "__main__":
    main()

This should tell you the supported sample rate and bit depths of the CM108AH. Please post the results of that in this thread. You can also poke around in Linux to see if the device description files give you any additional information: audio - Change usb soundcard device sample rate - Raspberry Pi Stack Exchange

Thank you a lot for your assistance in solving the case.

Maybe. But unless in that case the command edge-impulse-linux-runner should work? It works…

Looks like it works fine (CM108AH device is USB PnP Sound Device: Audio (hw:2,0)).
As for ALSA errors/warning – AFAIK it’s “standard” output messages. This is output for regular HW configuration (just Mic adapter connected):

**rpi@nnrpi**:**~/Python $** python3 PyAudio_SupportedSampleRates.py
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.front.0:CARD=0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM front
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.surround40.0:CARD=0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM surround40
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM surround41
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM surround50
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM surround51
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.surround71.0:CARD=0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM surround71
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM iec958
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_a52.c:823:(_snd_pcm_a52_open) a52 is only for playback
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.iec958.0:CARD=0,AES0=6,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM iec958:{AES0 0x6 AES1 0x82 AES2 0x0 AES3 0x2 CARD 0}
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card

Input Device: USB PnP Sound Device: Audio (hw:2,0)
Sample Rate: 44100.0
Supported PCM Types:
- 8 bit
- 16 bit
- 24 bit
- 32 bit float
--------------
Input Device: pulse
Sample Rate: 44100.0
Supported PCM Types:
- 8 bit
- 16 bit
- 24 bit
- 32 bit float
--------------
Input Device: default
Sample Rate: 44100.0
Supported PCM Types:
- 8 bit
- 16 bit
- 24 bit
- 32 bit float
--------------

**rpi@nnrpi**:**~/Python $**

And this is the log when I added the webcam (USB Device 0x46d:0x825: Audio (hw:3,0)):

**rpi@nnrpi**:**~/Python $** python3 PyAudio_SupportedSampleRates.py
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.front.0:CARD=0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM front
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.surround40.0:CARD=0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM surround40
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM surround41
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM surround50
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM surround51
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.surround71.0:CARD=0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM surround71
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM iec958
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_a52.c:823:(_snd_pcm_a52_open) a52 is only for playback
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.iec958.0:CARD=0,AES0=6,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM iec958:{AES0 0x6 AES1 0x82 AES2 0x0 AES3 0x2 CARD 0}
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card

Input Device: USB PnP Sound Device: Audio (hw:2,0)
Sample Rate: 44100.0
Supported PCM Types:
- 8 bit
- 16 bit
- 24 bit
- 32 bit float
--------------
Input Device: USB Device 0x46d:0x825: Audio (hw:3,0)
Sample Rate: 48000.0
Supported PCM Types:
- 8 bit
- 16 bit
- 24 bit
- 32 bit float
--------------
Input Device: pulse
Sample Rate: 44100.0
Supported PCM Types:
- 8 bit
- 16 bit
- 24 bit
- 32 bit float
--------------
Input Device: default
Sample Rate: 44100.0
Supported PCM Types:
- 8 bit
- 16 bit
- 24 bit
- 32 bit float
--------------

Hi @DmitrSou,

Thanks for printing that info. It looks like, in theory, the Edge Impulse code should be working with the mic (even downsampling where necessary). Let’s try something else. Please run this code first to get a list of attached sound devices:

import pyaudio

interface = pyaudio.PyAudio()

info = interface.get_host_api_info_by_index(0)
numdevices = info.get('deviceCount')
input_devices = []
for i in range(numdevices):
    if interface.get_device_info_by_host_api_device_index(0,i).get('maxInputChannels')>0:
        input_devices.append((i, interface.get_device_info_by_host_api_device_index(0,i).get('name')))

if len(input_devices) == 0:
    print("No audio devices available")
    exit()

for i in range(len(input_devices)):
    print(f"{i}: {input_devices[i]}")

For example, when I plug in my USB mic and run that code, I see:

0: (1, 'USB PnP Sound Device: Audio (hw:1,0)')
1: (6, 'pulse')
2: (10, 'default')

So, using ID=0 (for my USB device), run this code (change the id variable to match the one from above):

import pyaudio

interface = pyaudio.PyAudio()

rate = 160000
id = 0 
channels = 1
format = pyaudio.paInt16

supported = interface.is_format_supported(
    rate,
    input_device=id,
    input_channels=channels,
    input_format=format
)

print(f"Supported? {supported}")

I get something like this (I suspect you’ll find something similar):

Expression 'parameters->channelCount <= maxChans' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1514
Expression 'ValidateParameters( inputParameters, hostApi, StreamDirection_In )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1838
Traceback (most recent call last):
  File "/home/pi/Projects/Python/mic_check_2.py", line 10, in <module>
    supported = interface.is_format_supported(
  File "/usr/lib/python3/dist-packages/pyaudio.py", line 937, in is_format_supported
    return pa.is_format_supported(rate, **kwargs)
ValueError: ('Invalid number of channels', -9998)

If you see something similar, that is, unfortunately, a Linux and Alsa driver problem, and it’s not something we can really fix on our end. The easiest solution is to find a different microphone. If you want to dig into fixing such an issue, these threads might be a good place to start:

0: (3, 'USB PnP Sound Device: Audio (hw:2,0)')
1: (4, 'USB Device 0x46d:0x825: Audio (hw:3,0)')
2: (9, 'pulse')
3: (13, 'default')

Here both webcam (‘USB Device 0x46d:0x825: Audio (hw:3,0)’) and mic adapter ( ‘USB PnP Sound Device: Audio (hw:2,0)’) connected.

Here for ID=0:

Expression 'parameters->channelCount <= maxChans' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1514
Expression 'ValidateParameters( inputParameters, hostApi, StreamDirection_In )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1838
Traceback (most recent call last):
  File "/home/rpi/Python/EI_Test_IsSupported.py", line 10, in <module>
    supported = interface.is_format_supported(
  File "/usr/lib/python3/dist-packages/pyaudio.py", line 937, in is_format_supported
    return pa.is_format_supported(rate, **kwargs)
ValueError: ('Invalid number of channels', -9998)

Here for ID=1:

Expression 'parameters->channelCount <= maxChans' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1514
Expression 'ValidateParameters( inputParameters, hostApi, StreamDirection_In )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1838
Traceback (most recent call last):
  File "/home/rpi/Python/EI_Test_IsSupported.py", line 10, in <module>
    supported = interface.is_format_supported(
  File "/usr/lib/python3/dist-packages/pyaudio.py", line 937, in is_format_supported
    return pa.is_format_supported(rate, **kwargs)
ValueError: ('Invalid number of channels', -9998)

Thank you a lot for your suggestions.
I have already ordered another (actually a couple more) microphones. I’m interested in understanding what the problem is in order to understand the behavior of the system and the risks of implementation if it comes to a working solution. Thanks again.

Here the log file for running classify.py:

3 --> USB PnP Sound Device: Audio (hw:2,0)
4 --> USB Device 0x46d:0x825: Audio (hw:3,0)
9 --> pulse
13 --> default
Type the id of the audio device you want to use:
3
That device is not compatible

3 --> USB PnP Sound Device: Audio (hw:2,0)
4 --> USB Device 0x46d:0x825: Audio (hw:3,0)
9 --> pulse
13 --> default
Type the id of the audio device you want to use:
4
selected Audio device: 4
Result (12 ms.) Noise: 1.00 Repeat: 0.00 TellStory: 0.00 Unknown: 0.00
Result (5 ms.) Noise: 0.99 Repeat: 0.00 TellStory: 0.00 Unknown: 0.01