Skip to content
This repository has been archived by the owner on Feb 3, 2020. It is now read-only.

Music Player Multizone Audio #5

Closed
danry25 opened this issue Aug 3, 2015 · 2 comments
Closed

Music Player Multizone Audio #5

danry25 opened this issue Aug 3, 2015 · 2 comments

Comments

@danry25
Copy link
Contributor

danry25 commented Aug 3, 2015

Multiple different radio stations and songs should be able to be played concurrently when you have multiple audio output devices.

This enhancement awaits completion of issue #3, once that issue is complete, this issue can be worked on.

@mk-fg
Copy link
Contributor

mk-fg commented Aug 15, 2015

Implemented via JACK audio options, such as:

  • jack-output-ports
  • jack-music-client-name
  • jack-music-links

ALSA usually provides many output devices with pretty much any modern sound card, e.g. (for crappy internal HDA):

% aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
default
    Default ALSA Output (currently PulseAudio Sound Server)
sysdefault:CARD=SB
    HDA ATI SB, ID 440 Analog
    Default Audio Device
front:CARD=SB,DEV=0
    HDA ATI SB, ID 440 Analog
    Front speakers
surround21:CARD=SB,DEV=0
    HDA ATI SB, ID 440 Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=SB,DEV=0
    HDA ATI SB, ID 440 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=SB,DEV=0
    HDA ATI SB, ID 440 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=SB,DEV=0
    HDA ATI SB, ID 440 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=SB,DEV=0
    HDA ATI SB, ID 440 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=SB,DEV=0
    HDA ATI SB, ID 440 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
hdmi:CARD=SB,DEV=0
    HDA ATI SB, ID 440 Digital
    HDMI Audio Output
hdmi:CARD=HDMI,DEV=0
    HDA ATI HDMI, HDMI 0
    HDMI Audio Output

Each can be plugged into jack via something like alsa_in -d hdmi:CARD=HDMI,DEV=0 (alsa_in is a binary that comes with jack-1, at least, iirc jack-2 has some different way of connecting extra hw).

Default "jack-output-ports" matches everything, so it'll match whatever that alsa_in creates and pjsua audio will be routed there, as well as audio from all players matched by "jack-music-client-name".


Can also be controlled which players get connected to which outputs.

For example, with mpd-1 output config like this:

audio_output {
  type "jack"
  name "jack"
  client_name "mpd.paging:player-1"
}

mpd-2 having "mpd.paging:player-2" there.

./paging.py --dump-jack-ports should list something like this (among other stuff):

  mpd.paging:player-1:right
    type: input (player or other sound source)
    uuid: ...
  mpd.paging:player-1:left
    type: input (player or other sound source)
    uuid: ...
  mpd.paging:player-2:right
    type: input (player or other sound source)
    uuid: ...
  mpd.paging:player-2:left
    type: input (player or other sound source)
    uuid: ...
  system:playback_1:left
    type: output (speakers, audio card or such)
... (you get the idea)

Default jack-music-client-name = ^mpd\.paging:(.*)$ will match all ports above as "player-{1,2}:{left,right}".

Then "jack-music-links" can be set to jack-music-links = player-1:left---playback_1:left player-1:right---playback_1:right player-2:left---playback_2:left player-2:right---playback_2:right to connect all these left-to-right.
paging.example.conf and README have more details on these.

A bit verbose in "jack-music-links", probably can be improved somehow.
For one player, default of jack-music-links = left---left right---right should connect all players to all speakers, left-to-left and right-to-right channel-wise, as thes thing on both sides of "---" are actually regexps, not exact matches.

@mk-fg
Copy link
Contributor

mk-fg commented Aug 16, 2015

jack-music-links is probably not that pretty, but I think this one should be done as well.

Anything on top should be glitter (such as less ugly config spec) and bugfixes (if stuff doesn't work).

@mk-fg mk-fg closed this as completed Aug 16, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants