Re: [pulseaudio-discuss] [PATCH] Do not use tsched watermark if tsched is disabled

2010-09-14 Thread David Henningsson

On 2010-09-13 13:03, Colin Guthrie wrote:

'Twas brillig, and David Henningsson at 13/09/10 11:14 did gyre and gimble:

On 2010-09-04 14:10, Colin Guthrie wrote:

I'd be interested as to whether anyone else can repeat this experiment
and get similar results. Do you guys get a broken chordtest too (it's on
the RedHat bug I mentioned at the beginning of this thread)?


I have now tried to repeat the experiment. The chordtest.sh seems to be
buggy in itself (the cleanup does not remove the gst-launch, which in
turn had to be renamed to gst-launch-0.10 here).


Yeah I have gst-launch-0.10 here too... not quite sure why, I'd have
thought we could ditch the old 0.8 support by now but hey ho. (I don't
follow gst dev super closely)

I thought that the script trapped ctrl+c and killed any processes
started. It seems to be clean for me.

Perhaps the problem is that /bin/sh is not actually bash on your system?


It is dash on Ubuntu systems.


Perhaps just changing the first line to:

#!/bin/bash would cause it to tidy things up properly?


Yes, that worked, thanks.


Anyway, the results
were not encouraging - with tsched=0, pavucontrol, and - to syslog
on, three tones were heard, then things went quiet - however, pulseaudio
started to eat more and more memory. Quickly my machine started swapping
and became unresponsive, so I killed PA.
Besides that, when I looked at pavucontrol, only the meters of the first
three were moving, the other ones were silent. My log got filled up with
memblockq: pool full as well. I'm getting the feeling that this
problem is something different, unrelated to DMA controller hardware.


Interesting, can't say I noticed this, but I probably wasn't looking
closely enough.


My suggestion is that you should commit your proposed patch as it
improves the situation compared to the current situation. If there are
additional problems, let's nail them down separately.


OK, sounds reasonable. Do you think the patch I posted is OK with the
1330 time?


I think it is good enough for now. If it turns out to be too little, we 
can adjust it later.



I guess it's not super important as if it solves your original problem
that kicked off this whole thread, then that's the main thing!!


That PA can handle a stress test is important, but it's a different issue.

--
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic
___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Routing of audio to loudspeakers or headphones

2010-09-14 Thread Kim Therkelsen

Hi,

Based on the advice from Colin Guthrie I am now trying to modify the 
module-ladspa-sink module so that it takes a master_port argument and only 
creates the virtual sink when the master sink's port matches the argument value 
(and unload it when it changes). I think it should be possible to leave the 
master_port argument out and let the functionality fall back to the original 
functionality to ensure backward compatibility.  

Furthermore I have updated module-ladspa-sink to support multiple audio 
channels based on:
http://www.pulseaudio.org/attachment/ticket/410/pulseaudio-0.9.12-multichannel-ladspa.patch

Unfortunately I can not find much information about how to handle these ports 
in the source code. 
I can see that pavucontrol can switch between the ports and from the info 
command in pulseaudio I get:

1 sink(s) available.
  * index: 0
name: alsa_output.pci-_00_1b.0.analog-stereo
driver: module-alsa-card.c
flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY 
DYNAMIC_LATENCY
...
ports:
analog-output: Analog Output (priority 9900)
analog-output-speaker: Analog Speakers (priority 1)
analog-output-headphones: Analog Headphones (priority 9000)
active port: analog-output-headphones
...

But how do I update int pa__init(pa_module*m) to perform the port check? Which 
command should I use to ask PA which port is active?

I need to load the LADSPA module once right after PA has started. After that 
processing through the LADSPA module should only happen when audio is routed to 
the PC loudspeakers and not when something (like headphones) is connected to 
the PC output mini-jack. The user should not have to change anything - it 
should happen automatically.  
Based on that how can I avoid creating the virtual sink if the master sink's 
port does not not match the argument (returning -1 in pa__init does not seem 
right as it will indicate an error)? How do you make it unload/load 
automatically as the headphone jack is plugged/unplugged?

Perhaps you have a link to some source code where something similar has been 
done?

/Kim

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


Re: [pulseaudio-discuss] pulseaudio-0.9.21, alsa-1.0.23, kde-4.4.5, consolekit, dbus

2010-09-14 Thread sibu xolo
On Monday 13 September 2010 11:59:14 Colin Guthrie wrote:
 'Twas brillig, and sibu xolo at 13/09/10 11:10 did gyre and gimble:
 First of all thanks  (or shall I say 'kallu kalay')  for the help. 

 I'm not sure why udev-detect would cause problems. I would suggest to
 double check your udev setup and make sure the relevant udev rules are
 present on your system. udev 147 is pretty old, perhaps a newer version
 is needed (I can't remember the minimum system requirements), but
 certainly: /lib/udev/rules.d/78-sound-card.rules



I updated udev to udev-162.  And  I can report some progress and some 
glitches.

PROGRESS:

---a) the first login and logout  via kdm gives the  welcome and exit sounds
---b)the  kde/~Multimedia dialog has  a dummy greyed-out icon and another as 
'Internal Audio analog stereo'
---c) aplay plays wav files in konsole  -as well as on the cli in/before/after 
startkde/kdm-logout


GLITCHES
---
---d) kde/sound is mute for all other logins and logouts  bar the first
---e) audio CDROMs do not play neither with KsCD nor Kaffeine for any logins

-


 'pacmd -ls' looks like this after login via kdm

Welcome to PulseAudio! Use help for usage information.
 Memory blocks currently allocated: 1, size: 63.9 KiB.
Memory blocks allocated during the whole lifetime: 85, size: 2.6 MiB.
Memory blocks imported from other processes: 0, size: 0 B.
Memory blocks exported to other processes: 0, size: 0 B.
Total sample cache size: 0 B.
Default sample spec: s16le 2ch 44100Hz
Default channel map: front-left,front-right
Default sink name: alsa_output.pci-_00_07.0.analog-stereo
Default source name: alsa_input.pci-_00_07.0.analog-stereo
Memory blocks of type POOL: 1 allocated/28 accumulated.
Memory blocks of type POOL_EXTERNAL: 0 allocated/0 accumulated.
Memory blocks of type APPENDED: 0 allocated/0 accumulated.
Memory blocks of type USER: 0 allocated/0 accumulated.
Memory blocks of type FIXED: 0 allocated/57 accumulated.
Memory blocks of type IMPORTED: 0 allocated/0 accumulated.
22 module(s) loaded.
index: 0
name: module-device-restore
argument: 
used: -1
load once: yes
properties:
module.author = Lennart Poettering
module.description = Automatically restore the volume/mute 
state of 
devices
module.version = 0.9.21
index: 1
name: module-stream-restore
argument: 
used: -1
load once: yes
properties:
module.author = Lennart Poettering
module.description = Automatically restore the 
volume/mute/device 
state of streams
module.version = 0.9.21
index: 2
name: module-card-restore
argument: 
used: -1
load once: yes
properties:
module.author = Lennart Poettering
module.description = Automatically restore profile of cards
module.version = 0.9.21
index: 3
name: module-augment-properties
argument: 
used: -1
load once: yes
properties:
module.author = Lennart Poettering
module.description = Augment the property sets of streams 
with 
additional static information
module.version = 0.9.21
index: 4
name: module-alsa-card
argument: device_id=0 name=pci-_00_07.0 
card_name=alsa_card.pci-_00_07.0 tsched=yes ignore_dB=no 
card_properties=module-udev-detect.discovered=1
used: 0
load once: no
properties:
module.author = Lennart Poettering
module.description = ALSA Card
module.version = 0.9.21
index: 5
name: module-udev-detect
argument: 
used: -1
load once: yes
properties:
module.author = Lennart Poettering
module.description = Detect available audio hardware and load 
matching drivers
module.version = 0.9.21
index: 6
name: module-bluetooth-discover
argument: 
used: -1
load once: yes
properties:
module.author = Joao Paulo Rechi Vita
module.description = Detect available bluetooth audio devices 
and 
load bluetooth audio drivers
module.version = 0.9.21
index: 7
name: module-esound-protocol-unix
argument: 
used: -1
load once: no
properties:
module.author = Lennart Poettering
module.description = ESOUND protocol (UNIX sockets)
module.version = 0.9.21
index: 8
name: module-native-protocol-unix
argument: 
used: -1
load once: no
properties:
module.author = Lennart Poettering
module.description = Native protocol (UNIX sockets)
 

Re: [pulseaudio-discuss] pulseaudio-0.9.21, alsa-1.0.23, kde-4.4.5, consolekit, dbus

2010-09-14 Thread Colin Guthrie
'Twas brillig, and sibu xolo at 14/09/10 13:33 did gyre and gimble:
 On Monday 13 September 2010 11:59:14 Colin Guthrie wrote:
 'Twas brillig, and sibu xolo at 13/09/10 11:10 did gyre and gimble:
  First of all thanks  (or shall I say 'kallu kalay')  for the help. 
 
 I'm not sure why udev-detect would cause problems. I would suggest to
 double check your udev setup and make sure the relevant udev rules are
 present on your system. udev 147 is pretty old, perhaps a newer version
 is needed (I can't remember the minimum system requirements), but
 certainly: /lib/udev/rules.d/78-sound-card.rules
 
 
 
 I updated udev to udev-162.  And  I can report some progress and some 
 glitches.
 
 PROGRESS:
 
 ---a) the first login and logout  via kdm gives the  welcome and exit sounds
 ---b)the  kde/~Multimedia dialog has  a dummy greyed-out icon and another as 
 'Internal Audio analog stereo'

Excellent. Both are expected outcomes. Because PA has been run with the
Dummy Output in the past, it will remember this for you and keep it in
the list as a previously seen sink (the same view would be presented
for USB devices you plug in and subsequently remove). You can
effectively ignore it or remove the device-manager tdb file in the
~/.pulse folder to purge it (one of these days I'll implement some
kind of GUI to remove it).

 ---c) aplay plays wav files in konsole  -as well as on the cli 
 in/before/after 
 startkde/kdm-logout

Cool.

 GLITCHES
 ---
 ---d) kde/sound is mute for all other logins and logouts  bar the first

Hmm, is that with different users or logging out and back in with the
same user?

When you say mute do you really mean mute or do you just mean that you
cannot hear anything. Does the device list in the kde/~Multimedia dialog
look the same?

Also are you using a Display Manager and if so which one (KDM?), and are
you using the stable-queue PA from git or the plain 0.9.21 tarball?

The reason I ask is that if it really is muting then it's probably
related to a volume adjustment race condition that may be getting in the
way. It's been fixed a long time ago in the stable-queue branch and all
the distros I know are shipping this fix (well they ship all the patches
from stable-queue).

The particular fix is:
http://git.0pointer.de/?p=pulseaudio.git;a=commit;h=540ec7b961256d6c7702448ca995f61268064190

but you really do want to use all the patches from this branch since
v0.9.21 tag (there will likely be another 10 fixes landing later today)

More details on the specific bug here:
http://pulseaudio.org/ticket/572#comment:19

 ---e) audio CDROMs do not play neither with KsCD nor Kaffeine for any logins

This is likely an issue to do with using analog playback rather than
digital extraction (DAE) and subsequent software playback. You can
probably use a low level alsamixer  (alsamixer -c0) to unmute the CDROM
element, but really most applications should be using digital extraction
and software playback these days AFAIK.

I'd ignore this particular problem until all others are addressed :)

Col

-- 

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

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  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] Routing of audio to loudspeakers or headphones

2010-09-14 Thread Colin Guthrie
'Twas brillig, and Kim Therkelsen at 14/09/10 10:48 did gyre and gimble:
 Based on the advice from Colin Guthrie I am now trying to modify the
 module-ladspa-sink module so that it takes a master_port argument and
 only creates the virtual sink when the master sink's port matches the
 argument value (and unload it when it changes). I think it should be
 possible to leave the master_port argument out and let the functionality
 fall back to the original functionality to ensure backward compatibility. 

Yes, backwards compatibility is a good plan.

 Furthermore I have updated module-ladspa-sink to support multiple audio
 channels based on:
 http://www.pulseaudio.org/attachment/ticket/410/pulseaudio-0.9.12-multichannel-ladspa.patch

Oh dear, that's been there an awful long time :(

