Re: [new] audio/shairport-sync an AirPlay audio player

2022-04-28 Thread Stuart Henderson

OK.

--
 Sent from a phone, apologies for poor formatting.

On 28 April 2022 10:56:10 Paul de Weerd  wrote:


On Tue, Apr 26, 2022 at 08:57:18PM +0200, Paul de Weerd wrote:
| | ok (I have not tested at runtime)
|
| I have, it works great!

After some more usage, I now ran into an issue with shairport-sync due
to it making sndiod inaccessible to the normal user.  So I suggest to
give the _shairport user its own home dir where you can then copy the
sndio cookie (like with audio/mpd, I also took the README text from
there).  I'm now running this and can confirm it works fine.

Any thoughts?

Paul

Index: Makefile
===
RCS file: /home/OpenBSD/cvs/ports/audio/shairport-sync/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- Makefile27 Apr 2022 02:19:25 -  1.1.1.1
+++ Makefile28 Apr 2022 09:39:21 -
@@ -3,6 +3,7 @@ COMMENT =   AirPlay audio player
GH_ACCOUNT =mikebrady
GH_PROJECT =shairport-sync
GH_TAGNAME =3.3.9
+REVISION = 0

CATEGORIES =audio

Index: pkg/PLIST
===
RCS file: /home/OpenBSD/cvs/ports/audio/shairport-sync/pkg/PLIST,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 PLIST
--- pkg/PLIST   27 Apr 2022 02:19:25 -  1.1.1.1
+++ pkg/PLIST   28 Apr 2022 09:51:28 -
@@ -1,5 +1,5 @@
@newgroup _shairport:876
-@newuser _shairport:876:876::Shairport-sync Account:/var/empty:/sbin/nologin
+@newuser _shairport:876:876::Shairport-sync 
Account:/var/spool/shairport-sync:/sbin/nologin

@rcscript ${RCDIR}/shairport_sync
@bin bin/shairport-sync
@man man/man1/shairport-sync.1
@@ -9,3 +9,4 @@ share/examples/shairport-sync/shairport-
@owner _shairport
@group _shairport
@sample ${SYSCONFDIR}/shairport-sync.conf
+@sample /var/spool/shairport-sync/
Index: pkg/README
===
RCS file: /home/OpenBSD/cvs/ports/audio/shairport-sync/pkg/README,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 README
--- pkg/README  27 Apr 2022 02:19:25 -  1.1.1.1
+++ pkg/README  28 Apr 2022 09:41:07 -
@@ -7,3 +7,17 @@ boot time, the rc.conf.local(8) pkg_scri

rcctl enable messagebus avahi_daemon shairport_sync
rcctl order messagebus avahi_daemon shairport_sync
+
+sndiod(8) concurrent access by shairport-sync(1) and other users
+
+
+sndiod(8) normally only allows access to audio by a single system user
+at a time. This is done by generating a random authentication token and
+storing it in $HOME/.sndio/cookie when a user first accesses audio,
+providing a limited capability to share with other users by copying
+the token to their home directory.  See AUTHENTICATION in sndio(7) for
+more details.
+
+If you want to share sndiod(8) access with shairport-sync(1) running as
+the default _shairport user, you may copy .sndio/cookie from your user's
+home directory to /var/spool/shairport/.sndio/cookie.

--

[<++>-]<+++.>+++[<-->-]<.>+++[<+

+++>-]<.>++[<>-]<+.--.[-]
http://www.weirdnet.nl/




Re: [new] audio/shairport-sync an AirPlay audio player

2022-04-28 Thread Paul de Weerd
On Tue, Apr 26, 2022 at 08:57:18PM +0200, Paul de Weerd wrote:
| | ok (I have not tested at runtime)
| 
| I have, it works great!

After some more usage, I now ran into an issue with shairport-sync due
to it making sndiod inaccessible to the normal user.  So I suggest to
give the _shairport user its own home dir where you can then copy the
sndio cookie (like with audio/mpd, I also took the README text from
there).  I'm now running this and can confirm it works fine.

