Raspberry Pi is not recording from USB Microphone - usb

I've an USB hub (Plugabble) with a usb Daffodil sound card.
The Speakers are working great, but the microphone is not working. I don't know what to do anymore to get it working.
The usb sound card is set as default
The arecord command records but no sound is recorded.
The aplay play sounds nicely.
Here are some of my settings:
pi#raspberrypi ~ $ arecord -L
null
Discard all samples (playback) or generate zero samples (capture)
default:CARD=Set
C-Media USB Headphone Set, USB Audio
Default Audio Device
sysdefault:CARD=Set
C-Media USB Headphone Set, USB Audio
Default Audio Device
front:CARD=Set,DEV=0
C-Media USB Headphone Set, USB Audio
Front speakers
surround40:CARD=Set,DEV=0
C-Media USB Headphone Set, USB Audio
4.0 Surround output to Front and Rear speakers
surround41:CARD=Set,DEV=0
C-Media USB Headphone Set, USB Audio
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Set,DEV=0
C-Media USB Headphone Set, USB Audio
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Set,DEV=0
C-Media USB Headphone Set, USB Audio
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Set,DEV=0
C-Media USB Headphone Set, USB Audio
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Set,DEV=0
C-Media USB Headphone Set, USB Audio
IEC958 (S/PDIF) Digital Audio Output
pi#raspberrypi ~ $ sudo lsusb
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB
Bus 001 Device 005: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
Bus 001 Device 006: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter
pi#raspberrypi ~ $ sudo amixer set Capture cap 8
amixer: Unable to find simple control 'Capture',0
pi#raspberrypi ~ $ amixer
Simple mixer control 'Headphone',0
Capabilities: pvolume pswitch pswitch-joined penum
Playback channels: Front Left - Front Right
Limits: Playback 0 - 151
Mono:
Front Left: Playback 44 [29%] [-20.13dB] [on]
Front Right: Playback 44 [29%] [-20.13dB] [on]
Simple mixer control 'Mic',0
Capabilities: pvolume pvolume-joined cvolume cvolume-joined pswitch pswitch-joined cswitch cswitch-joined penum
Playback channels: Mono
Capture channels: Mono
Limits: Playback 0 - 32 Capture 0 - 16
Mono: Playback 23 [72%] [34.36dB] [on] Capture 9 [56%] [13.39dB] [on]
Simple mixer control 'Auto Gain Control',0
Capabilities: pswitch pswitch-joined penum
Playback channels: Mono
Mono: Playback [off]
Thanks!

This depends on you distribution, since different distributions handle the devices differently.
So i think you are running a raspian jessy but tried to configure it like you where on a wheezy.
So if I am right you should go into the file alsa.conf with the command
sudo nano /usr/share/alsa/alsa.conf and edit the lines
defaults.ctl.card 0
defaults.pcm.card 0
to
defaults.ctl.card 1
defaults.pcm.card 1
then go to the file .asoundrc with the command sudo nano /home/pi/.asoundrc and edit it so it looks like following:
pcm.!default {
type hw
card 1
}
ctl.!default {
type hw
card 1
}
do an reboot and hopefully it will work.
If i was wrong with my guess please comment under the answer and i will update it :) hope it helped.

Related

is there any software of hardware that can mimic an external non virtual camera with a custom video input

Websites can tell if camera selected is real or virtual, I think by checking device instance path [real vs virtual camera path][1][1]: https://i.stack.imgur.com/hKr5y.jpg
a real webcam tend to have USB in the path
and virtual tend to have root in the path
is it possible to show the website custom output such as a screen recording or a video stream or ip camera and make it seem like it's a real physical webcam or something like that via a software or an external device that is detected as camera but can I can choose what to output

Starting video failed when using webcam in Big Blue Button ubuntu 18.04

When trying to give access to my webcam (VGA Single Chip via USB) in BBB, an error appears.
But the camera is OK e. g. it works in GUVCView and the command
lsusb
gives
Bus 002 Device 011: ID 093a:2603 Pixart Imaging, Inc. PAC7312 Camera
Bus 002 Device 010: ID 046d:c52f Logitech, Inc. Unifying Receiver
[...]
When choosing the integrated Cam in BBB, this works.

getUserMedia: access system output stream

I know how to access audio input devices via getUserMedia() and route them to the WebAudio API. This works fine for microphones and such. But in my use-case, I would rather like to hook into the audio stream of an output device. The use case is that I want to create a spectrum analyser for audio coming from a digital audio workstation (DAW) running on the same PC.
I tried to enumerate the devices and call getUserMedia() with the device id of an audio device, but the stream returned only showed silence data. The only solution I found so far is to install an audio loopback device (like Soundflower on Macs) to route the DAW's output to and then use this as an input device for getUserMedia(). But this will require the user to install 3rd party software.
Is there any way to hook directly into the audio stream of an output device instead, before it is actually sent to the physical device (speaker or external soundcard)?
This can be achieved using the desktop capture APIs (chrome.desktopCapture.chooseDesktopMedia). An example for chrome is included here

