Raspberry Pi 3 recording sound noises - audio

I'm trying to build a speech to text / speech recognition with my gaming headset (Creative Technology, Ltd Sound Blaster Tactic(3D) Sigma sound card). The usb soundcard is now working, however there's a white noise when i record a sound.
I've tested the mic in my windows machine and it works fine, but when i plug it in RPi 3 suddenly there's a noise. Not sure what's causing it, i've also tried distancing the Power cable and Net cable from the sound card but it's the same.
Can someone help me figure out what's causing it? Thanks in advance!
To record:
pi#raspberrypi:~ $ arecord xtest.wav
To play
pi#raspberrypi:~ $ aplay xtest.wav

Update
Fixed by adding -f option. pi#raspberrypi:~ $ arecord -f cd xtest.wav

Related

Manjaro Linux KDE - no sound

I have a problem with my Manjaro Linux. I have no sound. I have tried everything (I have installed sof-firmware, unmuted soundcard, rebooted alsa). What should I do?
Here is the output of the inxi:
System: Host: cWillNeverDie Kernel: 5.13.19-2-MANJARO x86_64 bits: 64 Desktop: KDE Plasma 5.22.5 Distro: Manjaro Linux Machine: Type: Desktop Mobo: Micro-Star model: MAG Z490 TOMAHAWK (MS-7C80) v: 1.0 serial: <superuser required> UEFI: American Megatrends v: 1.80 date: 04/19/2021 Audio: Device-1: Intel driver: snd_hda_intel Sound Server-1: ALSA v: k5.13.19-2-MANJARO running: yes Sound Server-2: PulseAudio v: 15.0 running: yes Sound Server-3: PipeWire v: 0.3.38 running: yes
Try to open terminal and run aplay -l. You'll get something like:
card 1: Generic [HD-Audio Generic], device 0: ALC236 Analog [ALC236 Analog]
Take notes each of card numbers and device numbers. For above example: card number 1 and device number 0.
Then run speaker-test -D hw:CardNumb,DeviceNumb -c 2. For above example become:
speaker -D hw:1,0 -c 2
If you get an error mentioning device busy, close all current active windows, wait a moment and run again. Do this for all cards and devices shown from aplay -l.
Take note which card and device that give you a sound.
After that, find on how to create .asoundrc on the internet.
Hope this give a clue how to debug your sound card.
Sorry if this reply is too late. I was having the same problem, tried every input I could find, and nothing worked. Until...
Go to:
audio system settings
playback devices
change to: analog stereo duplex
That fixed it for me, fwiw.
I have the same issue whenever my laptop comes out of sleep mode.
The following workaround works for me:
unplug Headset (if there is any)
switch sound output to another Device (e.g. from monitor to internal speaker)
Then everything works again for me
For proper analysis of the problem have a look into the answer by oprizal

How to integrate Bluetooth headphones to control playback on Linux (Mint) players?

My headphones are WH-1000xm3. System being used is Linux Mint.
How to make playback work?
install playerctl
wget http://ftp.nl.debian.org/debian/pool/main/p/playerctl/libplayerctl2_2.0.1-1_amd64.deb
wget http://ftp.nl.debian.org/debian/pool/main/p/playerctl/playerctl_2.0.1-1_amd64.deb
sudo dpkg -i libplayerctl2_2.0.1-1_amd64.deb playerctl_2.0.1-1_amd64.deb
install xbindkeys
Add command to a ~/.xbindkeysrc file:
"playerctl play-pause"
m:0x0 + c:208
XF86AudioMute
This way you can control chrome, vlc, video/audio players playback remotely via your headphones
This is tested for Linux Mind 19.3 Tricia with Sony WH-1000XM3

Pulseaudio no audio via bluetooth a2dp connection buildroot

Edit:
I discovered, that if I run parec | paplay --raw it does play back properly.
How is this possible? There should be just a simple module-loopback error or something like that.
I´m using the CHIP SBC from getchip.com to build an embedded bluetooth audio receiver.
getchip.com offers a debian linux and a customizable buildroot distribution.
I got everything working on the debian distribution with one exception. The volume control with iOS devices don´t work because of the lack of uinput inside the debian kernel.
That´s why i tried to get it to work with the buildroot distribution. It took me a while to get bluetoothd running with simple-agent, as well as pulseaudio built with bluetooth support and the dbus configuration.
I finally got everything ready.
But:
I can connect to the sbc, but there is no sound playing on the headphone jack.
My debugging steps so far:
I´m able to play a local .wav file via paplay
just fine.
I allowed every communication via dbus
the pulseaudio logs show, that sound is coming from the bluetooth source.
the module-switch-on-connect does spawn a loopback from the bluetooth source to the same audio sink as paplay uses.
Debug Logs:
Boot log
Pulseaudio verbose startup
/usr/bin/pulseaudio -vvvv --system --daemonize --disallow-exit
Bluetoothd verbose connection
/usr/libexec/bluetooth/bluetoothd -C -d &
and the bt-agent:
/usr/bin/bt-agent -d -c NoInputNoOutput -p /home/cubbo/.config/bluetooth-default-pin
Pulseaudio verbose connection
Configuration:
Pulseaudio system.pa
Pulseaudio daemon.conf
dbus system.conf
dbus-1/system.d/bluetooth.conf
dbus-1/system.d/pulseaudio-bluetooth.conf
bluetooth/audio.conf
bluetooth/main.conf
I´m pretty sure that I just miss some little configuration and it´ll play just fine. But after nearly one week of debugging I wanted to ask you for help.
I hope I´ve done everything right with attaching the logs via pastebin.
I would appreciate your help!
Thanks!
Greetings, Phil.
I had a similar problem on Antergos, A2DP was not available in pulseaudio.
A2DP was available only when restarting bluethooth service by "systemctl restart bluethooth"
It resulted to be a problem caused by GDM that opened another instance of pulseaudio and captured the bluethooth device. I prevented pulseaudio capturing bluethooth device by masking it for GDM user.
https://wiki.archlinux.org/index.php/Bluetooth_headset#Connecting_works.2C_but_I_cannot_play_sound
$ mkdir -p ~/.config/systemd/user
$ ln -s /dev/null ~/.config/systemd/user/pulseaudio.socket
[restart required]