Any thoughts?

Paul

Index: Makefile
===
RCS file: /home/OpenBSD/cvs/ports/audio/shairport-sync/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- Makefile27 Apr 2022 02:19:25 -  1.1.1.1
+++ Makefile28 Apr 2022 09:39:21 -
@@ -3,6 +3,7 @@ COMMENT =   AirPlay audio player
 GH_ACCOUNT =   mikebrady
 GH_PROJECT =   shairport-sync
 GH_TAGNAME =   3.3.9
+REVISION = 0
 
 CATEGORIES =   audio
 
Index: pkg/PLIST
===
RCS file: /home/OpenBSD/cvs/ports/audio/shairport-sync/pkg/PLIST,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 PLIST
--- pkg/PLIST   27 Apr 2022 02:19:25 -  1.1.1.1
+++ pkg/PLIST   28 Apr 2022 09:51:28 -
@@ -1,5 +1,5 @@
 @newgroup _shairport:876
-@newuser _shairport:876:876::Shairport-sync Account:/var/empty:/sbin/nologin
+@newuser _shairport:876:876::Shairport-sync 
Account:/var/spool/shairport-sync:/sbin/nologin
 @rcscript ${RCDIR}/shairport_sync
 @bin bin/shairport-sync
 @man man/man1/shairport-sync.1
@@ -9,3 +9,4 @@ share/examples/shairport-sync/shairport-
 @owner _shairport
 @group _shairport
 @sample ${SYSCONFDIR}/shairport-sync.conf
+@sample /var/spool/shairport-sync/
Index: pkg/README
===
RCS file: /home/OpenBSD/cvs/ports/audio/shairport-sync/pkg/README,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 README
--- pkg/README  27 Apr 2022 02:19:25 -  1.1.1.1
+++ pkg/README  28 Apr 2022 09:41:07 -
@@ -7,3 +7,17 @@ boot time, the rc.conf.local(8) pkg_scri
 
 rcctl enable messagebus avahi_daemon shairport_sync
 rcctl order messagebus avahi_daemon shairport_sync
+
+sndiod(8) concurrent access by shairport-sync(1) and other users
+
+
+sndiod(8) normally only allows access to audio by a single system user
+at a time. This is done by generating a random authentication token and
+storing it in $HOME/.sndio/cookie when a user first accesses audio,
+providing a limited capability to share with other users by copying
+the token to their home directory.  See AUTHENTICATION in sndio(7) for
+more details.
+
+If you want to share sndiod(8) access with shairport-sync(1) running as
+the default _shairport user, you may copy .sndio/cookie from your user's
+home directory to /var/spool/shairport/.sndio/cookie.

-- 
>[<++>-]<+++.>+++[<-->-]<.>+++[<+
+++>-]<.>++[<>-]<+.--.[-]
 http://www.weirdnet.nl/ 



Re: [new] audio/shairport-sync an AirPlay audio player

2022-04-26 Thread Paul de Weerd
Hi Stuart,

On Tue, Apr 26, 2022 at 04:52:11PM +0100, Stuart Henderson wrote:
| couple of tweaks in the version attached, and I used upstream's
| install target as much as possible (usually better as long as it
| doesn't need serious patching, it's less likely to get out of sync
| that way).

Thanks - that looks better indeed (to my untrained eye).

| ok (I have not tested at runtime)

I have, it works great!

Paul

