Hi all,
(sorry for re-sending, my first e-mail came from a different sender
address which wasn't recognized as subscribed)
for an embedded Linux project I'm trying to forward all audio from one
virtual machine (vm2) to another (vm1). So vm1 is responsible for playing
audio to the hardware. No PulseAudio involved, just plain ALSA.
All audio in vm2 is routed to one end of an aloop module, similar to what
is described in [1]. A simple Linux userland application (alsa-read) reads
the frames from the other end of the aloop module with readi() and forwards
the stream to vm1 using shared memory.
In vm1 there runs a simple Linux userland application (alsa-play) reading
the frames from shared memory and playing it to the local sound card with
writei(). The sound card supports a rate of 44100Hz.
In principle audio forwarding works so I can play files with aplay at vm2
and the playback at vm1 works. However, there is disturbing noise / crackles
when playing any sound with aplay on vm2. Playing the same sound on vm1
works with a reasonable quality.
Both Linux userland applications (alsa-read and alsa-play) do a proper
setup of the hw_params similar to [1]:
* rate=44100
* channels=2
* rate_resample=1
* access=rw_interleaved
* format=S16_LE
* buffer_time_near=20000us
The .asoundrc on vm2 looks like this:
# default playback goes to Loopback device
pcm.!default {
type plug
slave.pcm {
type dmix
ipc_key 2863
slave {
pcm "hw:loop0,0,0"
format S16_LE
channels 2
rate 44100
period_size 2048
buffer_size 8192
}
}
}
# Loopback device to capture from the playback stream
pcm.hubcap {
type plug
slave {
pcm "hw:loop0,1,0"
format S16_LE
channels 2
rate 44100
}
}
I wonder if I do something wrong or if there is another hw_params parameter
I need to set. Both applications, alsa-read and alsa-play, are started first
before I try to play the audio file.
Thanks in advance,
Frank
[1] http://www.pogo.org.uk/~mark/trx/streaming-desktop-audio.html
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Alsa-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-user