OK I think I have a solution for your configurations.
Some background.
The configuration in question is when LMS is run as a service (rather
than on user-login) - LMS is run under its own userid (usually
squeezeboxserver) but this userid cannot login, has no shell and has no
default directory (i.e. nowhere for default settings). The application
generating audio is run by a user who has logged in a desktop GUI and/or
has a shell prompt.
Pulseaudio can be setup in two ways: system wide and per-user.
When Pulseaudio is setup per user - audio is expected to be sent to/from
application in the same system under same user id or between users on
different systems. Systemwide makes it easy to send audio between
applications on the same system regardless of users however system wide
setup is not recommended and developers are considering removing it. So
a per-user configuration of pulseaudio has to be used and yet make
application with different userids on same system communicate.
The chosen solution uses a unix domain socket to enable communication
between the pulsaudio daemon of the user whose desktop audio is to be
sent to LMS and the LMS Waveinput plugin and the Wavinput plugin has to
run the pulsaudio "parec" application to capture the audio. When
testing the latency (i.e. delay between live sound and time for LMS to
play sound) is about 15 secs.
To setup this communication both the pulseaudio daemon configuration and
the parec application have to be told which unix domain socket is to be
used. The name of the unix domain socket is arbitrary but in this
suggested setup it is set up in /tmp and called wavin-pulse-socket-name.
The desktop user (i.e. user running amarok, audacity, rhythmbox etc.)
can either set the configuration up by command or as part of default but
remember changes in configuration files will need user to logout/login
to take effect and.or restart the daemon.
I have tested as much as I can but my system configuration is not the
same your systems and I didn't want to alter mine too much as it would
break my application setup.
To setup the configuration copy pulse default configuration into own
login directory (edit the configuration file default.pa in /etc if you
want change to apply to all users).
Code:
--------------------
cp /etc/pulse/default.pa ~/.pulse/
--------------------
and then edit the file adding the following line
Code:
--------------------
load-module module-native-protocol-unix auth-anonymous=1
socket=/tmp/wavin-pulse-socket-name
--------------------
alternatively the user can give the following command from a shell
prompt. AFAICT changes this way is not permanent.
Code:
--------------------
pactl load-module module-native-protocol-unix auth-anonymous=1
socket=/tmp/wavin-pulse-socket-name
--------------------
You may need to stop pulseaudio and restart the pulseaudio daemon with
following commands.
Code:
--------------------
pulseaudio -k
pulseaudio -D
--------------------
To setup the LMS use of the unix domain socket - an environment variable
PULSE_SERVER has to be used as there is no login for LMS user id and no
home directory. THis means the custom-convert.conf file has to call a
shell script inseated of an executable and this shell script requires a
Bin subdirectory in the Wavin plugin directory. Here are the required
steps.
1. Create a Bin directory in the Waveinput plugin directory.
2. create a shell script called parec.sh in the Bin directory with the
following lines. Make sure it is executable.
Code:
--------------------
#!/bin/sh
PULSE_SERVER=unix:/tmp/wavin-pulse-socket-name parec $*
--------------------
3. Backup current custom-convert.conf file and edit so that it uses
parec as follows. I only tested the flac setting - I have doubts about
correct operation of PCM setting but may offer shorter latency.
Code:
--------------------
#
# wavin
#
wavin pcm * *
# R
[parec.sh] --channels=2 --format=s16le --rate=44100 --file-format=raw
-D $FILE$
wavin mp3 * *
# RB:{BITRATE=-B %B}
[parec.sh] --file-format=wav -d $FILE$ | [lame] --silent -q $QUALITY$
-v $BITRATE$ - -
wavin flc * *
# R
[parec.sh] --file-format=flac -d $FILE$
--------------------
Assuming you are using standard PC audio with your applications (you
should check with pactl list short) then the associated "monitor" needs
to be chosen in the Favorite to be created.
Code:
--------------------
wavin:alsa_output.pci-0000_00_1b.0.analog-stereo.monitor
--------------------
------------------------------------------------------------------------
bpa's Profile: http://forums.slimdevices.com/member.php?userid=1806
View this thread: http://forums.slimdevices.com/showthread.php?t=49584
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins