[pulseaudio-discuss] [PATCH] esound auth-ip-acl fix

Nix nix at esperi.org.uk
Thu Oct 2 13:18:27 PDT 2008


On 29 Sep 2008, Lennart Poettering told this:

> On Fri, 26.09.08 19:29, Nix (nix at esperi.org.uk) wrote:
>
>> i) the alsa source and sink don't work together: if I try I get -EBUSY
>> on the second one to initialize, every time. Maybe my SBLive card is
>> just too cheap and old, but this does mean module-hal-detect won't work
>> for me.
>
> Is it possible that your card can do either surround sound XOR full
> duplex? i.e. either stereo in + stereo out XOR surround out + nothing
> in?

I don't have a clue if it can do surround sound. I only have two speakers,
so I certainly don't *want* surround sound. How do I find out?

> m-h-d should load the sinks before the sources and hence it should be
> handling this fine, assuming that surround is more important to you
> the duplex.

Well *that's* a bizarre assumption. I don't actually know anyone not an
audiophile who has more than two speakers, and even *they* have the
extra speakers connected to their hi-fi, not their computer. Hell, my
sister's a part-time musician and *she* only has two speakers (as she
puts it, `I only have two ears'). (My understanding of surround sound
is that it's an extension of stereo to >2 speakers, right?)

Perhaps if I knew more gamers I'd know people with surround-sound on
their computers. (How many things under Linux can use surround sound
anyway? I've never seen anything.)

> In a future version I will make this switchable during runtime.

Good :)

>> ii) the card doesn't support mmapped access (we get a -EINVAL back) but
>> PA isn't detecting this (as, from the source, it should). With 'mmap=0'
>> on the ALSA sink (not source, I can't use that, see above) things work
>> better. I'll look into why the fallback code is broken next.
>
> PA should be able to handle that properly. Could you be a bit more
> elaborate about what goes wrong?

This is the underlying cause of the 'ALSA doesn't work for me' thing I
moaned about long ago and then failed to do anything about. Here's some
log output with a pile of extra debugging statements dropped into PA and
alsa-lib to show what's going on. (There are debugging statements after
the ioctl() decorated with `Setting hw params', but it gets an -ENOTTY,
so they are never reached.)

I'm afraid the log is quite long, and the output comes from a time
before I fixed the esound bug so that's going wrong as well. (Ignore the
hrtimer stuff: as far as I can tell my 2001-vintage hardware isn't
capable of giving me hrtimers. Maybe I should upgrade.)

main.c: This is PulseAudio 0.9.12
main.c: Page size is 4096 bytes
main.c: Machine ID is 58755a45c51fa6ae39f2a98a562b8b00.
main.c: Using runtime directory /root/.pulse/58755a45c51fa6ae39f2a98a562b8b00:runtime.
main.c: Using state directory /root/.pulse.
main.c: Running in system mode: no
main.c: Dude, your kernel stinks! The chef's recommendation today is Linux with high-resolution timers enabled!
module-hal-detect.c: Trying capability alsa
module-alsa-sink.c: Disabling timer-based scheduling because high-resolution timers are not available from the kernel.
alsa-util.c: attempting to set 2 channels, 44100 rate, 3 format, 4 nfrags, 1102 period, 88200 sched, 1 mmap, 0 tsched
alsa-util.c: Setting hwparams-any
alsa-util.c: Setting hwparams-rate
alsa-util.c: Setting hwparams-interleaved-mmap-access
alsa-util.c: Setting format
alsa-util.c: Setting rate
alsa-util.c: Setting channels
alsa-util.c: Setting periods
alsa-util.c: Setting hw params
alsa-util.c: attempting to set 2 channels, 44100 rate, 3 format, 4 nfrags, 1102 period, 88200 sched, 1 mmap, 0 tsched
alsa-util.c: Setting hwparams-any
alsa-util.c: Setting hwparams-rate
alsa-util.c: Setting hwparams-interleaved-mmap-access
alsa-util.c: Setting format
alsa-util.c: Setting rate
alsa-util.c: Setting channels
alsa-util.c: Setting periods
alsa-util.c: Setting hw params
alsa-util.c: PCM device plug:front:0 refused our hw parameters: Inappropriate ioctl for device
alsa-util.c: attempting to set 4 channels, 44100 rate, 3 format, 4 nfrags, 1102 period, 88200 sched, 1 mmap, 0 tsched
alsa-util.c: Setting hwparams-any
alsa-util.c: Setting hwparams-rate
alsa-util.c: Setting hwparams-interleaved-mmap-access
alsa-util.c: Setting hwparams-interleaved-non-mmap-access
alsa-util.c: Setting format
alsa-util.c: Setting rate
alsa-util.c: Setting channels
alsa-util.c: Setting periods
alsa-util.c: Setting hw params
alsa-util.c: attempting to set 4 channels, 44100 rate, 3 format, 4 nfrags, 1102 period, 88200 sched, 1 mmap, 0 tsched
alsa-util.c: Setting hwparams-any
alsa-util.c: Setting hwparams-rate
alsa-util.c: Setting hwparams-interleaved-mmap-access
alsa-util.c: Setting format
alsa-util.c: Setting rate
alsa-util.c: Setting channels
alsa-util.c: Setting periods
alsa-util.c: Setting hw params
alsa-util.c: PCM device plug:surround40:0 refused our hw parameters: Inappropriate ioctl for device
alsa-util.c: attempting to set 5 channels, 44100 rate, 3 format, 4 nfrags, 1102 period, 88200 sched, 1 mmap, 0 tsched
alsa-util.c: Setting hwparams-any
alsa-util.c: Setting hwparams-rate
alsa-util.c: Setting hwparams-interleaved-mmap-access
alsa-util.c: Setting format
alsa-util.c: Setting rate
alsa-util.c: Setting channels
alsa-util.c: Setting periods
alsa-util.c: Setting hw params
alsa-util.c: attempting to set 5 channels, 44100 rate, 3 format, 4 nfrags, 1102 period, 88200 sched, 1 mmap, 0 tsched
alsa-util.c: Setting hwparams-any
alsa-util.c: Setting hwparams-rate
alsa-util.c: Setting hwparams-interleaved-mmap-access
alsa-util.c: Setting format
alsa-util.c: Setting rate
alsa-util.c: Setting channels
alsa-util.c: Setting periods
alsa-util.c: Setting hw params
alsa-util.c: PCM device plug:surround41:0 refused our hw parameters: Inappropriate ioctl for device
alsa-util.c: attempting to set 5 channels, 44100 rate, 3 format, 4 nfrags, 1102 period, 88200 sched, 1 mmap, 0 tsched
alsa-util.c: Setting hwparams-any
alsa-util.c: Setting hwparams-rate
alsa-util.c: Setting hwparams-interleaved-mmap-access
alsa-util.c: Setting format
alsa-util.c: Setting rate
alsa-util.c: Setting channels
alsa-util.c: Setting periods
alsa-util.c: Setting hw params
alsa-util.c: attempting to set 5 channels, 44100 rate, 3 format, 4 nfrags, 1102 period, 88200 sched, 1 mmap, 0 tsched
alsa-util.c: Setting hwparams-any
alsa-util.c: Setting hwparams-rate
alsa-util.c: Setting hwparams-interleaved-mmap-access
alsa-util.c: Setting format
alsa-util.c: Setting rate
alsa-util.c: Setting channels
alsa-util.c: Setting periods
alsa-util.c: Setting hw params
alsa-util.c: PCM device plug:surround50:0 refused our hw parameters: Inappropriate ioctl for device
alsa-util.c: attempting to set 6 channels, 44100 rate, 3 format, 4 nfrags, 1102 period, 88200 sched, 1 mmap, 0 tsched
alsa-util.c: Setting hwparams-any
alsa-util.c: Setting hwparams-rate
alsa-util.c: Setting hwparams-interleaved-mmap-access
alsa-util.c: Setting hwparams-interleaved-non-mmap-access
alsa-util.c: Setting format
alsa-util.c: Setting rate
alsa-util.c: Setting channels
alsa-util.c: Setting periods
alsa-util.c: Setting hw params
alsa-util.c: attempting to set 6 channels, 44100 rate, 3 format, 4 nfrags, 1102 period, 88200 sched, 1 mmap, 0 tsched
alsa-util.c: Setting hwparams-any
alsa-util.c: Setting hwparams-rate
alsa-util.c: Setting hwparams-interleaved-mmap-access
alsa-util.c: Setting format
alsa-util.c: Setting rate
alsa-util.c: Setting channels
alsa-util.c: Setting periods
alsa-util.c: Setting hw params
alsa-util.c: PCM device plug:surround51:0 refused our hw parameters: Inappropriate ioctl for device
(alsa-lib)conf.c: Unknown parameters 0
(alsa-lib)pcm.c: Unknown PCM surround71:0
alsa-util.c: Couldn't open PCM device surround71:0: Invalid argument
alsa-util.c: Setting hwparams-any
alsa-util.c: Setting hwparams-rate
alsa-util.c: Setting hwparams-interleaved-mmap-access
alsa-util.c: Setting format
alsa-util.c: Setting rate
alsa-util.c: Setting near channels
alsa-util.c: Setting periods
alsa-util.c: Setting hw params
alsa-util.c: Setting hwparams-any
alsa-util.c: Setting hwparams-rate
alsa-util.c: Setting hwparams-interleaved-mmap-access
alsa-util.c: Setting format
alsa-util.c: Setting rate
alsa-util.c: Setting near channels
alsa-util.c: Setting periods
alsa-util.c: Setting hw params
alsa-util.c: Failed to set hardware parameters on plug:hw:0: Inappropriate ioctl for device
module.c: Failed to load  module "module-alsa-sink" (argument: "device_id=0 sink_name=alsa_output.pci_1102_2_sound_card_0_alsa_playback_0 tsched=1"): initialization failed.
module-alsa-source.c: Disabling timer-based scheduling because high-resolution timers are not available from the kernel.
alsa-util.c: attempting to set 2 channels, 44100 rate, 3 format, 4 nfrags, 1102 period, 88200 sched, 1 mmap, 0 tsched
alsa-util.c: Setting hwparams-any
alsa-util.c: Setting hwparams-rate
alsa-util.c: Setting hwparams-interleaved-mmap-access
alsa-util.c: Setting format
alsa-util.c: Setting rate
alsa-util.c: Setting channels
alsa-util.c: Setting periods
alsa-util.c: Setting hw params
alsa-util.c: attempting to set 2 channels, 44100 rate, 3 format, 4 nfrags, 1102 period, 88200 sched, 1 mmap, 0 tsched
alsa-util.c: Setting hwparams-any
alsa-util.c: Setting hwparams-rate
alsa-util.c: Setting hwparams-interleaved-mmap-access
alsa-util.c: Setting format
alsa-util.c: Setting rate
alsa-util.c: Setting channels
alsa-util.c: Setting periods
alsa-util.c: PCM device plug:front:0 refused our hw parameters: Invalid argument
alsa-util.c: Couldn't open PCM device surround40:0: Device or resource busy
alsa-util.c: Couldn't open PCM device surround41:0: Device or resource busy
alsa-util.c: Couldn't open PCM device surround50:0: Device or resource busy
alsa-util.c: Couldn't open PCM device surround51:0: Device or resource busy
(alsa-lib)conf.c: Unknown parameters 0
(alsa-lib)pcm.c: Unknown PCM surround71:0
alsa-util.c: Couldn't open PCM device surround71:0: Invalid argument
alsa-util.c: Setting hwparams-any
alsa-util.c: Setting hwparams-rate
alsa-util.c: Setting hwparams-interleaved-mmap-access
alsa-util.c: Setting format
alsa-util.c: Setting rate
alsa-util.c: Setting near channels
alsa-util.c: Setting periods
alsa-util.c: Setting hw params
alsa-util.c: Setting hwparams-any
alsa-util.c: Setting hwparams-rate
alsa-util.c: Setting hwparams-interleaved-mmap-access
alsa-util.c: Setting format
alsa-util.c: Setting rate
alsa-util.c: Setting near channels
alsa-util.c: Setting periods
alsa-util.c: Failed to set hardware parameters on plug:hw:0: Invalid argument
module.c: Failed to load  module "module-alsa-source" (argument: "device_id=0 source_name=alsa_input.pci_1102_2_sound_card_0_alsa_capture_0 tsched=1"): initialization failed.
module-hal-detect.c: Loaded 0 modules.
module.c: Loaded "module-hal-detect" (index: #0; argument: "").
module.c: Loaded "module-esound-protocol-unix" (index: #1; argument: "").
module.c: Loaded "module-native-protocol-unix" (index: #2; argument: "auth-group=musicians").
module-protocol-stub.c: Failed to parse module arguments
module.c: Failed to load  module "module-esound-protocol-tcp" (argument: "auth-ip-acl=127.0.0.0/8;192.168.14.0/24"): initialization failed.
main.c: Module load failed.
main.c: Failed to initialize daemon.
module.c: Unloading "module-hal-detect" (index: #0).
module.c: Unloaded "module-hal-detect" (index: #0).
module.c: Unloading "module-esound-protocol-unix" (index: #1).
module.c: Unloaded "module-esound-protocol-unix" (index: #1).
module.c: Unloading "module-native-protocol-unix" (index: #2).
module.c: Unloaded "module-native-protocol-unix" (index: #2).
main.c: Daemon terminated.

>> iii) module-console-kit fails with a ludicrous error, not yet diagnosed:
>> 
>> module-console-kit.c: GetSessionsForUnixUser() call failed:
>> org.freedesktop.DBus.Error.Spawn.ExecFailed: Failed to execute
>> program /usr/libexec/dbus-daemon-launch-helper: Success
>
> This is weird. Looks like a D-Bus/CK issue.

Yep. Profoundly unimportant to me, I just diked the CK module out.

>> iv) module-protocol-stub has a one-character typo that breaks
>> auth-ip-acl for the esound TCP module, patch:
>
> Thanks, applied.

Yay :)



More information about the pulseaudio-discuss mailing list