All of lore.kernel.org
 help / color / mirror / Atom feed
* How do create a dummy device for recording audio?  Does it exist already?
@ 2004-04-22 13:44 Caleb Crome
  2004-04-22 14:50 ` Paul Davis
  2004-04-22 20:33 ` Arek Korbik
  0 siblings, 2 replies; 12+ messages in thread
From: Caleb Crome @ 2004-04-22 13:44 UTC (permalink / raw)
  To: alsa-devel

Hello,
      I've looked through the archives and I couldn't find what I'm 
looking for, so here goes:

I'd like to create a dummy audio device that can record the PCM data 
written to it into a file.  So, the dummy device would appear as a sound 
card to the audio program (Real Player for example), and start dumping 
audio into a file, or maybe it would create another device that could be 
read simply by 'dd' or some custom command.  Then I'd pipe the data into 
an MP3 or OGG encoder, split into 1/2 hour chunks, or whatever length 
chunks I like.

Once the system is running, I'd do something like this:

1) Open my Player, tune to my favorite station. Use my new device for 
audio output.
2) do something like:  dd if=/dev/audiocapturepcmout count=xxx | lame 
--output myfile.mp3

What would it take to make a alsa drive that captures the PCM data into 
a file?
How about one that captures it, then pumps it into a new /dev/ device 
for reading?

Thanks,
  -Caleb



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: How do create a dummy device for recording audio? Does it exist already?
  2004-04-22 13:44 How do create a dummy device for recording audio? Does it exist already? Caleb Crome
@ 2004-04-22 14:50 ` Paul Davis
  2004-04-22 17:14   ` Caleb Crome
  2004-04-22 20:33 ` Arek Korbik
  1 sibling, 1 reply; 12+ messages in thread
From: Paul Davis @ 2004-04-22 14:50 UTC (permalink / raw)
  To: Caleb Crome; +Cc: alsa-devel

>1) Open my Player, tune to my favorite station. Use my new device for 
>audio output.
>2) do something like:  dd if=/dev/audiocapturepcmout count=xxx | lame 
>--output myfile.mp3

streamripper is a much better option for this. its specially designed
for this task. you are also talking about mp3->PCM->mp3 conversion,
which is not very nice for audio quality.

http://streamripper.sf.net/

--p


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: How do create a dummy device for recording audio? Does it exist already?
  2004-04-22 14:50 ` Paul Davis
@ 2004-04-22 17:14   ` Caleb Crome
  0 siblings, 0 replies; 12+ messages in thread
From: Caleb Crome @ 2004-04-22 17:14 UTC (permalink / raw)
  To: Paul Davis; +Cc: Caleb Crome, alsa-devel

StreamRipper:  Close, but no cigar.  That only works for MP3 streams, 
not for other streams, such as RealPlayer.  I have looked at 
streamripper before and it doesn't do what I want as far as I can tell.  
In the case of RealPlayer, the audio goes from Real->PCM->MP3, which I 
admit isn't great for audio quality, but I don't really care, I'm not 
trying to listen to music.  In fact, that would be an extraordinarily 
hard way to get music.  I actually want it mainly so that I can record 
NPR constantly and have 30 minutes blocks automatically encoded and 
sitting on my hard drive.  Then when I come in to a show half way, and 
what to hear the whole thing, I just grab the files and burn them to MP3 
CD.  Then I can listen to CarTalk or whatever whenever I want, on my 
terms. 

Paul Davis wrote:

>>1) Open my Player, tune to my favorite station. Use my new device for 
>>audio output.
>>2) do something like:  dd if=/dev/audiocapturepcmout count=xxx | lame 
>>--output myfile.mp3
>>    
>>
>
>streamripper is a much better option for this. its specially designed
>for this task. you are also talking about mp3->PCM->mp3 conversion,
>which is not very nice for audio quality.
>
>http://streamripper.sf.net/
>
>--p
>
>  
>



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: How do create a dummy device for recording audio? Does it exist already?
  2004-04-22 13:44 How do create a dummy device for recording audio? Does it exist already? Caleb Crome
  2004-04-22 14:50 ` Paul Davis
@ 2004-04-22 20:33 ` Arek Korbik
  2004-04-22 21:24   ` Caleb Crome
  1 sibling, 1 reply; 12+ messages in thread
From: Arek Korbik @ 2004-04-22 20:33 UTC (permalink / raw)
  To: Caleb Crome; +Cc: ALSA Devel

On Thu, 2004-04-22 at 14:44, Caleb Crome wrote:
> I'd like to create a dummy audio device that can record the PCM data 
> written to it into a file.  So, the dummy device would appear as a sound 
> card to the audio program (Real Player for example), and start dumping 

How about 'file' type plugin? For example:

pcm.file {
    type file
    slave {
        pcm "hw:0,0"
    }
    file "/tmp/file.raw"
}                                                                              
> audio into a file, or maybe it would create another device that could be 
> read simply by 'dd' or some custom command.  Then I'd pipe the data into 

It works with named pipes as well.

http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html#pcm_plugins_file

Arek



-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: How do create a dummy device for recording audio? Does it exist already?
  2004-04-22 20:33 ` Arek Korbik
@ 2004-04-22 21:24   ` Caleb Crome
  2004-04-23 10:41     ` Takashi Iwai
  2004-04-23 15:56     ` Clemens Ladisch
  0 siblings, 2 replies; 12+ messages in thread
From: Caleb Crome @ 2004-04-22 21:24 UTC (permalink / raw)
  To: Arek Korbik; +Cc: Caleb Crome, ALSA Devel

Arek,
    That looks like what I want.  However, I'm sorry to be such an 
ignoramus -- what do I do with that bit of configuration data?  I found 
the /usr/share/alsa/alsa.conf, and there is a similar pcm.file entry in 
that, but it seems to take parameters.  Since I have no sound card, how 
do I configure my system to use the dummy PCM driver and use the 
pcm.file plugin? 

Sorry to the developer community -- this is a user question.  I'll move 
the thread over there if it continues on. 

Thanks,
    -Caleb


Arek Korbik wrote:

>On Thu, 2004-04-22 at 14:44, Caleb Crome wrote:
>  
>
>>I'd like to create a dummy audio device that can record the PCM data 
>>written to it into a file.  So, the dummy device would appear as a sound 
>>card to the audio program (Real Player for example), and start dumping 
>>    
>>
>
>How about 'file' type plugin? For example:
>
>pcm.file {
>    type file
>    slave {
>        pcm "hw:0,0"
>    }
>    file "/tmp/file.raw"
>}                                                                              
>  
>
>>audio into a file, or maybe it would create another device that could be 
>>read simply by 'dd' or some custom command.  Then I'd pipe the data into 
>>    
>>
>
>It works with named pipes as well.
>
>http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html#pcm_plugins_file
>
>Arek
>
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
>For a limited time only, get FREE Ground shipping on all orders of $35
>or more. Hurry up and shop folks, this offer expires April 30th!
>http://www.thinkgeek.com/freeshipping/?cpg=12297
>_______________________________________________
>Alsa-devel mailing list
>Alsa-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/alsa-devel
>
>  
>



-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: How do create a dummy device for recording audio?  Does it exist already?
  2004-04-22 21:24   ` Caleb Crome
@ 2004-04-23 10:41     ` Takashi Iwai
  2004-04-23 15:56     ` Clemens Ladisch
  1 sibling, 0 replies; 12+ messages in thread
From: Takashi Iwai @ 2004-04-23 10:41 UTC (permalink / raw)
  To: Caleb Crome; +Cc: Arek Korbik, ALSA Devel

At Thu, 22 Apr 2004 14:24:30 -0700,
Caleb Crome wrote:
> 
> Arek,
>     That looks like what I want.  However, I'm sorry to be such an 
> ignoramus -- what do I do with that bit of configuration data?  I found 
> the /usr/share/alsa/alsa.conf, and there is a similar pcm.file entry in 
> that, but it seems to take parameters.  Since I have no sound card, how 
> do I configure my system to use the dummy PCM driver and use the 
> pcm.file plugin? 

you can specify the filename as the parameter of file plugin.
for example,

	% aplay -Dfile:foo.raw bar.wav

will dump bar.wav as the raw sample data to a new file foo.raw.


Takashi


-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: How do create a dummy device for recording audio? Does it exist already?
  2004-04-22 21:24   ` Caleb Crome
  2004-04-23 10:41     ` Takashi Iwai
@ 2004-04-23 15:56     ` Clemens Ladisch
       [not found]       ` <4089663E.4000200@crome.org>
  1 sibling, 1 reply; 12+ messages in thread
From: Clemens Ladisch @ 2004-04-23 15:56 UTC (permalink / raw)
  To: Caleb Crome; +Cc: ALSA Devel

Caleb Crome wrote:
> Arek Korbik wrote:
> >pcm.file {
> >    type file
> >    slave {
> >        pcm "hw:0,0"
> >    }
> >    file "/tmp/file.raw"
> >}
>
> what do I do with that bit of configuration data?  I found the
> /usr/share/alsa/alsa.conf, and there is a similar pcm.file entry
> in that, but it seems to take parameters.

Put it into your ~/.asoundrc file, or into /etc/asound.conf for all
users.

> Since I have no sound card, how do I configure my system to use
> the dummy PCM driver and use the pcm.file plugin?

"modprobe snd-dummy" should work.


HTH
Clemens




-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: How do create a dummy device for recording audio? Does it exist already?
       [not found]       ` <4089663E.4000200@crome.org>
