[alsa-devel] virtual sound driver
I'm trying to write a virtual sound driver to capture PCM data. How do I modify dummy.c to capture PCM into buffer?
Does the PCM data ever sent to any of the pcm_op call backs? There's no read/write callbacks?
Thanks so much.
George
At Fri, 20 Jul 2012 18:05:40 -0700, Liu, George wrote:
I'm trying to write a virtual sound driver to capture PCM data. How do I modify dummy.c to capture PCM into buffer?
Does the PCM data ever sent to any of the pcm_op call backs? There's no read/write callbacks?
Did you take a look at aloop driver?
Takashi
I'm still lost looking at the code. I understand the part to register/remove driver and card. One thing on my head is what exactly are the functions in snd_pcm_ops do, and what event will trigger them?
.open .close .ioctl (use snd_pcm_lib_ioctl implementation, nothing I need to do) .hw_params .hw_free .prepare .trigger .pointer
I added printk in each of the function in aloop, and right after loading the module, dmesg reports whole bunch of pcm_ops.
* The sequence for each pcm seems to be: Open -> hw_params -> hw_free -> close * What determines how many times open->hw_params->hw_free->close is going to be called? Number of snd_pcm or substreams? *Why pcm_trigger_start is being called? *If I want to capture playback audio, should I capture the substream associated with the trigger (playback)?
Thanks so much. George
-----Original Message----- From: alsa-devel-bounces@alsa-project.org [mailto:alsa-devel-bounces@alsa-project.org] On Behalf Of Takashi Iwai Sent: Saturday, July 21, 2012 1:28 AM To: Liu, George Cc: alsa-devel@alsa-project.org Subject: Re: [alsa-devel] virtual sound driver
At Fri, 20 Jul 2012 18:05:40 -0700, Liu, George wrote:
I'm trying to write a virtual sound driver to capture PCM data. How do I modify dummy.c to capture PCM into buffer?
Does the PCM data ever sent to any of the pcm_op call backs? There's no read/write callbacks?
Did you take a look at aloop driver?
Takashi _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
I installed aloop driver, and selected it as the default Audio input and output device.
Then, I played a pcm file while also started recording (using the sound recorder in Ubuntu 11.04). I'm expected to record what I'm playing, but there's no sound in the captured wav file. Did I do anything wrong?
I want to use aloop or dummy driver as the starting point to write my own driver. Thanks for helping me out. George
-----Original Message----- From: alsa-devel-bounces@alsa-project.org [mailto:alsa-devel-bounces@alsa-project.org] On Behalf Of Takashi Iwai Sent: Saturday, July 21, 2012 1:28 AM To: Liu, George Cc: alsa-devel@alsa-project.org Subject: Re: [alsa-devel] virtual sound driver
At Fri, 20 Jul 2012 18:05:40 -0700, Liu, George wrote:
I'm trying to write a virtual sound driver to capture PCM data. How do I modify dummy.c to capture PCM into buffer?
Does the PCM data ever sent to any of the pcm_op call backs? There's no read/write callbacks?
Did you take a look at aloop driver?
Takashi _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
On 21.07.2012 03:05, Liu, George wrote:
I'm trying to write a virtual sound driver to capture PCM data. How do I modify dummy.c to capture PCM into buffer?
Does the PCM data ever sent to any of the pcm_op call backs? There's no read/write callbacks?
Did you consider using some higher layer like PulseAudio to achive that?
Daniel
participants (3)
-
Daniel Mack
-
Liu, George
-
Takashi Iwai