Delay in ALSA audio loopback how to resolve? - alsa

I am getting nearly 1 second delay in alsa audio capture and play loopback. While i checked there is no delay in capture, and for playback there is 1 second delay is coming.
Will you please tell me why the delay is coming and how can i resolve the problem.
Thanks,
Vijay Patil

Related

Saleae Logic Analyser not working with SPI Receive

I am using the STM32F5 Discovery board to connect with an accelerometer using a breadboard. I connect the Saleae Logic Analyser to the bread board to the MISO, MOSI, CS, VCC, CLK and ground of the sensor.
First I try monitoring the SPI Transmit function only. It is successful and I am able to see the response. Now when I add a new line of code of SPI Receive to the existing code, I am unable to see anything on the logic analyser. I tried checking the status of the SPI Received variable in the KEIL watch window, and nothing is appearing.
Now when I disconnect the Logic Analyser and if I observe the data from the watch window, it is working fine.
I think there is some interfence between the logic analyser hardware and the Discovery Board/Sensor Hardware.
Has anyone else faced a similar situation earlier? Please let me know the solution to this.
Thanks in advance.

how to capture audio by using dummy sound card driver?

I hope to know how to capture audio by using dummy sound card driver.
I'm thinking how to implement the steps below.
we play audio in ubuntu, however the audio is just played through dummy sound card driver, to capture audio stream.
captured audio is sent to windows through network.
audio is actually played in windows.
What you need is to activate ALSA snd-aloop module, that provides a full-duplex virtual loopback soundcard. Please have a look to the following links for instructions about activation and example usage:
https://github.com/TheSalarKhan/Linux-Audio-Loopback-Device
https://sysplay.in/blog/linux/2019/06/playing-with-alsa-loopback-devices/
A couple of important points to consider:
The subdevices are linked in pairs; whatever you play on hw:n,0,m goes out on hw:n,1,m (see the example in the 1st link)
The first application opening one of the subdevices will force the second application to use the same set of parameters: sample rate, format, number of channels. For example, suppose the recording application opens a capture stream on hw:2,1,0 with stereo/44100/S16_LE format; the playback application on hw:2,1,0 will be forced to use a the same stereo/44100/S16_LE format
Hope this helps

Problem while uploading code in arduino atmega2560

I have arduino atmega2560 when i upload blink code than it shows error
avrdude: stk500v2_ReceiveMessage(): timeout.
I have checked the COM port is correct also that the driver is correctly installed.
Why would I be receiving a timeout error?
The possible reasons:
Faulty communication cable
Wrong com port selected
Wrong device model selected
Baud rate settings
Driver related issues
I think your arduino got bricked. But first try to reconnect it and upload your program.
Second try to disconnect any rx or tx pin connected. Third if your arduino is bricked, try to check this article for full solution of bricked arduino. Programmer is not responding arduino

WPF MediaKit Audio Issues

I am currently using the WPF MediaKit in an application I am working on. I am having an issue with audio. On some computers playback would not work at all. It was confusing because it seemed to work sometimes and not others. Then I noticed it was failing to open the media because of an audio issue. If there are no audio devices connected the cannot open the audio stream and fails completely. This is a problem, we can tell people they have to connect speakers for the application to function. Is there a way I can tell it to just ignore the audio if this happens and still play the video? Here is the error I am getting.
System.Runtime.InteropServices.COMException (0x80040256): Cannot play back the audio stream: no audio hardware is available, or the hardware is not responding.
at DirectShowLib.DsError.ThrowExceptionForHR(Int32 hr)
at WPFMediaKit.DirectShow.MediaPlayers.MediaPlayerBase.AddFilterByDevice(IGraphBuilder graphBuilder, DsDevice device)
at WPFMediaKit.DirectShow.MediaPlayers.MediaPlayerBase.AddFilterByName(IGraphBuilder graphBuilder, Guid deviceCategory, String friendlyName)
at WPFMediaKit.DirectShow.MediaPlayers.MediaUriPlayer.InsertAudioRenderer(String audioDeviceName)
at WPFMediaKit.DirectShow.MediaPlayers.MediaUriPlayer.OpenSource()
0x80040256 is VFW_E_NO_AUDIO_HARDWARE "Cannot play back the audio stream: no audio hardware is available, or the hardware is not responding." which means that the system does not have audio output device to play to.
WPFMediaKit however assumes you have some, and attempts to create audio renderer unconditionally. That is, you have to edit this in WPFMediaKit code to work it around.

Send multiple commands to sleeping Xbee module

I have an xbee module in cyclic sleep mode that sleep for about 5 sec, then wake up for 500ms and the go to sleep again and so on... I need to send multiple commands to this module in api mode but I have a problem... when it sleep only the last message is sent from coordinator. In detail I need to set a digital pin in high state for about 200 ms and then in low state again... the problem is when the commands are sent when the module is sleeping... when it wake up only the second command (digital pin to low state) is sent from coordinator, so nothing happens. Any solution? Is there any possibility to send more commands in api mode in a single frame?
Thank you in advance.
Which XBee module are you using? Some of the modules support timeouts on their digital I/O. You can configure the module to revert to its configured value after some elapsed time (in multiples of 100ms).
That would be a more reliable way to generate a 200ms pulse on one of the digital outputs.
I'm not sure which modules support this feature -- check in X-CTU or the documentation. The commands at ATT0 through ATT9 to set timeouts on D0-D9 and ATQ0 through ATQ4 to set timeouts on P0-P4.
It's possible this is only available in the XBee Wi-Fi I have been using, and not the sleeping radios you're using.

Resources