@ 2004-04-23 21:00         ` Caleb Crome
  2004-04-26 16:29         ` Clemens Ladisch
  1 sibling, 0 replies; 12+ messages in thread
From: Caleb Crome @ 2004-04-23 21:00 UTC (permalink / raw)
  To: Caleb Crome; +Cc: Clemens Ladisch, Caleb Crome, ALSA Devel

Caleb Crome wrote:

> Alright, I did what you suggested, and real player comes up and 
> connects to the dummy sound card (I had to do a modprobe snd-pcm-oss 
> and snd-mixer-oss).   However, I don't get a file called 
> /tmp/file.raw.  Is there any way to check how the data is routed? 
> Do I have to do anything to make .asoundrc get reread?
>
>
> Thanks again,
>   -Caleb
>
> Clemens Ladisch wrote:
>
>> Caleb Crome wrote:
>>  
>>
>>> Arek Korbik wrote:
>>>   
>>>
>>>> pcm.file {
>>>>   type file
>>>>   slave {
>>>>       pcm "hw:0,0"
>>>>   }
>>>>   file "/tmp/file.raw"
>>>> }
>>>>     
>>>
>>> what do I do with that bit of configuration data?  I found the
>>> /usr/share/alsa/alsa.conf, and there is a similar pcm.file entry
>>> in that, but it seems to take parameters.
>>>   
>>
>>
>> Put it into your ~/.asoundrc file, or into /etc/asound.conf for all
>> users.
>>
>>  
>>
>>> Since I have no sound card, how do I configure my system to use
>>> the dummy PCM driver and use the pcm.file plugin?
>>>   
>>
>>
>> "modprobe snd-dummy" should work.
>>
>>
>> HTH
>> Clemens
>>
>>
>>
>>
>> -------------------------------------------------------
>> This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
>> For a limited time only, get FREE Ground shipping on all orders of $35
>> or more. Hurry up and shop folks, this offer expires April 30th!
>> http://www.thinkgeek.com/freeshipping/?cpg=12297
>> _______________________________________________
>> Alsa-devel mailing list
>> Alsa-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/alsa-devel
>>
>>  
>>
>
>



-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: How do create a dummy device for recording audio? Does it exist already?
       [not found]       ` <4089663E.4000200@crome.org>
  2004-04-23 21:00         ` Caleb Crome
@ 2004-04-26 16:29         ` Clemens Ladisch
  2004-04-28 20:42           ` Caleb Crome
  1 sibling, 1 reply; 12+ messages in thread
From: Clemens Ladisch @ 2004-04-26 16:29 UTC (permalink / raw)
  To: Caleb Crome; +Cc: ALSA Devel

Caleb Crome wrote:
> >>>pcm.file {
> >>>   type file
> >>>   slave {
> >>>       pcm "hw:0,0"
> >>>   }
> >>>   file "/tmp/file.raw"
> >>>}
>
> Alright, I did what you suggested, and real player comes up and connects
> to the dummy sound card (I had to do a modprobe snd-pcm-oss and
> snd-mixer-oss).   However, I don't get a file called /tmp/file.raw.

You have to configure the program to use the PCM named "file" instead
of the default "default".

However, Realplayer uses the OSS emulation through /dev/dsp0.  To make
that work with your "file" device, add the following to the config
file:

  pcm.dsp0 = file

and try to run realplayer with the aoss script from the alsa-oss
package.


HTH
Clemens




