Re: [pulseaudio-discuss] How to capture one of multiple radios that these radios play at the same time?

2010-11-22 Thread Colin Guthrie
'Twas brillig, and Tsai Yu-Chin at 20/11/10 04:00 did gyre and gimble:
 pa_stream_set_monitor_stream(stream,atoi((*td).sink_input_index));
 
 Excuse me.
 Is there any bug in pa_stream_set_monitor_stream function?
 It seems that there is some problems in this function.
 Can it create Monitor of sink input?

That's the theory and it seems to work fine in pavucontrol... but I'd
have to run a little test application to see if it's misbehaving in
other ways.

 And I confuse that why Record function of PulseAudio Volume Control
 uses this function.
 Is the goal of it capture All streams in sink?
 Or only one stream in sink input?

Both. On the Playback tab, the VU Meters only show the current stream.
On the Output Devices tab, the VU Meters show *everything* outputting
on that sink, so the different use cases cover the two different modes
of operation.

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] How to capture one of multiple radios that these radios play at the same time?

2010-11-22 Thread Colin Guthrie
'Twas brillig, and Tsai Yu-Chin at 20/11/10 15:11 did gyre and gimble:
 I have an idea but I am not sure that my idea is feasible.
 I want to create many monitors and many sinks.
 Assign one sink input per sink which is assigned to a monitor.
 In other word, there is one sink input in one sink and there is one
 sink in one monitor.
 Maybe we can record separate audio using this approach.
 
 But I don't know how to create sink and monitor in C code.
 And how to create virtual device in C code.
 
 Can you give me suggestions?
 And can you teach me how to create sink, monitor and Virtual device in C code.
 I can't find any relative information above on the web.

Depending on your scenario, you can indeed create virtual sinks, ensure
each stream plays to it's own private sink and then record directly
from there.

Do you really want to hear the audio out of a real sound card? (i.e. is
the recording of the sound the primary goal?)

If you *do* want to hear the sound, then I suggest either
module-remap-sink or module-combine. Both of these allow you to piggy
back on to a real sink. If you do not want to actually hear the sound,
then module-null-sink is probably what you want.

You could do something like the following:

pactl load-module module-null-sink sink_name=radio1
sink_properties=device.description=Radio1
pactl load-module module-null-sink sink_name=radio2
sink_properties=device.description=Radio2
pactl load-module module-null-sink sink_name=radio3
sink_properties=device.description=Radio3


These three commands will create three virtual sinks (called Radio1,
Radio2 and Radio3).

You can then launch your radio player as follows:

PULSE_SINK=radio1 myradioapp
PULSE_SINK=radio2 myradioapp
PULSE_SINK=radio3 myradioapp


Or similar.

Hope that helps.

Col



-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH] Add a target to the PA log feature and improve PA log core

2010-11-22 Thread Becker, VincentX
Hi all,

Could you please review this patch ?
This is a patch that adds a generic log target for PA log (log.c). This new 
target can be either a char device or a regular file. For our remote log device 
needs, it has been necessary to directly log Pulseaudio traces to a file 
descriptor. 

Also optimizations in the memory allocations have been done to reuse local 
pointers to prevent extra memory allocations (on stack or heap), that would 
happen in case of very big trace buffers, and that could potentially have an 
impact on audio latency in embedded systems.

Modifications :

src/daemon/cmdline.c : Update Pulseaudio help and error message for the 
'log-target' command argument.
src/daemon/daemon-conf.c : Add the condition when the target given is a file 
name given with relative or absolute path. If the file already exists, it 
creates a new file that will contain the current date and time inserted in the 
name. For this purpose, two static utilities functions have been added. The 
file descriptor is then passed to the PA log in pulsecore.

src/pulsecore/log.c : The function pa_log_levelv_meta formats the text data and 
sends it to the appropriate target. There are 2 main changes :
1) Add the target PA_LOG_FILED which allows to write the formatted log data to 
a file descriptor output. Add functions to open and close that file descriptor.
2) the algorithms around 'char *t' have been reordered in order to optimize 
memory use. This could be useful when traces are big. The trace buffer char 
text has been set to 16*1024Kb which allocates already 16Kb on the stack. This 
buffer is then copied into t, in the for loop that checks for carriage returns. 
What needed to be optimized is that extra memory is allocated in case of 
metadata (location and timestamp) is prepended to t, by creating dynamically a 
new buffer. The idea is to prepend the data directly into t (and append if it's 
the case) before we affect the value of 'text'. It avoids one dynamic memory 
allocation, at least in the case of the new target PA_LOG_FILED.
Therefore, a 'metadata' buffer is created and prepended in t whatever the 
target. One switch/case is actually added to build this metadata buffer and we 
keep the other one just for write the actual log (text+metadata) in the target.

P.S. : there are bad indentations due to tabs. I use emacs and tried the 
indentation Lisp function given here but without success : 
http://www.pulseaudio.org/wiki/CodingStyle  . It keeps putting tabs instead of 
spaces ! How could I solve that ?

Thanks,

Vincent


Vincent BECKER
Intel - Wireless System Integration Engineer
Medfield platform 


-
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: Les Montalets- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


0001-Pulseaudio-Add-a-target-to-PA-log-feature-and-optimi.patch
Description: 0001-Pulseaudio-Add-a-target-to-PA-log-feature-and-optimi.patch
___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss