Raspberry Pi - uv4l WebRTC no audio - audio

I've setup up my Raspberry Pi 2 running Wheezy to stream video via uv4l / uv4l-server. I have both a Pi Camera and a USB Microsoft LifeCam HD-5000. I launched uv4l with each driver for each camera and the streaming works fine except for the audio. I'm trying to use my USB webcam as the microphone to stream audio. I read on the uv4l documentation that it picks up the first audio device from "arecord -l" has the audio input and mine prints:
**** List of CAPTURE Hardware Devices ****
card 0: HD5000 [Microsoft LifeCam HD-5000], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
I changed my /etc/modprobe.d/alsa-base.conf to match the one on this page: http://www.linux-projects.org/modules/sections/index.php?op=viewarticle&artid=14
I can record audio and play it back by doing:
arecord -D plughw:0,0 -d5 test.wav
aplay -D plughw:1,0 test.wav
Can someone please point me what I'm missing to be able to stream video and audio via uv4l?
Thank you!

Have you tried with or without PulseAudio? Try to uninstall it first.

Related

pygame No available audio device

I code on Ubuntu 20.04LTS with python 3.8.2 and in my game, I want to put music, so I use this:
pygame.mixer.init()
music = pygame.mixer.Sound(os.path.join(current_path,'something.mp3'))
music.play()
But I receive this error:
pygame.mixer.init()
pygame.error: No available audio device
What I have to do?
A common problem is selecting the right sound device, if more than one i present.
to list devices:
cat /proc/asound/cards
It could look like this:
0 [CUBE ]: USB-Audio - Audiotrak ProDigy CUBE GYROCOM C&C Co., LTD Audiotrak ProDigy CUBE at usb-0000:04:00.0-2, full speed
1 [IM ]: USB-Audio - VF0530 Live! Cam Chat IM Creative Labs VF0530 Live! Cam Chat IM at usb-0000:04:00.0-1, high speed
2 [HDMI ]: HDA-Intel - HDA ATI HDMI HDA ATI HDMI at 0xf7e60000 irq 45
Then you must edit the ~/.asoundrc to use the right device.
If you want to use device 0, set that value for pcm card:
pcm.!default {
type hw
card 0
}
ctl.!default {
type hw
card 0
}
Also make sure the following libs are installed and configured:
sudo apt-get install libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev
sudo sdl-config --cflags --libs

Error "Invalid value for card" with mic in my Node script

I'm trying to build a little Node script to listen to the microphone and then send the audio to a server and I'm stuck with the mic package.
I get this error:
Received Info: ALSA lib pcm_hw.c:1713:(_snd_pcm_hw_open) Invalid value for card
arecord: main:788:
Received Info: erreur à l'ouverture audio: Aucun fichier ou dossier de ce type
I have tried to run arecord -d 5 -f U8 sample.mp3 on my machine (Linux) and it works well (I can then listen to what I said with aplay sample.mp3).
I have seen a similar post but don't really understand how this applies to my case. In case you need, this is the output of arecord -l
**** Liste des Périphériques Matériels CAPTURE ****
carte 0: PCH [HDA Intel PCH], périphérique 0: ALC269VC Analog [ALC269VC Analog]
Sous-périphériques: 0/1
Sous-périphérique #0: subdevice #0
And this is the options object I pass to mic
"MIC_CONFIG": {
"rate": 8000,
"channels": 1,
"debug": true,
"exitOnSilence": 6
}
Thanks for helping

Nixos default audio device

I'm trying to configure the default audio device on a NixOS host.
My alsa devices are thus:
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 0: ALC1220 Analog [ALC1220 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 1: ALC1220 Digital [ALC1220 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
I don't have HDMI or digitaul audio devices; I just want to use the regular ALC1220 Analog device.
I currently have AUDIODEV=hw:1,0 set in my environment (for sox), and alsa-audio-device=sysdefault:CARD=Generic in my vlcrc. That works, but it is obviously user- and app- specific, and is a pain for declaritiveness (declarity?).
It seems that it should be something I can set at the host level, e.g., by setting
sound.extraConfig =
''
pcm.!default {
type hw
card Generic
}
'';
in my configuration.nix, or possibly configuring pulseaudio.
I have sought help in the NixOS Wiki (ALSA, Pulse), on other sites such as ArchLinux, Pulse documentation, and other sites like StackOverflow (e.g., stackexchange), but I can find nothing that actually works.
I have tried the above, and variants thereof; and also tried with & without Pulse; but I have found nothing that works.
Simply being able to sound audio to all the devices on that card would be jolly good, too.
As always, any pointers gratefully recieved.
Update: here is my /etc/asound.conf
pcm_type.pulse {
libs.native = /nix/store/a3v4gh5lbb2g8fizq9xh8nbdp8qrvs6r-alsa-plugins-1.1.6/lib/alsa-lib/libasound_module_pcm_pulse.so ;
}
pcm.!default {
type pulse
hint.description "Default Audio Device (via PulseAudio)"
}
ctl_type.pulse {
libs.native = /nix/store/a3v4gh5lbb2g8fizq9xh8nbdp8qrvs6r-alsa-plugins-1.1.6/lib/alsa-lib/libasound_module_ctl_pulse.so ;
}
ctl.!default {
type pulse
}
(and that module is real):
$ ls -l /nix/store/a3v4gh5lbb2g8fizq9xh8nbdp8qrvs6r-alsa-plugins-1.1.6/lib/alsa-lib/libasound_module_ctl_pulse.so
-r-xr-xr-x 1 root root 33512 Jan 1 1970 /nix/store/a3v4gh5lbb2g8fizq9xh8nbdp8qrvs6r-alsa-plugins-1.1.6/lib/alsa-lib/libasound_module_ctl_pulse.so
This problem is most likely due to pulseaudio comandeering the default device, despite listing it in ~/.asoundrc.
The best solution to override pulse's comandeering of the default device with an alsa hook. To do this, edit your ~/.asoundrc with the following contents at the top :
#hooks [
{
func load
files [
"~/.asoundrc"
]
errors false
}
]
You can then add you default device as required, probably something like the following in your case :
pcm.!default {
type hw
card "Generic"
}
ctl.!default {
type hw
card "Generic"
}

How to fix: device_list:270: no soundcard found (Ubuntu server 18.04)?

I was trying to capture some audio using a usb microphone and I got the error message mentioned in the title.
here is the output some (hopefully relevant) commands:
arecord -l
arecord: device_list:270: no soundcards found...
ls /cat/asound*
ls: cannot access '/cat/asound*': No such file or directory
lspci -v
00:1b.0 Audio device: Intel Corporation 7 Series/C216 Chipset Family High Definition Audio Controller (rev 04)
Subsystem: Hewlett-Packard Company 7 Series/C216 Chipset Family High Definition Audio Controller
Flags: bus master, fast devsel, latency 0, IRQ 29
Memory at f7c30000 (64-bit, non-prefetchable) [size=16K]
Capabilities: <access denied>
Kernel driver in use: snd_hda_intel
Kernel modules: snd_hda_intel
I've tried to remove and install alsa again and when I run
sudo arecord -l
The output is:
**** List of CAPTURE Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC221 Analog [ALC221 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 2: ALC221 Alt Analog [ALC221 Alt Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
I guess meaning Ubuntu is recognising my sound card. The ALSA Info script can be found here.
Any help would be greatly appreciated.
I had aplay: device_list:268: No sound card found... after using aplay l. Following the Ubuntu troubleshooting guide below, I installed apt install linux-generic and after reboot it found my soundcard from VirtualBox in Ubuntu Server 20.04 from ova.
https://help.ubuntu.com/community/SoundTroubleshooting

Arduino to Ubuntu USB connection

I am having trouble getting an Ubuntu device to connect to an Arduino Uno. Before I begin talking about the device in question the Arduino is communicating correctly with my Windows pc, and also an Ubuntu VM on that PC.
The device in question is an nVidia Jetson TX2. The Arduino IDE is installed, and when run using sudo the only serial port available is /dev/ttyS0.
The following line is lsusb being run and it detecting the Arduino.
Bus 001 Device 008: ID 2341:0001 Arduino SA Uno (CDC ACM)
The following lines is the output from dmesg from the time that the Arduino is connected.
[ 6609.813385] usb 1-2.3: new full-speed USB device number 13 using xhci-tegra
[ 6609.923568] usb 1-2.3: New USB device found, idVendor=2341, idProduct=0001
[ 6609.930495] usb 1-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[ 6609.938049] usb 1-2.3: Product: Arduino Uno
[ 6609.942268] usb 1-2.3: Manufacturer: Arduino (www.arduino.cc)
[ 6609.948065] usb 1-2.3: SerialNumber: 7563830333735121D160
[ 6609.953998] usb 1-2.3: ep 0x82 - rounding interval to 1024 microframes, ep desc says 2040 microframes
And lastly the following is the output from ls -a /dev/tty*
/dev/tty /dev/tty18 /dev/tty28 /dev/tty38 /dev/tty48 /dev/tty58 /dev/ttyS1
/dev/tty0 /dev/tty19 /dev/tty29 /dev/tty39 /dev/tty49 /dev/tty59 /dev/ttyS2
/dev/tty1 /dev/tty2 /dev/tty3 /dev/tty4 /dev/tty5 /dev/tty6 /dev/ttyS3
/dev/tty10 /dev/tty20 /dev/tty30 /dev/tty40 /dev/tty50 /dev/tty60 /dev/ttyTHS1
/dev/tty11 /dev/tty21 /dev/tty31 /dev/tty41 /dev/tty51 /dev/tty61 /dev/ttyTHS3
/dev/tty12 /dev/tty22 /dev/tty32 /dev/tty42 /dev/tty52 /dev/tty62
/dev/tty13 /dev/tty23 /dev/tty33 /dev/tty43 /dev/tty53 /dev/tty63
/dev/tty14 /dev/tty24 /dev/tty34 /dev/tty44 /dev/tty54 /dev/tty7
/dev/tty15 /dev/tty25 /dev/tty35 /dev/tty45 /dev/tty55 /dev/tty8
/dev/tty16 /dev/tty26 /dev/tty36 /dev/tty46 /dev/tty56 /dev/tty9
/dev/tty17 /dev/tty27 /dev/tty37 /dev/tty47 /dev/tty57 /dev/ttyS0
I don't believe that a driver is being called to create /dev/ttyACM0 but I am not sure how to solve this issue. Any help would be great! Let me know if I need to update with the output from any other commands.
You haven't posted what the error is but I'm guessing it is an access type error, have you done the part at the end of the install for linux?
At the end of https://www.arduino.cc/en/Guide/Linux there is section on permissions for the serial port.

Resources