Enable Bluetooth Adapter for BeagleBone Black

I recently bought a USB 2.0 Bluetooth Adapter. It claims to have support from Linux kernels of versions 3.4 and higher. I have a BeagleBone Black with Debian GNU/Linux 7 image and kernel 3.8. I am developing on BeagleBone Black by hosting it through USB with ssh.
I have tried both hot plugging and plugging in before boot and failed.
Then, I tried this tutorial. However, I cannot find the connman directory on my BeagleBone Black device. I looked up and assumed I needed to install the connman package, but my BeagleBone Black has no internet access.
I have also tried lsusb -v, as suggested by an answer of a similar question to this, with no luck. The weird thing is, while lsusb itself prints
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
lsusb -v only prints
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
then hangs. Information regarding bus 002, which I believe the device is connected to, is not printed. I have to restart the ssh connection to get back to work.
How should I approach to get the dongle to work on my BeagleBone Black? If the connman package is sufficient, how do I install it on my BeagleBone Black without internet access. Why does lsusb -v hang?
Any help is appreciated!
UPDATE:
The actual problem turned out to be that my BeagleBone Black is flawed/damaged. I plugged the Bluetooth Adapter into a plain new BeagleBone Black before powering it, and the Bluetooth Adapter is recognized! Not only does lsusb prints out the adapter info, but also lsusb -v does not hang at all. The overall performance of the new board (boot time, compilation time, execution time) is also several times better. I suspect that it was due to the various improper power-off.
In case anyone is just as careless, the BeagleBone Black SHALL be powered off by:
Holding down the power button for about 8 seconds then releasing it.
Using halt or shutdown -h now command in the Userspace.
I have possible 4 solutions for you:
1) download the connman package and save it to a usb flashdrive. Connect the flashdrive to the beaglebone and install the package using the following command: dpkg -i {.deb package}.
2) download the connman package on your desktop computer and ssh into your beaglebone. once you ssh in you could copy the file trough ssh using scp. Note the syntax $ scp your_username#remotehost.edu:foobar.txt /some/local/directory. Then install the connman package using dpkg -i {.deb package}.
3) share your desktop computers internet connection with the beaglebone and ssh into the beaglebone. Download the package directly using apt-get or wget whatever tool you prefer.
4) connect your beaglebone to your router using rj-45 cable. Maybe this is not your preferred solution but it's easy and after port forwarding you will have access to your beaglebone from anywhere.
Hope this helps and note that I never used a bluetooth adapter with a BBB. I'm just giving generic instructions on your general problem.

Can`t find ttyUSB[id]

I have just started with my Raspberry Pi and I have a project where I want to read data from the USB port. I have installed Java JDK8 and written the program that compiles and run. But I get the message that /dev/ttyUSB1 does not exist.
I just have a cable from the USB port on the Arduino going to the USB port on the RPi and I am using Raspbian Debian Wheezy
When I go to DIR /dev/ and use $ ls, I can only find tty0 up to tty63. I have searched on the internet and some say that you can use ttyAMA0, but this does not work. I have also searched for the same problem, but have not found a answer to my problem.
I have used $ lsusb which gave me 4 devices (001-004) on Bus 001. I can see that, for example, my USB keyboard is listed as Bus 001 Device 004: ID 1532:010b Razer USA, Ltd.
and if I run $ dmesg | grep Manufacturer I get that:
[xxxxxxxxx] usb 1-1.2: Manufacturer: Razer
So my question is why does my usb devices not get listed as ttyUSB[id]? Do I have to manually attach it?
I am a bit noob when it comes to Linux.
Hope someone can help me!
I have some bad news for you. The reason you have no /dev/ttyUSB[n] devices on the RPi (when you connect your Arduino) is because you need the Arduino drivers (FTDI drivers in particular). The unfortunate thing is that these drivers don't yet exist for the Arm platform (which includes the RPi). This is according to the FTDI web page showing support. Note the lack of Linux driver support for Arm.
Apparently on Arm running Linux the only way to program the Arduino is via the serial port interface directly via the GPIO pins. Information on doing this can be found here . You will also have to do something similar on the Arduino side see this information.
Once you have the two devices connected via straight serial then your going to probably run into another SNAFU. By default apparently on the RPi Linux will use the serial port for sending debug/console output. In order to use the serial interface for something that behavior has to be modified. This article discusses that. In particular disabling the kernel from using the serial port for terminal use this would seem to apply:
The following steps (based on a clean 2012-07-15-wheezy-raspbian install
Open a terminal on the Raspberry, or connect to Raspberry Pi through SSH.
Make a backup of the /boot/cmdline.txt file.
sudo cp /boot/cmdline.txt /boot/cmdline_backup.txt
Edit /boot/cmdline.txt file:
sudo vi /boot/cmdline.txt
This file contains:
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 $
Remove the parameters that reference the UART serial port (ttyAMA0):
dwc_otg.lpm_enable=0 console=tty1 $
Comment next line in /etc/inittab:
T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
Reboot Raspberry Pi
sudo reboot
If you use a different Linux distro than Debian it would be different but the basics would still apply (modifying the kernel command line)

Resources