PulseAudio static noise for 10 minutes after boot - audio

I am building a Bluetooth audio receiver as an embedded system with the CHIP sbc (single board computer) from getchip.com. Pretty similar to Raspberry Pi, runs Debian Jessie, too.
I am using the onboard 3.5mm jack as an audio output. I configured PulseAudio to receive the Bluetooth audio and redirect it to the ALSA sound driver.
Everything works flawlessly except for static noise on the output.
Directly after boot there is a medium loud sum in the few hundred Hz region.
It´s always in the background, even if I play something via bluetooth or locally via CLI.
The interesting part is that it disappears after exactly 10min and 10sec after powerup, so I think exactly 10min after the startup of PulseAudio or ALSA.
I couldn´t find a reason for it.
I tried the tsched=0 fix in /etc/pulse/system.pa
I unloaded the module suspend-on-idle in /etc/pulse/system.pa
And by the way, I´m running PulseAudio in system-mode, as I´m using it as an embedded system and not a multi-user configuration. I hope I get help from you anyway ;-)
Maybe you have an idea where this noise could come from?
It has to be some sort of software configuration issue, otherwise it wouldn´t disappear after exactly 10mins.
I´ll add the PulseAudio and ALSA configuration files later this day.
Thanks in advance!

Fortunately I solved the problem on my own:
The C.H.I.P. from NextThing has a 3.5mm TRRS jack, which does not only output stereo audio but component video as well.
Now if you plug in a standard 3.5mm jack, the ground pin does does interfere with the component video connector.
Thats why there was this humming noise on the audio output. And thats why it disappeared exactly after 10mins, because the screen idle time is 10min, I think.
So I have to admit, that it was indeed not a programming question as it was a connection issue. Thanks anyway for the quick answer!

Related

Audio IN over USB on STM32F4

I try to create a simple USB audio interface with audio IN and OUT on a custom board based on an STM32F412. The audio OUT (from host to target) is working, also with the help of the CubeMX setup for the audio device usb class. But somehow I can't figure out how the opposite way (from target to host) should work.
I see for audio out, AUDIO_PeriodicTC_FS gets called periodically (every 1ms) with the AUDIO_OUT_TC command. It never gets called with AUDIO_IN_TC. I tried to call HAL_PCD_EP_Transmit with some audio data, but the host doesn't get the input...
The descriptor should be right, at least I see both interfaces (in and out) show up on the host.
Is someone experienced in this or can provide some working examples?
Look here. Used and verified. It works. It may need some deeper modification if your chip doesn't have USB OTG
Ive created a simple USB headset on my stm32f4 discovery board. You can check it out, if you're interested:
https://github.com/ancher-bohdan/stm32_usb_interface
It is far from ideal, but it can play music from host and send recorded sound from analog mic to host

How can I receive Bluetooth audio signal and forward it to a Bluetooth speaker?

I need some help because I don´t know how to approach this challenge.
I want to build a device, that's receiving a Bluetooth audio signal and is forwarding it to a Bluetooth speaker. It´s also running some algorithms with the audio data and also simultaneously sending results via UDP to a different device.
I already thought about using two or three ESP32s, using one with an extra Bluetooth module, or searching for a whole different MCU with Bluetooth 5.0 or higher and Wifi 5GHz. But I don´t know approach the best is, or maybe a completely different one.
Some context, why we want to do it:
We want to create a real-time light show, based on the current playing song. It is already working for PC, but also want to make it accessible for phone users. Sadly there is no way to capture the internal audio on iPhone or Android phones. Our Idea to make the music sync with the phone possible is that you are connected with the phone via Bluetooth to our "sync box" which is then connected to the speaker via Bluetooth or AUX. The "sync box" is running our algorithms for creating the light shows and then sending the data to the microcontrollers from the light strips.
So maybe you have an idea how we can sync the lights to the music completely differently or how I can approach the challenge with Bluetooth.
Any help is highly appreciated.
Thanks a lot.

Headphones no sound

