-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement VirtIO sound device playback
The limitations are listed as follows: 1. The emulator will hang if PulseAudio is enabled on host. The reason is that the host OS cannot close CNFA driver because CNFA driver reference count is not zero (PulseAudio holds one reference count). What's worse, CNFA cannot initialize if PulseAudio is disabled, As it needs a dedicated threading model (CNFA uses different threading models between pure ALSA and PulseAudio environment), we suggest users need mitigations (for instance, restart the emulator after playing sound) or just wait for the future release. 2. The playback may play with repeating artifact (for example, A "front center" ALSA example sound will sound like "front front center"). The root cause is the Linux Kernel and it hasn't got fixed even in mainline version. See https://lore.kernel.org/all/[email protected]/T/ for more information.
- Loading branch information
Showing
14 changed files
with
1,479 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[submodule "cnfa"] | ||
path = cnfa | ||
url = https://github.com/cntools/cnfa | ||
shallow = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Create a mininal ALSA program | ||
define create-alsa-prog | ||
echo '\ | ||
#include <alsa/asoundlib.h>\n\ | ||
int main(){\n\ | ||
snd_pcm_t *pcm;\n\ | ||
snd_pcm_open(&pcm, "default", SND_PCM_STREAM_PLAYBACK, 0);\n\ | ||
snd_pcm_close(pcm);\n\ | ||
return 0;\n\ | ||
}\n' | ||
endef | ||
|
||
# Create a mininal Core Audio program | ||
define create-coreaudio-prog | ||
echo '\ | ||
#include <CoreAudio/CoreAudio.h>\n\ | ||
int main(){\n\ | ||
AudioComponent comp;\n\ | ||
comp = AudioComponentFindNext(NULL, &desc);\n\ | ||
if (comp == NULL) exit (-1);\n\ | ||
return 0;\n\ | ||
}\n' | ||
endef | ||
|
||
# Check ALSA installation | ||
define check-alsa | ||
$(shell $(call create-alsa-prog) | $(CC) -x c -lasound -o /dev/null > /dev/null 2> /dev/null - | ||
&& echo $$?) | ||
endef | ||
|
||
# Check Core Audio installation | ||
define check-coreaudio | ||
$(shell $(call create-coreaudio-prog) | $(CC) -x c -framework CoreAudio -o /dev/null > /dev/null 2> /dev/null - | ||
&& echo $$?) | ||
endef |
Oops, something went wrong.