| On 2022/04/26 17:32, Paul de Weerd wrote:
| > Hi all,
| > 
| > sthen@ had some feedback on IRC:
| > 
| > - needs a tweak to use CONFIGURE_STYLE=autoreconf
| > - manpage into a better section (probably 1; 7 isn't right)
| > - check to make sure it doesn't pick up libsoxr if installed (or add
| >   it as a dep)
| > - should be /var/empty not ${VARBASE}/empty
| > - and remove daemon from @newuser / update the uid
| > - and typo "Sharport-sync"
| > - and zap the rcs ids
| > - check it doesn't pick up libdaemon/libsndfile too
| > 
| > I've updated Aaron's submission with these changes, please find it
| > attached.  The tarball misses this change to user.list:
| > 
| > cvs diff: Diffing .
| > Index: user.list
| > ===
| > RCS file: /home/OpenBSD/cvs/ports/infrastructure/db/user.list,v
| > retrieving revision 1.397
| > diff -u -p -r1.397 user.list
| > --- user.list   25 Apr 2022 07:32:01 -  1.397
| > +++ user.list   26 Apr 2022 14:19:35 -
| > @@ -384,3 +384,4 @@ id  usergroup   port
| >  873 _alertmanager  _alertmanager   sysutils/alertmanager
| >  874 _snowflakeproxy_snowflakeproxy net/snowflake_proxy
| >  875 _guacd _guacd  net/guacamole/server
| > +876 _shairport _shairport  audio/shairport-sync
| > 
| > as the original UID Aaron picked (872) has already been taken by
| > databases/victoriametrics (point 5 from sthen's list).
| > 
| > Many thanks again to Aaron for creating the port, and to Stuart for
| > his feedback.
| > 
| > Paul
| > 
| > On Tue, Apr 26, 2022 at 04:32:38PM +0200, Paul de Weerd wrote:
| > | Hi all,
| > | 
| > | I've tried Aaron's port .. it works great.  I've had to change the
| > | _shairport user id to 876 with the current ports tree, but other than
| > | that a very simple configuration file (setting the name and interface
| > | to listen on) produces a working setup for me.
| > | 
| > | Thanks Aaron!
| > | 
| > | Paul
| > | 
| > | On Thu, Dec 09, 2021 at 07:41:29AM -0700, Aaron Bieber wrote:
| > | | Hi,
| > | | 
| > | | Here is a port of shairport-sync. It lets one stream audio from iDevices
| > | | to OpenBSD.
| > | | 
| > | | DESCR snip:
| > | | 
| > | |   Shairport Sync is an AirPlay audio player. It plays audio streamed 
from
| > | | iTunes, iOS, Apple TV and macOS devices and AirPlay sources such as 
Quicktime
| > | | Player and ForkedDaapd, among others.
| > | | 
| > | | HOME: https://github.com/mikebrady/shairport-sync
| > | | 
| > | | I have had this in WIP for some time and it has been working without a
| > | | hitch.
| > | | 
| > | | Cluesticks? OK to import?
| > | | 
| > | | Here is the diff for the user db:
| > | | 
| > | | diff 43179bcb078bb95ad600e5d85321b77ec70deb07 /usr/ports
| > | | blob - 17cb166abe6601b51e206bb97d1ce009a2729eac
| > | | file + infrastructure/db/user.list
| > | | --- infrastructure/db/user.list
| > | | +++ infrastructure/db/user.list
| > | | @@ -380,3 +380,4 @@ id  usergroup   port
| > | |  869 _headscale _headscale  net/headscale
| > | |  870 _unit  _unit   www/unit
| > | |  871 _gelatod   _gelatodnet/gelatod
| > | | +872 _shairport _shairport  audio/shairport-sync
| > | | 
| > | 
| > | 
| > | 
| > | -- 
| > | >[<++>-]<+++.>+++[<-->-]<.>+++[<+
| > | +++>-]<.>++[<>-]<+.--.[-]
| > |  http://www.weirdnet.nl/ 
| > | 
| > 
| > -- 
| > >[<++>-]<+++.>+++[<-->-]<.>+++[<+
| > +++>-]<.>++[<>-]<+.--.[-]
| >  http://www.weirdnet.nl/ 
| 
| 



-- 
>[<++>-]<+++.>+++[<-->-]<.>+++[<+
+++>-]<.>++[<>-]<+.--.[-]
 http://www.weirdnet.nl/ 



Re: [new] audio/shairport-sync an AirPlay audio player

2022-04-26 Thread Stuart Henderson
couple of tweaks in the version attached, and I used upstream's
install target as much as possible (usually better as long as it
doesn't need serious patching, it's less likely to get out of sync
that way).

ok (I have not tested at runtime)


On 2022/04/26 17:32, Paul de Weerd wrote:
> Hi all,
> 
> sthen@ had some feedback on IRC:
> 
> - needs a tweak to use CONFIGURE_STYLE=autoreconf
> - manpage into a better section (probably 1; 7 isn't right)
> - check to make sure it doesn't pick up libsoxr if installed (or add
>   it as a dep)
> - should be /var/empty not ${VARBASE}/empty
> - and remove daemon from @newuser / update the uid
> - and typo "Sharport-sync"
> - and zap the rcs ids
> - check it doesn't pick up libdaemon/libsndfile too
> 
> I've updated Aaron's submission with these changes, please find it
> attached.  The tarball misses this change to user.list:
> 
> cvs diff: Diffing .
> Index: user.list
> ===
> RCS file: /home/OpenBSD/cvs/ports/infrastructure/db/user.list,v
> retrieving revision 1.397
> diff -u -p -r1.397 user.list
> --- user.list   25 Apr 2022 07:32:01 -  1.397
> +++ user.list   26 Apr 2022 14:19:35 -
> @@ -384,3 +384,4 @@ id  usergroup   port
>  873 _alertmanager  _alertmanager   sysutils/alertmanager
>  874 _snowflakeproxy_snowflakeproxy net/snowflake_proxy
>  875 _guacd _guacd  net/guacamole/server
> +876 _shairport _shairport  audio/shairport-sync
> 
> as the original UID Aaron picked (872) has already been taken by
> databases/victoriametrics (point 5 from sthen's list).
> 
> Many thanks again to Aaron for creating the port, and to Stuart for
> his feedback.
> 
> Paul
> 
> On Tue, Apr 26, 2022 at 04:32:38PM +0200, Paul de Weerd wrote:
> | Hi all,
> | 
> | I've tried Aaron's port .. it works great.  I've had to change the
> | _shairport user id to 876 with the current ports tree, but other than
> | that a very simple configuration file (setting the name and interface
> | to listen on) produces a working setup for me.
> | 
> | Thanks Aaron!
> | 
> | Paul
> | 
> | On Thu, Dec 09, 2021 at 07:41:29AM -0700, Aaron Bieber wrote:
> | | Hi,
> | | 
> | | Here is a port of shairport-sync. It lets one stream audio from iDevices
> | | to OpenBSD.
> | | 
> | | DESCR snip:
> | | 
> | |   Shairport Sync is an AirPlay audio player. It plays audio streamed from
> | | iTunes, iOS, Apple TV and macOS devices and AirPlay sources such as 
> Quicktime
> | | Player and ForkedDaapd, among others.
> | | 
> | | HOME: https://github.com/mikebrady/shairport-sync
> | | 
> | | I have had this in WIP for some time and it has been working without a
> | | hitch.
> | | 
> | | Cluesticks? OK to import?
> | | 
> | | Here is the diff for the user db:
> | | 
> | | diff 43179bcb078bb95ad600e5d85321b77ec70deb07 /usr/ports
> | | blob - 17cb166abe6601b51e206bb97d1ce009a2729eac
> | | file + infrastructure/db/user.list
> | | --- infrastructure/db/user.list
> | | +++ infrastructure/db/user.list
> | | @@ -380,3 +380,4 @@ id  user  group   port
> | |  869 _headscale   _headscale  net/headscale
> | |  870 _unit_unit   www/unit
> | |  871 _gelatod _gelatodnet/gelatod
> | | +872 _shairport   _shairport  audio/shairport-sync
> | | 
> | 
> | 
> | 
> | -- 
> | >[<++>-]<+++.>+++[<-->-]<.>+++[<+
> | +++>-]<.>++[<>-]<+.--.[-]
> |  http://www.weirdnet.nl/ 
> | 
> 
> -- 
> >[<++>-]<+++.>+++[<-->-]<.>+++[<+
> +++>-]<.>++[<>-]<+.--.[-]
>  http://www.weirdnet.nl/ 




shairport-sync.tgz
Description: application/tar-gz


Re: [new] audio/shairport-sync an AirPlay audio player

2022-04-26 Thread Paul de Weerd
Hi all,

sthen@ had some feedback on IRC:

- needs a tweak to use CONFIGURE_STYLE=autoreconf
- manpage into a better section (probably 1; 7 isn't right)
- check to make sure it doesn't pick up libsoxr if installed (or add
  it as a dep)
- should be /var/empty not ${VARBASE}/empty
- and remove daemon from @newuser / update the uid
- and typo "Sharport-sync"
- and zap the rcs ids
- check it doesn't pick up libdaemon/libsndfile too

I've updated Aaron's submission with these changes, please find it
attached.  The tarball misses this change to user.list:

cvs diff: Diffing .
Index: user.list
===
RCS file: /home/OpenBSD/cvs/ports/infrastructure/db/user.list,v
retrieving revision 1.397
diff -u -p -r1.397 user.list
--- user.list   25 Apr 2022 07:32:01 -  1.397
+++ user.list   26 Apr 2022 14:19:35 -
@@ -384,3 +384,4 @@ id  usergroup   port
 873 _alertmanager  _alertmanager   sysutils/alertmanager
 874 _snowflakeproxy_snowflakeproxy net/snowflake_proxy
 875 _guacd _guacd  net/guacamole/server
+876 _shairport _shairport  audio/shairport-sync

as the original UID Aaron picked (872) has already been taken by
databases/victoriametrics (point 5 from sthen's list).

Many thanks again to Aaron for creating the port, and to Stuart for
his feedback.

Paul

On Tue, Apr 26, 2022 at 04:32:38PM +0200, Paul de Weerd wrote:
| Hi all,
| 
| I've tried Aaron's port .. it works great.  I've had to change the
| _shairport user id to 876 with the current ports tree, but other than
| that a very simple configuration file (setting the name and interface
| to listen on) produces a working setup for me.
| 
| Thanks Aaron!
| 
| Paul
| 
| On Thu, Dec 09, 2021 at 07:41:29AM -0700, Aaron Bieber wrote:
| | Hi,
| | 
| | Here is a port of shairport-sync. It lets one stream audio from iDevices
| | to OpenBSD.
| | 
| | DESCR snip:
| | 
| |   Shairport Sync is an AirPlay audio player. It plays audio streamed from
| | iTunes, iOS, Apple TV and macOS devices and AirPlay sources such as 
Quicktime
| | Player and ForkedDaapd, among others.
| | 
| | HOME: https://github.com/mikebrady/shairport-sync
| | 
| | I have had this in WIP for some time and it has been working without a
| | hitch.
| | 
| | Cluesticks? OK to import?
| | 
| | Here is the diff for the user db:
| | 
| | diff 43179bcb078bb95ad600e5d85321b77ec70deb07 /usr/ports
| | blob - 17cb166abe6601b51e206bb97d1ce009a2729eac
| | file + infrastructure/db/user.list
| | --- infrastructure/db/user.list
| | +++ infrastructure/db/user.list
| | @@ -380,3 +380,4 @@ id  usergroup   port
| |  869 _headscale _headscale  net/headscale
| |  870 _unit  _unit   www/unit
| |  871 _gelatod   _gelatodnet/gelatod
| | +872 _shairport _shairport  audio/shairport-sync
| | 
| 
| 
| 
| -- 
| >[<++>-]<+++.>+++[<-->-]<.>+++[<+
| +++>-]<.>++[<>-]<+.--.[-]
|  http://www.weirdnet.nl/ 
| 

-- 
>[<++>-]<+++.>+++[<-->-]<.>+++[<+
+++>-]<.>++[<>-]<+.--.[-]
 http://www.weirdnet.nl/ 


shairport-sync.tgz
Description: application/tar-gz


Re: [new] audio/shairport-sync an AirPlay audio player

2022-04-26 Thread Paul de Weerd
Hi all,

I've tried Aaron's port .. it works great.  I've had to change the
_shairport user id to 876 with the current ports tree, but other than
that a very simple configuration file (setting the name and interface
to listen on) produces a working setup for me.

Thanks Aaron!

Paul

On Thu, Dec 09, 2021 at 07:41:29AM -0700, Aaron Bieber wrote:
| Hi,
| 
| Here is a port of shairport-sync. It lets one stream audio from iDevices
| to OpenBSD.
| 
| DESCR snip:
| 
|   Shairport Sync is an AirPlay audio player. It plays audio streamed from
| iTunes, iOS, Apple TV and macOS devices and AirPlay sources such as Quicktime
| Player and ForkedDaapd, among others.
| 
| HOME: https://github.com/mikebrady/shairport-sync
| 
| I have had this in WIP for some time and it has been working without a
| hitch.
| 
| Cluesticks? OK to import?
| 
| Here is the diff for the user db:
| 
| diff 43179bcb078bb95ad600e5d85321b77ec70deb07 /usr/ports
| blob - 17cb166abe6601b51e206bb97d1ce009a2729eac
| file + infrastructure/db/user.list
| --- infrastructure/db/user.list
| +++ infrastructure/db/user.list
| @@ -380,3 +380,4 @@ id  user  group   port
|  869 _headscale   _headscale  net/headscale
|  870 _unit_unit   www/unit
|  871 _gelatod _gelatodnet/gelatod
| +872 _shairport   _shairport  audio/shairport-sync
| 



-- 
>[<++>-]<+++.>+++[<-->-]<.>+++[<+
+++>-]<.>++[<>-]<+.--.[-]
 http://www.weirdnet.nl/ 



Re: [new] audio/shairport-sync an AirPlay audio player

2021-12-21 Thread Zé Loff
On Thu, Dec 09, 2021 at 07:41:29AM -0700, Aaron Bieber wrote:
> Hi,
> 
> Here is a port of shairport-sync. It lets one stream audio from iDevices
> to OpenBSD.
> 
> DESCR snip:
> 
>   Shairport Sync is an AirPlay audio player. It plays audio streamed from
> iTunes, iOS, Apple TV and macOS devices and AirPlay sources such as Quicktime
> Player and ForkedDaapd, among others.
> 
> HOME: https://github.com/mikebrady/shairport-sync
> 
> I have had this in WIP for some time and it has been working without a
> hitch.
> 
> Cluesticks? OK to import?
> 
> Here is the diff for the user db:
> 
> diff 43179bcb078bb95ad600e5d85321b77ec70deb07 /usr/ports
> blob - 17cb166abe6601b51e206bb97d1ce009a2729eac
> file + infrastructure/db/user.list
> --- infrastructure/db/user.list
> +++ infrastructure/db/user.list
> @@ -380,3 +380,4 @@ id  user  group   port
>  869 _headscale   _headscale  net/headscale
>  870 _unit_unit   www/unit
>  871 _gelatod _gelatodnet/gelatod
> +872 _shairport   _shairport  audio/shairport-sync
> 

Hi

Thanks for this.  I've done some basic testing on amd64 -current with
the sndio backend and it seems to work properly, but you already knew
that.

I'd patch the default config to change the default backend from 'alsa'
to 'sndio', but otherwise it looks good.

Cheers
Zé

--