Today I've connected my bluetooth headphones(Ausdom M08) with PC(via bluetooth dongle).
When I open Skype or Discord I hear no sound on youtube, browser and so on. It only works on Skype and Discord - bad sound, not stereo.
I checked in Sounds Options and I have Ausdom M08 Stereo and Ausdom M08 Hands-Free. First one is default device and second one is default communication device.
When I try to force Skype and Discord to use that default device for sound output I hear no sound then, too!
What I tried:
-Disabling Hands Free Telephony, but I lose microphone function then.
-Tried to uninstall drivers and install again. Still the same.
-Disabling enhancements and exclusive controls of devices.
Literally I tried everything I found on internet or that I thought it can be.
Nothing works.
So the question is: How to make my PC output Stereo Sound from my headphones and still to be able to use microphone from it?
Thanks
There are a lot of missing information here: What PC dongle are you using? Which windows version?
From what I can see about the tech specs of Ausdom M08, it supports few basic profile (HSP/HFP/A2DP/AVRCP). A2DP profile lets you hear stereo audio (Ausdom M08 Stereo). HSP/HFP lets you use the microphone to Skype, but audio is limited to 8K-16K Hz sampling rate (Ausdom M08 Hands-Free). You can't use both Bluetooth profiles at the same time.
So to answer you question: You can't have stereo audio from your headphone while having microphone input.
There are proprietary codec developed by Qualcomm called aptX, which may support microphone over A2DP. But, you'll have to make sure both transmitter and receiver supports this codec.

Play audio as microphone input

I am to test voice recognition programs. Some which I have access to the code and others where I don't.
Sadly my (beautiful) voice is not perfect, so when I am reading a text it sounds slightly different each time. Which makes the testing difficult and time consuming. Giving that I can tweak a lot of parameters.
So I was wondering if there was a way to record my own voice (already done). And then play it as normal microphone input so the voice recognition program I am testing will see it as microphone input.
This would also help greatly if it could be done programatically in C#. So I can in my own code specify when to play what.
To play it from speakers and have the voice recognition programs listen to the microphone is not an option, because it is not the same sound on different computers/speakers/microphones.
Thanks.
Edit:
What i have found so far is to use a software sound Card simulator. But I haven't been able to find a suitable one.
Just as there are printer drivers that do not connect to a printer at all but rather write to a PDF file, analogously there are virtual audio drivers available that do not connect to a physical microphone at all but can pipe input from other sources such as files or other programs.
I hope I'm not breaking any rules by recommending free/donation software, but VB-Audio Virtual Cable should let you create a pair of virtual input and output audio devices. Then you could play an MP3 into the virtual output device and then set the virtual input device as your "microphone". In theory I think that should work.
If all else fails, you could always roll your own virtual audio driver. Microsoft provides some sample code but unfortunately it is not applicable to the older Windows XP audio model. There is probably sample code available for XP too.

DAC pops on Song Start/Stop in Raspbian

This has been a plaguing issue for the Raspberry Pi install of Raspbian (Debian Wheezy) since it was first built. Talking directly to the Raspberry Pi foundation and the Raspbian team has given me no luck.
The issue itself is that the DAC doesn't initialize until it starts playing a song. It then will turn itself off when done, causing another pop. When using this for a pure music player it is infuriating to say the least, especially when the pop is loud.
I have heard this on VLC, MOCP and MPD. This has been covered in the Pi forums, but no answers are found: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=38&t=8783
I turn to you at Stack Overflow to see if there is a way to solve this issue. My idea is to initialize it at start-up so the pop only happens when it boots up, though I don't know how to control the ALSA to do that.
Hopefully a solution can be found.
Thanks!
I've experienced the same crackling and popping noises on the Raspberry Pi's analog output when using mpd. The problem is also discussed here: https://github.com/raspberrypi/linux/issues/128
Your idea of configuring the audio hardware to be initialized only once at boot time is exactly what I did to solve the problem. It's possible to do this using the PulseAudio sound system, which works as a proxy between the audio hardware and programs that want to output sound. For example, audio players like mpd can be configured to use PulseAudio as audio backend.
PulseAudio has a configuration option (module-suspend-on-idle) that configures audio hardware sleep. Disabling audio hardware sleep fixed all crackling and popping noises for me.
I've outlined the necessary steps in closer detail on my blog: http://dbader.org/blog/crackle-free-audio-on-the-raspberry-pi-with-mpd-and-pulseaudio
I have the same problem and resolution is to use either USB audio or HDMI audio output (however converting hdmi audio to analog audio is not easy, converter >40$). It is caused by broadcom firmware. They were saying on rpi forum that it is on the list, but no one knows when it will be really fixed ...
Update: I have tried Creative Play! USB audio, it is the same, however the "click" is not that loud. So it is not 100% solution, we have to wait for the fix.
By using the Aureon Dual USB sound card I got zero popping from my raspi. Before I had popping at every song.
I have read that using the Aureon is impossible without limiting the usb ports to version 1.1, but this was not the case for me. It worked out of the box. One slight problem remains, I cannot insert the sound card when the raspi is on, it will reboot. But that's not a problem for me, I never remove the sound card.
My raspi runs raspbian wheezy and plays music via mpd and an nfs share.

Resources