To run a container application which is developed on commercial raspberry pi, I need to map a microphone via USB port.
I think a directory '/dev/snd' must be mounted when creating a new container on netPI.
But, the attached failure message appears when deployed.
Is there any solution to activate the microphone device?
Thank you very much for your support.
Best regards,
I mapped the device as /dev/snd:/dev/snd.
After that, I entered below from the console.
That means Linux detects a device with integrated speaker and microphone (Jabra SPEAK) as 'Bus 001 Device 007'.
But, arecord doesn't recognize this device.
root@raspberrypi:/# lsusb
Bus 001 Device 007: ID 0b0e:0420 GN Netcom Jabra SPEAK 510
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@raspberrypi:/# arecord -l
**** List of CAPTURE Hardware Devices ****
root@raspberrypi:/#
If 'hilschernetpi/netpi-raspbian' is deployed on a commercial Raspberry Pi with Docker, the USB device is recognized only by enabling a privileged mode.
pi@testmic03:~$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 2: Microphone [USB Microphone], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
pi@testmic03:~$
Do you think netPI has some limitations for microphone input?
Thank you very much for your support.
Best regards,
July-8th-2020, 07:00 AM (This post was last modified: July-8th-2020, 07:03 AM by Armin@netPI.)
You say the microphone is recognized on a commercial Raspberry Pi if you enable "privileged" mode, correct?
But what happens if you enable "privileged" mode on the netPI too? Have you tried this already?
There is one important point to know in general about Docker and USB. Every time a container is started then Docker makes a snapshot of the connected USB devices and maps them into the container. If you connect USB devices after the container is started they will not be recognized. So make sure you have connected the USB device when you power on netPI and the containers are started later by Docker automatically. Then your are safe.
„You never fail until you stop trying.“, Albert Einstein (1879 - 1955)
July-8th-2020, 07:08 AM (This post was last modified: July-8th-2020, 09:43 AM by Armin@netPI.)
In order to get out the problem we can debug the "arecord" program using another program called "strace".
It is tracing all Linux calls of a program. If not already installed in the container instrall strace using "apt install strace" command first.
Then to debug call "strace arecord -l 2>mytrace.txt" and it will be tracing all outputs to the "mytrace.txt" file. After that post the "mytrace.txt" and maybe I can recognize what the problem is. Maybe it is a missing microphone Linux kernel driver, I don't know.
„You never fail until you stop trying.“, Albert Einstein (1879 - 1955)
Thank you very much for your help.
I attached 'mytrace.txt' which was gathered as follows.
root@raspberrypi:/home/pi# strace arecord 1 2>mytrace.txt
root@raspberrypi:/home/pi# lsusb
Bus 001 Device 004: ID 0b0e:0420 GN Netcom Jabra SPEAK 510
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@raspberrypi:/home/pi# arecord -l
**** List of CAPTURE Hardware Devices ****
root@raspberrypi:/home/pi#
I have always activated privileged mode and mapped /dev/snd:/dev/snd on my netPI.
Even if Network=bridge to host, I see the same phenomenon between bridge and host.
I tried to reproduce 'mytrace.txt' again with a different USB device (microphone).
I will then inform you its result.