Remote audio problem

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

Remote audio problem

Dylan-13
Hi,

I'm setting up a media machine, currently using oS12.3. It is attached
to my TV as a monitor and the Hi-Fi for audio output. When I log in
directly, all works as expected.

When I log in remotely with ssh -X user@host from my main machine
however, I can run my chosen audio player (clementine) but when trying
to play any audio I get a "Connection refused" error unless the user is
also logged in on the media box. This rather defeats the object of
running the audio player remotely. How can I make the audio server
(pulse) available with no logged in users on the media server (only the
ssh -X connection)?

Cheers
Dylan
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Remote audio problem

Bob Williams
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 13/12/13 09:06, Dylan wrote:

> Hi,
>
> I'm setting up a media machine, currently using oS12.3. It is
> attached to my TV as a monitor and the Hi-Fi for audio output. When
> I log in directly, all works as expected.
>
> When I log in remotely with ssh -X user@host from my main machine
> however, I can run my chosen audio player (clementine) but when
> trying to play any audio I get a "Connection refused" error unless
> the user is also logged in on the media box. This rather defeats
> the object of running the audio player remotely. How can I make the
> audio server (pulse) available with no logged in users on the media
> server (only the ssh -X connection)?
>
> Cheers Dylan

Dylan,

Take a look at Music Player Daemon <http://www.musicpd.org/>. I have
it installed on my main machine here, and the daemon starts
automatically after boot-up. It can be controlled from the command
line, but there are also several graphical interfaces, my preference
being GMPC. I can control the audio output from my laptop (also using
GMPC) or my Android phone, using Droid MPD client.

MPD and GMPC are available in Packman.

Bob
- --
Bob Williams
System:  Linux 3.7.10-1.16-desktop
Distro:  openSUSE 12.3 (x86_64) with KDE Development Platform: 4.11.4
Uptime:  06:00am up 13:53, 3 users, load average: 0.05, 0.16, 0.23
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlKq1PwACgkQ0Sr7eZJrmU6UnACfUUTlj7vRkMDcNzb0PwtbB9bq
cpQAoJ/8FtL+DmoCtJXVk7njALq9kL7u
=qX/h
-----END PGP SIGNATURE-----
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Remote audio problem

auxsvr
In reply to this post by Dylan-13
On Friday 13 of December 2013 09:06:28 Dylan wrote:

> I'm setting up a media machine, currently using oS12.3. It is attached
> to my TV as a monitor and the Hi-Fi for audio output. When I log in
> directly, all works as expected.
>
> When I log in remotely with ssh -X user@host from my main machine
> however, I can run my chosen audio player (clementine) but when trying
> to play any audio I get a "Connection refused" error unless the user is
> also logged in on the media box. This rather defeats the object of
> running the audio player remotely. How can I make the audio server
> (pulse) available with no logged in users on the media server (only the
> ssh -X connection)?

Try setting

load-module module-native-protocol-tcp auth-ip-acl=[IP ADDRESS OF CLIENT]

in /etc/pulse/system.pa, then

pulseaudio -D

as root. This will make pulseaudio act as a server on TCP port 4713, which
you'll need to open in the firewall configuration. Then in the client,

PULSE_SERVER=[IP ADDRESS OF SERVER]  clementine

will connect to the pulseaudio daemon on the server.

These directions provide a minimum of security, because the connection is
authenticated by IP address. You could also configure a ssh tunnel for this or
sync the pulseaudio cookie between server and client. There is enough
documentation about authentication methods regarding pulseaudio on the
internet.

> Cheers
> Dylan

Regards,
Peter
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Remote audio problem

Dylan-13
On 13/12/13 09:53, [hidden email] wrote:

> On Friday 13 of December 2013 09:06:28 Dylan wrote:
>> I'm setting up a media machine, currently using oS12.3. It is attached
>> to my TV as a monitor and the Hi-Fi for audio output. When I log in
>> directly, all works as expected.
>>
>> When I log in remotely with ssh -X user@host from my main machine
>> however, I can run my chosen audio player (clementine) but when trying
>> to play any audio I get a "Connection refused" error unless the user is
>> also logged in on the media box. This rather defeats the object of
>> running the audio player remotely. How can I make the audio server
>> (pulse) available with no logged in users on the media server (only the
>> ssh -X connection)?
>
> Try setting
>
> load-module module-native-protocol-tcp auth-ip-acl=[IP ADDRESS OF CLIENT]
>
> in /etc/pulse/system.pa, then
>
> pulseaudio -D
>
> as root. This will make pulseaudio act as a server on TCP port 4713, which
> you'll need to open in the firewall configuration. Then in the client,
>
> PULSE_SERVER=[IP ADDRESS OF SERVER]  clementine
>
> will connect to the pulseaudio daemon on the server.
>
> These directions provide a minimum of security, because the connection is
> authenticated by IP address. You could also configure a ssh tunnel for this or
> sync the pulseaudio cookie between server and client. There is enough
> documentation about authentication methods regarding pulseaudio on the
> internet.
>

I'm not trying to configure pulseaudio as a network audio server... I'm
trying to get an application running on the media box via ssh to connect
to its *local* pulse server even though there is no local user logged
in. I have set pulseaudio to run in system mode but still no audio...

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Remote audio problem

John Andersen-2
On 12/13/2013 2:33 AM, Dylan wrote:
> I get a "Connection refused" error unless the user is
> also logged in on the media box.

Where does this message appear?  SSH station, or media box?

It might be your ssh station that is refusing connection because you
didn't allow port forwarding on either the ssh server (media box) or
the ssh station.


--
_____________________________________
---This space for rent---
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Remote audio problem

Dylan-13
On 13/12/13 19:32, John Andersen wrote:
> On 12/13/2013 2:33 AM, Dylan wrote:
>> I get a "Connection refused" error unless the user is
>> also logged in on the media box.
>
> Where does this message appear?  SSH station, or media box?
>
> It might be your ssh station that is refusing connection because you
> didn't allow port forwarding on either the ssh server (media box) or
> the ssh station.

It is a message from the instance of clementine running via ssh - it
displays and functions correctly displayed on the client. The only thing
which doesn't work as expected is audio playback.

Dx

>
>

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Remote audio problem

John Andersen-2
On 12/13/2013 12:52 PM, Dylan wrote:

> On 13/12/13 19:32, John Andersen wrote:
>> On 12/13/2013 2:33 AM, Dylan wrote:
>>> I get a "Connection refused" error unless the user is
>>> also logged in on the media box.
>>
>> Where does this message appear?  SSH station, or media box?
>>
>> It might be your ssh station that is refusing connection because you
>> didn't allow port forwarding on either the ssh server (media box) or
>> the ssh station.
>
> It is a message from the instance of clementine running via ssh - it
> displays and functions correctly displayed on the client. The only thing
> which doesn't work as expected is audio playback.
>
> Dx
>
>>
>>
>

Well, again, go back and see if your ssh connection is forwarding the
proper port for the audio.

Check this site:
> http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Network/

Or more tersely:
http://superuser.com/questions/231920/forwarding-audio-like-x-in-ssh


--
Explain again the part about rm -rf /
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Remote audio problem

Dylan-13
On 13/12/13 21:13, John Andersen wrote:

> On 12/13/2013 12:52 PM, Dylan wrote:
>> On 13/12/13 19:32, John Andersen wrote:
>>> On 12/13/2013 2:33 AM, Dylan wrote:
>>>> I get a "Connection refused" error unless the user is
>>>> also logged in on the media box.
>>>
>>> Where does this message appear?  SSH station, or media box?
>>>
>>> It might be your ssh station that is refusing connection because you
>>> didn't allow port forwarding on either the ssh server (media box) or
>>> the ssh station.
>>
>> It is a message from the instance of clementine running via ssh - it
>> displays and functions correctly displayed on the client. The only thing
>> which doesn't work as expected is audio playback.
>>
>> Dx
>>
>>>
>>>
>>
>
> Well, again, go back and see if your ssh connection is forwarding the
> proper port for the audio.
>
> Check this site:
>> http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Network/
>
> Or more tersely:
> http://superuser.com/questions/231920/forwarding-audio-like-x-in-ssh
>
>

I really don't see why that should be relevant. I use:

ssh -X dylan@zen

when I run clementine in that login, it executes *on zen* (the media
'server') and its X display is forwarded to the client. Any audio
connection it is trying to make is local to zen. The problem is that
pulseaudio does not get run until a user logs in. Once I log in
*locally* the instance of clementine running through ssh can play audio
correctly. My problem is to get pulseaudio to run system-wide at boot,
rather than when a user logs in locally to a graphical login.

Dx
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Remote audio problem

John Andersen-2
On 12/13/2013 1:34 PM, Dylan wrote:

> On 13/12/13 21:13, John Andersen wrote:
>> On 12/13/2013 12:52 PM, Dylan wrote:
>>> On 13/12/13 19:32, John Andersen wrote:
>>>> On 12/13/2013 2:33 AM, Dylan wrote:
>>>>> I get a "Connection refused" error unless the user is
>>>>> also logged in on the media box.
>>>>
>>>> Where does this message appear?  SSH station, or media box?
>>>>
>>>> It might be your ssh station that is refusing connection because you
>>>> didn't allow port forwarding on either the ssh server (media box) or
>>>> the ssh station.
>>>
>>> It is a message from the instance of clementine running via ssh - it
>>> displays and functions correctly displayed on the client. The only thing
>>> which doesn't work as expected is audio playback.
>>>
>>> Dx
>>>
>>>>
>>>>
>>>
>>
>> Well, again, go back and see if your ssh connection is forwarding the
>> proper port for the audio.
>>
>> Check this site:
>>> http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Network/
>>
>> Or more tersely:
>> http://superuser.com/questions/231920/forwarding-audio-like-x-in-ssh
>>
>>
>
> I really don't see why that should be relevant. I use:
>
> ssh -X dylan@zen
>
> when I run clementine in that login, it executes *on zen* (the media 'server') and its X display is forwarded to the client. Any audio
> connection it is trying to make is local to zen. The problem is that pulseaudio does not get run until a user logs in. Once I log in
> *locally* the instance of clementine running through ssh can play audio correctly. My problem is to get pulseaudio to run system-wide at
> boot, rather than when a user logs in locally to a graphical login.
>
> Dx

Ok. Have it your way.  Horse  -->| water.


--
_____________________________________
---This space for rent---
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Remote audio problem

Aneurin Price
On 13 December 2013 21:44, John Andersen <[hidden email]> wrote:

> On 12/13/2013 1:34 PM, Dylan wrote:
>> On 13/12/13 21:13, John Andersen wrote:
>>> On 12/13/2013 12:52 PM, Dylan wrote:
>>>> On 13/12/13 19:32, John Andersen wrote:
>>>>> On 12/13/2013 2:33 AM, Dylan wrote:
>>>>>> I get a "Connection refused" error unless the user is
>>>>>> also logged in on the media box.
>>>>>
>>>>> Where does this message appear?  SSH station, or media box?
>>>>>
>>>>> It might be your ssh station that is refusing connection because you
>>>>> didn't allow port forwarding on either the ssh server (media box) or
>>>>> the ssh station.
>>>>
>>>> It is a message from the instance of clementine running via ssh - it
>>>> displays and functions correctly displayed on the client. The only thing
>>>> which doesn't work as expected is audio playback.
>>>>
>>>> Dx
>>>>
>>>>>
>>>>>
>>>>
>>>
>>> Well, again, go back and see if your ssh connection is forwarding the
>>> proper port for the audio.
>>>
>>> Check this site:
>>>> http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Network/
>>>
>>> Or more tersely:
>>> http://superuser.com/questions/231920/forwarding-audio-like-x-in-ssh
>>>
>>>
>>
>> I really don't see why that should be relevant. I use:
>>
>> ssh -X dylan@zen
>>
>> when I run clementine in that login, it executes *on zen* (the media 'server') and its X display is forwarded to the client. Any audio
>> connection it is trying to make is local to zen. The problem is that pulseaudio does not get run until a user logs in. Once I log in
>> *locally* the instance of clementine running through ssh can play audio correctly. My problem is to get pulseaudio to run system-wide at
>> boot, rather than when a user logs in locally to a graphical login.
>>
>> Dx
>
> Ok. Have it your way.  Horse  -->| water.

You have completely misunderstood the question, refused to listen to
explanations of how you are mistaken, and are now making yourself look
like an idiot by being obnoxious about it. Good job.

OP: Why bother with PA at all? Surely it would be easier just to use
alsa directly?
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Remote audio problem

Dylan-13
On 13/12/13 21:58, Aneurin Price wrote:

> On 13 December 2013 21:44, John Andersen <[hidden email]> wrote:
>> On 12/13/2013 1:34 PM, Dylan wrote:
>>> On 13/12/13 21:13, John Andersen wrote:
>>>> On 12/13/2013 12:52 PM, Dylan wrote:
>>>>> On 13/12/13 19:32, John Andersen wrote:
>>>>>> On 12/13/2013 2:33 AM, Dylan wrote:
>>>>>>> I get a "Connection refused" error unless the user is
>>>>>>> also logged in on the media box.
>>>>>>
>>>>>> Where does this message appear?  SSH station, or media box?
>>>>>>
>>>>>> It might be your ssh station that is refusing connection because you
>>>>>> didn't allow port forwarding on either the ssh server (media box) or
>>>>>> the ssh station.
>>>>>
>>>>> It is a message from the instance of clementine running via ssh - it
>>>>> displays and functions correctly displayed on the client. The only thing
>>>>> which doesn't work as expected is audio playback.
>>>>>
>>>>> Dx
>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>> Well, again, go back and see if your ssh connection is forwarding the
>>>> proper port for the audio.
>>>>
>>>> Check this site:
>>>>> http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Network/
>>>>
>>>> Or more tersely:
>>>> http://superuser.com/questions/231920/forwarding-audio-like-x-in-ssh
>>>>
>>>>
>>>
>>> I really don't see why that should be relevant. I use:
>>>
>>> ssh -X dylan@zen
>>>
>>> when I run clementine in that login, it executes *on zen* (the media 'server') and its X display is forwarded to the client. Any audio
>>> connection it is trying to make is local to zen. The problem is that pulseaudio does not get run until a user logs in. Once I log in
>>> *locally* the instance of clementine running through ssh can play audio correctly. My problem is to get pulseaudio to run system-wide at
>>> boot, rather than when a user logs in locally to a graphical login.
>>>
>>> Dx
>>
>> Ok. Have it your way.  Horse  -->| water.
>
> You have completely misunderstood the question, refused to listen to
> explanations of how you are mistaken, and are now making yourself look
> like an idiot by being obnoxious about it. Good job.

Thank you - I was beginning to think I had fundamentally misunderstood
ssh all these years...

>
> OP: Why bother with PA at all? Surely it would be easier just to use
> alsa directly?

I want to be able to balance audio from various sources and pass them to
different outputs without all the fiddling around with jack which is
massively over-specified for my needs. PA does that fine for me - I have
the motherboard audio device, a soundcard, and a usb-audio mixer (each
connected to a separate amp) which together with PA allows me to route
audio from software or external input(s) to various parts of the flat
dynamically - but currently only from the server itself.

Dx

>

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Remote audio problem

Aneurin Price
On 14 December 2013 00:19, Dylan <[hidden email]> wrote:

>> OP: Why bother with PA at all? Surely it would be easier just to use
>> alsa directly?
>
>
> I want to be able to balance audio from various sources and pass them to
> different outputs without all the fiddling around with jack which is
> massively over-specified for my needs. PA does that fine for me - I have the
> motherboard audio device, a soundcard, and a usb-audio mixer (each connected
> to a separate amp) which together with PA allows me to route audio from
> software or external input(s) to various parts of the flat dynamically - but
> currently only from the server itself.

Interesting. I can't help with PA specifically as I generally find it
causes more problems than it solves, but I'd probably start by looking
at what gets run in a full session - any PA related processes, any
relevant environment variables, possibly dbus, including all
arguments. Then I'd try putting all those into a script and running
that in my ssh command rather than just running Clementine as a single
command.

If that doesn't prove fruitful, I'd seriously consider the possibility
of changing the approach to the problem. For example, run a full
desktop session via xvnc and keep that running persistently, then
connect to that in place of 'ssh -X user@host clementine'. (I can be
more specific about that if you do end up going in this direction.)
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Remote audio problem

Dylan-13
On 14/12/13 12:17, Aneurin Price wrote:

> On 14 December 2013 00:19, Dylan <[hidden email]> wrote:
>>> OP: Why bother with PA at all? Surely it would be easier just to use
>>> alsa directly?
>>
>>
>> I want to be able to balance audio from various sources and pass them to
>> different outputs without all the fiddling around with jack which is
>> massively over-specified for my needs. PA does that fine for me - I have the
>> motherboard audio device, a soundcard, and a usb-audio mixer (each connected
>> to a separate amp) which together with PA allows me to route audio from
>> software or external input(s) to various parts of the flat dynamically - but
>> currently only from the server itself.
>
> Interesting. I can't help with PA specifically as I generally find it
> causes more problems than it solves, but I'd probably start by looking
> at what gets run in a full session - any PA related processes, any
> relevant environment variables, possibly dbus, including all
> arguments. Then I'd try putting all those into a script and running
> that in my ssh command rather than just running Clementine as a single
> command.

I hadn't thought about that - will have a look at that. Should be able
to have a script run at login to check if it's running and start it if not.

>
> If that doesn't prove fruitful, I'd seriously consider the possibility
> of changing the approach to the problem. For example, run a full
> desktop session via xvnc and keep that running persistently, then
> connect to that in place of 'ssh -X user@host clementine'. (I can be
> more specific about that if you do end up going in this direction.)
>

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Remote audio problem

David C. Rankin
In reply to this post by Dylan-13
On 12/13/2013 03:34 PM, Dylan wrote:

> I really don't see why that should be relevant. I use:
>
> ssh -X dylan@zen
>
> when I run clementine in that login, it executes *on zen* (the media 'server')
> and its X display is forwarded to the client. Any audio connection it is trying
> to make is local to zen. The problem is that pulseaudio does not get run until a
> user logs in. Once I log in *locally* the instance of clementine running through
> ssh can play audio correctly. My problem is to get pulseaudio to run system-wide
> at boot, rather than when a user logs in locally to a graphical login.
>
> Dx

Dylan,

  I think what you should try is logging onto zen. Find out exactly what you
need to do to start clementine for the command line. If you are starting it from
a gui, then open an xterm and look at ps axf for the default options clementine
is started with. If for some reason 'ssh dylan@zen /usr/bin/clementine' isn't
starting it the way you want, you can add the options to your ssh dylan@zen
/usr/bin/clementine [options]' -- or -- you can then create a simple bash script
that starts clementine with the proper options (clementine-run.sh) and save that
to your home/scr[ipt] or /home/bin or whereever. (make sure it is executable) Like:

#!/bin/bash
/usr/bin/clementine -a blah -d blah -p bla

  ssh has the ability to execute whatever you want from your remote box on zen
with the form:

ssh user@hostname command

ssh dylan@zen /path/to/clementine-run.sh

  Use this to your advantage to launch clementine on zen from wherever you want.
If you are not opening an X window of clementine on your remote host when you
ssh -X into zen, then forget the -X, you are just starting the app on zen. If
you are getting a gui back, then keep it.

  If clementine is bombing when you try and start it, the see if you can find
some error in /var/log/message or in ~/.xsession-errors

  If I have totally missed what you are trying to do, then I apologize.

--
David C. Rankin, J.D.,P.E.
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Remote audio problem

Rajko M.
In reply to this post by Dylan-13
On Fri, 13 Dec 2013 21:34:49 +0000
Dylan <[hidden email]> wrote:

> My problem is to get pulseaudio to run system-wide at boot,
> rather than when a user logs in locally to a graphical login.

In 13.1 pulseaudio is set NOT to start as system process by default.
To change that set PULSEAUDIO_SYSTEM="no" to "yes"
in /etc/sysconfig/sound .

For me next would be reboot.
Some systemd expert may come up with idea how to start audio without
rebooting.

The other option is to use:
YaST > System > "/etc/sysconfig Editor" then in a left panel
Hardware > Sound > PulseAudio > Systemwide
change  PULSEAUDIO_SYSTEM to "yes".
YaST may restart sound system without rebooting.

--
Regards, Rajko.
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Remote audio problem

Dylan-13
On 15/12/13 00:48, Rajko wrote:
> On Fri, 13 Dec 2013 21:34:49 +0000
> Dylan <[hidden email]> wrote:
>
>> My problem is to get pulseaudio to run system-wide at boot,
>> rather than when a user logs in locally to a graphical login.
>
> In 13.1 pulseaudio is set NOT to start as system process by default.
> To change that set PULSEAUDIO_SYSTEM="no" to "yes"
> in /etc/sysconfig/sound .

Thanks, but that's not available in the 12.3 system I'm working on... PA
is also set NOT to start as a system process there, but the setting is
not available in sysconfig...

Dx

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]