-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: How do create a dummy device for recording audio? Does it exist already?
  2004-04-26 16:29         ` Clemens Ladisch
@ 2004-04-28 20:42           ` Caleb Crome
  2004-04-29  8:37             ` Clemens Ladisch
  0 siblings, 1 reply; 12+ messages in thread
From: Caleb Crome @ 2004-04-28 20:42 UTC (permalink / raw)
  To: Clemens Ladisch; +Cc: ALSA Devel

Clemens Ladisch wrote:

>Caleb Crome wrote:
>  
>
>>>>>pcm.file {
>>>>>  type file
>>>>>  slave {
>>>>>      pcm "hw:0,0"
>>>>>  }
>>>>>  file "/tmp/file.raw"
>>>>>}
>>>>>          
>>>>>
>>Alright, I did what you suggested, and real player comes up and connects
>>to the dummy sound card (I had to do a modprobe snd-pcm-oss and
>>snd-mixer-oss).   However, I don't get a file called /tmp/file.raw.
>>    
>>
>
>You have to configure the program to use the PCM named "file" instead
>of the default "default".
>
>However, Realplayer uses the OSS emulation through /dev/dsp0.  To make
>that work with your "file" device, add the following to the config
>file:
>
>  pcm.dsp0 = file
>
>and try to run realplayer with the aoss script from the alsa-oss
>package.
>
>
>HTH
>Clemens
>
>
>  
>
Awesome!  It works like a charm.  Than you so much!  The one thing that 
doesn't work quite right is that I get the following error when 
RealPlayer attempts to access the mixer:

ALSA lib control.c:601:(snd_ctl_open_noupdate) Invalid CTL mixer0

Is there a simple way to get it to control the mixer?  Currently, I have 
to bring up alsamixergui to turn up the volume.

Thanks again,
  -Caleb Crome


-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: How do create a dummy device for recording audio? Does it exist already?
  2004-04-28 20:42           ` Caleb Crome
@ 2004-04-29  8:37             ` Clemens Ladisch
  2004-04-29 15:41               ` Caleb Crome
  0 siblings, 1 reply; 12+ messages in thread
From: Clemens Ladisch @ 2004-04-29  8:37 UTC (permalink / raw)
  To: Caleb Crome; +Cc: ALSA Devel

Caleb Crome wrote:
> Clemens Ladisch wrote:
> >However, Realplayer uses the OSS emulation through /dev/dsp0.  To make
> >that work with your "file" device, add the following to the config
> >file:
> >
> >  pcm.dsp0 = file
>
> Awesome!  It works like a charm.  Than you so much!  The one thing that
> doesn't work quite right is that I get the following error when
> RealPlayer attempts to access the mixer:
>
> ALSA lib control.c:601:(snd_ctl_open_noupdate) Invalid CTL mixer0

It tries to use /dev/mixer0, too.  Add the following:

  ctl.mixer0 = "hw:0"


HTH
Clemens




-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: How do create a dummy device for recording audio? Does it exist already?
  2004-04-29  8:37             ` Clemens Ladisch
@ 2004-04-29 15:41               ` Caleb Crome
  0 siblings, 0 replies; 12+ messages in thread
From: Caleb Crome @ 2004-04-29 15:41 UTC (permalink / raw)
  To: Clemens Ladisch; +Cc: Caleb Crome, ALSA Devel

Clemens Ladisch wrote:

>Caleb Crome wrote:
>  
>
>>Clemens Ladisch wrote:
>>    
>>
>>>However, Realplayer uses the OSS emulation through /dev/dsp0.  To make
>>>that work with your "file" device, add the following to the config
>>>file:
>>>
>>> pcm.dsp0 = file
>>>      
>>>
>>Awesome!  It works like a charm.  Than you so much!  The one thing that
>>doesn't work quite right is that I get the following error when
>>RealPlayer attempts to access the mixer:
>>
>>ALSA lib control.c:601:(snd_ctl_open_noupdate) Invalid CTL mixer0
>>    
>>
>
>It tries to use /dev/mixer0, too.  Add the following:
>
>  ctl.mixer0 = "hw:0"
>
>
>HTH
>Clemens
>
>
>  
>
Clemens,
   Thanks for the info, however  now I get the following:

ALSA lib control.c:516:(snd_ctl_open_conf) Invalid type for CTL mixer0 
definition

Any ideas?  Just for the record, my asoundrc is:

pcm.dsp0 = file
pcm.file {
     type file
     slave {
           pcm "hw:0,0"
     }
    file "/tmp/pcm.raw.pipe"
}
ctl.mixer0 = "hw:0"


When I changed the last line to:

ctl.mixer0 = hw

it doesn't complain any more.  Is that the correct syntax? 

Thanks again,
    -Caleb



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2004-04-29 15:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-22 13:44 How do create a dummy device for recording audio? Does it exist already? Caleb Crome
2004-04-22 14:50 ` Paul Davis
2004-04-22 17:14   ` Caleb Crome
2004-04-22 20:33 ` Arek Korbik
2004-04-22 21:24   ` Caleb Crome
2004-04-23 10:41     ` Takashi Iwai
2004-04-23 15:56     ` Clemens Ladisch
     [not found]       ` <4089663E.4000200@crome.org>
2004-04-23 21:00         ` Caleb Crome
2004-04-26 16:29         ` Clemens Ladisch
2004-04-28 20:42           ` Caleb Crome
2004-04-29  8:37             ` Clemens Ladisch
2004-04-29 15:41               ` Caleb Crome

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.