I guess it's been missed due to general Trac weirdness :(


 Unfortunately I can not find much information about how to handle these
 ports in the source code.
 I can see that pavucontrol can switch between the ports and from the
 info command in pulseaudio I get:
 
 1 sink(s) available.
   * index: 0
 name: alsa_output.pci-_00_1b.0.analog-stereo
 driver: module-alsa-card.c
 flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY
 DYNAMIC_LATENCY
 ...
 ports:
 analog-output: Analog Output (priority 9900)
 analog-output-speaker: Analog Speakers (priority 1)
 analog-output-headphones: Analog Headphones (priority 9000)
 active port: analog-output-headphones
 ...
 
 But how do I update int pa__init(pa_module*m) to perform the port check?
 Which command should I use to ask PA which port is active?

In the pa__init() function, you'll need to read and store the
master_port argument first of all.

In the userdata struct there is a pa_sink* sink element.

When this is populated, you'll see from looking at pulsecore/sink.h that
it is just a struct.

In that struct you will see pa_device_port *active_port member.

This is where you can find the active port of the sink you are attaching to.


Hope that's the info you need.

Col


-- 

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

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  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] Routing of audio to loudspeakers or headphones

2010-09-14 Thread Colin Guthrie
'Twas brillig, and Colin Guthrie at 14/09/10 15:00 did gyre and gimble:
 'Twas brillig, and Kim Therkelsen at 14/09/10 10:48 did gyre and gimble:
 Based on the advice from Colin Guthrie I am now trying to modify the
 module-ladspa-sink module so that it takes a master_port argument and
 only creates the virtual sink when the master sink's port matches the
 argument value (and unload it when it changes). I think it should be
 possible to leave the master_port argument out and let the functionality
 fall back to the original functionality to ensure backward compatibility. 
 
 Yes, backwards compatibility is a good plan.
 
 Furthermore I have updated module-ladspa-sink to support multiple audio
 channels based on:
 http://www.pulseaudio.org/attachment/ticket/410/pulseaudio-0.9.12-multichannel-ladspa.patch
 
 Oh dear, that's been there an awful long time :(
 
 I guess it's been missed due to general Trac weirdness :(

Incidentally, just on this particular point

If you do update module-ladspa-sink and bring that patch up to date (I'm
not sure how much work was needed to make it work with current git
master?), then please submit this patch separately to the one adding the
master_port support.

It is *much* better to only commit one change at a time rather than
group up unrelated changes.

Hope that makes sense but if not, just ask.

Col



-- 

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

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  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] Routing of audio to loudspeakers or headphones

2010-09-14 Thread Colin Guthrie
'Twas brillig, and Colin Guthrie at 14/09/10 15:10 did gyre and gimble:
 'Twas brillig, and Colin Guthrie at 14/09/10 15:00 did gyre and gimble:
 'Twas brillig, and Kim Therkelsen at 14/09/10 10:48 did gyre and gimble:
 Based on the advice from Colin Guthrie I am now trying to modify the
 module-ladspa-sink module so that it takes a master_port argument and
 only creates the virtual sink when the master sink's port matches the
 argument value (and unload it when it changes). I think it should be
 possible to leave the master_port argument out and let the functionality
 fall back to the original functionality to ensure backward compatibility. 

 Yes, backwards compatibility is a good plan.

 Furthermore I have updated module-ladspa-sink to support multiple audio
 channels based on:
 http://www.pulseaudio.org/attachment/ticket/410/pulseaudio-0.9.12-multichannel-ladspa.patch

 Oh dear, that's been there an awful long time :(

 I guess it's been missed due to general Trac weirdness :(
 
 Incidentally, just on this particular point
 
 If you do update module-ladspa-sink and bring that patch up to date (I'm
 not sure how much work was needed to make it work with current git
 master?), then please submit this patch separately to the one adding the
 master_port support.

(sorry for multiple replies)

Oh and now I look at the patch itself, when you are tidying it up, can
you change the terminology a bit. I see it adds input_ and
output_port_map arguments. As this patch is based of 0.9.12, this is
before we added support for ports in PA itself.

Ultimately can you change the term port as used here, to not conflict
with our own port terminology? I guess something
input_ladspaport_map or similar to differentiate it.

Internal variable names should probably also be adapted for the same
reasons of clarity.

Hope that makes sense.

Col



-- 

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

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  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