Convert RTSP stream to virtual web camera

I am trying to use a RTSP stream from an IP camera as video input source for various applications on Windows (eg. Skype, Zoom, Microsoft Teams, etc.).
The only solution I have found so far is using "webcam 7", an application that fetches an RTSP stream and creates a virtual webcam driver that registers in system as webcam and that any application can then use. Unfortunately, this application often becomes unstable and might crash randomly.
Are there any alternative/better ways for achieving this?
Create your own DirectShow video capture filter (there are lots of examples - this is a great one) and handle the RTSP stream inside it. This way you can implement the stability yourself.
I know this is a bit old question.
But you can also have look at vlc2vcam, looks promising.
Try Moonware Universal Source Filter from http://netcamstudio.com. The only drawback is that it creates only video "composite" device that sends both video + audio and Skype can only see the video (I think most of applications does the same).
If I find an easy way to split that stream will post it here.
You can easily do it on Ubuntu, Debian, Raspian, and Ubuntu Linux for Windows subsystems using the following method,
Installing required libraries, v4l2loopback-dkms and ffmpeg:
sudo apt install v4l2loopback-dkms
sudo apt install ffmpeg
Emulate a video device:
sudo modprobe v4l2loopback card_label="Webcam Stream Name" exclusive_caps=1
Streaming from RTSP uri to the created virtual device:
ffmpeg -stream_loop -1 -re -i rtsp://uri -vcodec rawvideo -threads 0 -f v4l2 /dev/video0
You can replace the '0' at the end of /dev/video0 with the number of the available and playable video device.

How To Get RAW USB Input from wireless Keyboard

I'm Using Ubuntu and have purchased a Logitech K750 Wireless Keyboard that runs on solar power. I would like to use this device not just as a keyboard but also as a light sensor for my office. The keyboard (this I know from the windows tool available for it, that shows the light-level in lux) transmits the current light to the computer thus it should be possible to use it as a sensor.
My question is how to get the data transmitted from the keyboard. I have tried to identify the USB-Port with the help of dmesg, resulting in (these are just the last lines, after I put the usb-receiver in)
[ 379.352041] usb 5-1: new full speed USB device using uhci_hcd and address 4
[ 379.556188] input: Logitech USB Receiver as /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0/input/input12
[ 379.556345] generic-usb 0003:046D:C52B.0005: input,hidraw0: USB HID v1.11 Keyboard [Logitech USB Receiver] on usb-0000:00:1d.3-1/input0
[ 379.563530] input: Logitech USB Receiver as /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.1/input/input13
[ 379.563794] generic-usb 0003:046D:C52B.0006: input,hiddev0,hidraw1: USB HID v1.11 Mouse [Logitech USB Receiver] on usb-0000:00:1d.3-1/input1
[ 379.571558] generic-usb 0003:046D:C52B.0007: hiddev0,hidraw2: USB HID v1.11 Device [Logitech USB Receiver] on usb-0000:00:1d.3-1/input2
lsusb gives me
Bus 005 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 005 Device 003: ID 046a:0106 Cherry GmbH
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
I am nut sure what this means however.
I have tried sudo cat /dev/usb/hiddev0, which seemed like a likely solution but no data is displayed. (A while ago I could get the data from my mouse with that command, but now that does not work either)
Does anybody know how to get the data from the device?
Edit sudo cat /dev/tty0 works however I do not seem to get symbols that I can display... the terminal shows "9�9�9�9�� � ��� �� ��".
Edit2 I'm not sure that this signal is even from my keyboard. When I press "aaabbbcccabcd" and then resolve the unreadable text using od -x I get
0000000 1e9e b030 b030 2eae ae2e 9e1e 2030 00a0
0000017
I can't see the pattern...
I did a search on Google recently and I found this website: https://github.com/aheadley/logitech-solar-k750-linux
It might be helpful to you and the Linux world. I'm more of a Windows user, so I can't advise much to you with Ubuntu/Linux and Python coding. The source code is in Python language. Hope this helps you get somewhere.
I recently bought this keyboard, and subsequently ran into a blog post by Debian developer Julian Danjou on using upower with Logitech unifying devices and the solar K750 in particular. The post mentions that his work for a lumincance property might land in the next version of upower,v0.9.19. Until that is there, I intend to try out the version in their repository (see the upower page on freedesktop.org).
If you intend to dive into it yourself, that blog (and a previous entry on the K750) note that it uses the HID++ protocol to connect, and links to a draft specification. Yesterday I saw a tweet by Julian Danjou that his work with this is progressing - you might want to contact him directly.
edit - Update: this work is now (partly?) integrated into the gnome power manager (via upower).
Also, this work has been continued and developed into an application for controlling the Logitech Unifying adapter (pairing,unpairing), as well as checking the luminance, called 'Solaar': https://github.com/pwr/Solaar
It is a great help :)