uclinux on cortex development board no sound using alsa - alsa

I'm trying to run aplay on uclinux that running on STM32F7 emcraft developer board,
the board is connected to usb audio card and when trying to use aplay to play audio file nothing is coming from the speakers, the command that i'm running is
aplay -D hwplug:2,0 audio.wav
the output is
Playing WAVE 'audio.wav' : Signed 16 bit Little Endian, Rate 16000 Hz,
Mono
and nothing is playing, and its much slower then it should be about 2 seconds when the audio length is about half a second.
when trying to play with default:CARD=Device getting the next error
ALSA lib pcm_dmix.c:1000:(snd_pcm_dmix_open) unable to create IPC shm
instance
and with front:CARD=Device,DEV=0 getting this
aplay: set_params:1087: Channels count non available
so the only device that work but no sound is comming out is "plughw:2"
the output of aplay -L is:
null
Discard all samples (playback) or generate zero samples (capture)
default:CARD=Dummy
Dummy, Dummy PCM
Default Audio Device
sysdefault:CARD=Dummy
Dummy, Dummy PCM
Default Audio Device
default:CARD=Loopback
Loopback, Loopback PCM
Default Audio Device
sysdefault:CARD=Loopback
Loopback, Loopback PCM
Default Audio Device
default:CARD=Device
USB Audio Device, USB Audio
Default Audio Device
sysdefault:CARD=Device
USB Audio Device, USB Audio
Default Audio Device
front:CARD=Device,DEV=0
USB Audio Device, USB Audio
Front speakers
surround40:CARD=Device,DEV=0
USB Audio Device, USB Audio
4.0 Surround output to Front and Rear speakers
surround41:CARD=Device,DEV=0
USB Audio Device, USB Audio
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Device,DEV=0
USB Audio Device, USB Audio
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Device,DEV=0
USB Audio Device, USB Audio
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Device,DEV=0
USB Audio Device, USB Audio
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Device,DEV=0
USB Audio Device, USB Audio
IEC958 (S/PDIF) Digital Audio Output
I tried to use alsa api with the same resualt as aplay the code is reading the audio file in chunks and using "snd_pcm_writei" to play it, on the 5 loop the code is freezing and after about a second the control returns to the OS.
the only thing is working is arecord that is recording audio with no problems.
I tried to use different usb sound card, getting the same behavior.
where should I be looking for the problem?

Related

Pulseaudio sink does not exist at boot but accessible later

I have a laptop running Ubuntu 18.04 and i3wm connected via Thunderbolt to a dock and a webcam. I want that the default pulse audio sink is set to the laptops internal sound card.
Thus I have
set-default-sink alsa_output.pci-0000_00_1f.3.analog-stereo
set-default-source alsa_input.pci-0000_00_1f.3.analog-stereo
in /etc/pulse/default.pa .
This does not work, the default sink is set to the dock and the default source to the webcam after boot. Pulse audio informs me that
[pulseaudio] main.c: Source alsa_input.pci-0000_00_1f.3.analog-stereo does not exist.
[pulseaudio] main.c: Sink alsa_output.pci-0000_00_1f.3.analog-stereo does not exist.
Restarting pulse audio after boot sets the default source and sink to laptops internal audio card as specified in the config.
How can I debug this problem?

print data to different terminal IAR

I am working on a project which contains acquisition of ECG data with the ADS1293EVM. MSP430F5529 is part of this board as well. For the communication between analog part of the board and microcontroller, I am using SPI and there is also FET Debugger from TI to program the microcontroller. Now I am printing data using printf to a terminal I/O which is part of the IAR software.
However, I would like to print ECG data to the terminal app in PC or to LabView, not in Terminal I/O in IAR software. The board is connected to the PC by USB so there is UART port in device manager. Is there any possibility?
Yes it is possible. You can push all the data on UART which is used in communication between PCB and PC. Than you can use any serial monitor for getting data displayed.
The only connection between your board and the PC is USB, so you have to implement a virtual USB COM port (CDC). TI's USB stack implements such an interface.

Data transfer using xbee and arduino

i have a portable device that consist of
arduino leonardo board,xbee series 2 as router( AT mode ) and different sensors.This portable device acts as a remote device and can be used upon power up.
The other side, i have a host controller that consist of arduino uno board, arduinoxbee shield v1.1, and xbee series 2 as coordinator( AT mode ). This host controller is plug through USB into my PC.
The aim of my project is to send the sensor data from the portable device using xbee wirelessly over to my host controller and displaying out on the arduino serial monitor.
I've managed to configured the two xbees. But now, i'm unsure of how im going to transmit and receive the data. I need a transmitter and receiver program for both xbees that is connected to the arduino. Anyone can help please?
There are a couple different options for how you can do this, but the simplest is to set up your sensor XBee either in change detect (IC) mode, or set a sample rate (IR). In either case you'll need to handle the RX Indicator frame at the controller, which will contain the sampled data.
I wrote a C# stack that can configure all this, but for what you're trying to do it would probably only be useful as a reference (https://github.com/jefffhaynes/XBee).

Play back Bluetooth audio Streaming using Gstreamer

I have started audio streaming from my Android Phone. I am able to play it in my laptop using pulse audio module loop back. But I wanted to play it using gstreamer. How would this be done?
How do you start the stream on the phone? How do you play it on the laptop (loop back from what source)?
A general starting point for gstreamer is gst-launch playbin2 uri="...". The first thing on the URI is the protocol (e.g. rtsp:// or http://) then your phones IP address, then the location of the stream (if needed).

Android/iOS app to encode a2dp stream other than SBC

I've been looking for a solution to my problem but haven't been able to find any yet. Does anybody have knowledge of any mobile application for android or iOS that basically uses other codec than SBC for audio streaming over bluetooth? I actually need the device to stream AC3.
Thank you
The codec support should be in the underlying bluetooth implementation of the device.
SBC is default and required for all bluetooth devices that support A2DP Audio streaming.
Additional codecs can be supported by the devices, for example the iPhone (iOS devices) support the AAC codec.
Also note that for a particular codec to be chosen the same needs to be supported on the remote (headset) device also.
So if you have an AAC capable headset then the iPhone will choose AAC over SBC for audio streaming.
Hope it helps

Resources