Multiple ALSA sound stream in Embedded Linux? - linux

Currently In my embedded linux I can not open multiple ALSA sound stream. What I need is to have different sound playing at a time. Like one application is playing video and other playing some wav file at a same time.
Thanks,
Sunny.

Is dmix enabled? If it is not possible, you need a software mixing daemon, like pulseaudio.

Related

Alternative to ALSA dmix

In an embedded Linux project I have exactly two processes that need to access the audio device. So far I'm using ALSA dmix for that. However, dmix is giving me a lot of trouble (as explained in this question).
Now I'm wondering - are there any simple alternatives to dmix? I can imagine that PulseAudio is doing a much better job, but I'm not sure if its not an overkill to bring a general-usage sound server into a small embedded project, just for mixing two audio streams.

Read loopback audio on linux

I'm trying to make an audio visualizer on Linux but I can't seem to find any library that allows me to read the sound levels of the audio of the system. All the libraries I seem to come across seem to either be for reading the microphone or for recording the system audio.
I've tried using pyaudio but for some reason, I've only been able to open the microphone and while the program is running the audio coming out of the speakers then gets distorted.
edit: I'm using PulseAudio but I would be fine switching to another sound driver like alsa, etc.

Can PulseAudio/ALSA work without built-in soundcard?

I am new to PulseAudio and ALSA, so please go easy on me. This might seem like a dumb question, but it is quite important to have it answered.
I am developing application on ARM imx6 board (lets call it BOARD1), with built-in sound card support. With ALSA, I am able to play audio throgh Headset_OUT. But now, we want to move to a new board (lets call it BOARD2), which does not have built in soundcard. But the idea is to connect a bluetooth module to the BOARD2 and have the audio streamed to the bluetooth speaker.
My question is, is it possible to use PULSEAUDIO to send/receive audio to external (bluetooth) audio device without local embedded soundcard (i.e. is it possible to do audio encoding/decoding in just software with pulseaudio and gstreamer combination) ?
Regards

How to do audio stream processing in Linux(RPi) via C?

Hej
I would like to build an audio effect into a RPi. This effect should be programmed in C. I am not familiar with the software audio interfaces in Linux. The ALSA interface looks very complicated. Port Audio seems to be an alternative.
Any ideas(maybe with a tutorial)?
With some work you can also get OpenAL to stream and render audio using c language - then you could perform your processing in that context ...
Node.js is available on RPi which offers audio modules
PortAudio seems the best approach. A good tutorial can be found here:
http://portaudio.com/docs/v19-doxydocs/tutorial_start.html
Sometimes the Interface configuration needs to be done manually.

Playing multiple audio streams simultaneously from one audio file

I have written an application that receives media files from a central server and plays those files according to a playlist. All works well.
A client has contacted us and wants to use our application to play some audio files as presentations in a kiosk-style application. So far, so good, our application can handle this no problems.
He has requested as a potential feature that we would have a number of headphone sockets at the front of the kiosk. Each headphone socket would play the same audio presentation in a different language.
I have come up with the idea of encoding a single audio file with the presentation in multiple languages, and each language in a different channel. We would then require a sound card that could decode each channel and output it on a different headphone socket.
Thing is, while I'm think the theory is sound, I have absolutely no idea whether this is feasible and what would be required to pull it off.
Any ideas?!
As a side-note: the application uses Media Player as the underlying component to handle the playback of audio and video. I'd appreciate any help as to the software we could use to generate the multi-channel audio stream and the hardware (USB sound card would be fine) that we could use to decode the stream.
Thanks!
You need to use multiple files not channels, its going to be way easier that way.
Instead of using Media Player use DirectShow (on .NET you have DirectShow.NET), In DirectShow you have the notation of Multiple files on the same graph.
You will be able to control to which audio device play which files, and your Play, Pause, Stop commands will be preformed on all files without you need to worry about syncing.
There are many samples on how to build media player like with DiectShow, extending them to use multiple files should be really easy.
For HW take a look at this (USB with 8 output channels)
I think with Shay's hardware you've got a complete solution:
Encode a 7.1 file with a different mono voice track on each channel.
Use the 8 channel output device in 7.1 mode, with a different headset in each port, and you've got it. Or, if you only have 6 languages, a 5.1 file would work. Many PC's have 5.1 outputs built in, you'd only need 3 splitters to break out the left and right channels from each jack.
You can do the encoding with Windows Media Encoder, or other pro audio tool.

Resources