Plexamp RPi release player when idle

Hi,

I have managed to install Plexamp on raspberry Pi alongside volumio. The problem is that the Plexamp doesn’t release the alsa deviece when not playing so once it is started no other device can access the player. In order to use other player the Plexamp service must be stopped.

Is it possible for current version or any future version that may come to release the player when not playing? I think it would make the application much more useful, as it would be possible to use it alongside other players (e.g. use librespot and Plexamp together).

1 Like

You might want to use a mixer so that several players can use the device/card (you probably don’t need the loopback):

pcm.!default {
type plug
slave.pcm “dmixerloop”
}

ctl.!default {
type hw
card 2
}

pcm.dmixerloop {
type dmix
ipc_key 1024
ipc_perm 0666
slave {
pcm “hw:Loopback,0,0”
period_time 0
period_size 1024
buffer_size 4096
rate 44100
format “S32_LE”
channels 2
}
bindings {
0 0
1 1
}
}

pcm.toloopback {

# Use the ALSA plug-in "plug" for rate-/format-conversion.
type plug

# Forward the audio stream to the ALSA loopback-device
slave {
    pcm {
        # Direct hardware access
        type        hw
        # Loopback card name
        card        "Loopback"
        # Loopback device ID
        device      0
        # Number of audio channels
        channels    2
        # Format of audio stream
        format      "S32_LE"
        # Sampling-rate of audio stream
        rate        44100
    }
}

}

I am not an expert on ALSA. I have a config made by volumio with loopback for brutefir. I have tried to add mixer and use pcm.volumio as slave for it but it was not working. I would very much appreciate some help.

pcm.!default {
    type             copy
    slave.pcm       "volumio"
}

pcm.volumio {
    type             copy
    slave.pcm       "volumioDsp"
}

pcm.volumioDsp {
  type plug
  slave {
    pcm "toDsp"
    format "S32_LE"  # Whatever input format BruteFIR wants, or "unchanged" to use the original format of the audio stream
    channels "unchanged"   # Whatever input channel count BruteFIR wants, or "unchanged" to use the original channel count of the audio stream
    rate "unchanged"   # Whatever input rate BruteFIR wants, or "unchanged" to use the original rate of the audio stream
#    period_time INT # Period time in us or "unchanged" string - I wouldn't set or mess with this unless you see underrun issues
#    buffer_time INT # Buffer time in us or "unchanged" string - I wouldn't set or mess with this unless you see underrun issues
    }
}
# This PCM is used to send the audio to BruteFIR.
# It uses the Loopback,0,5 interface as an output so
# that BruteFIR can read the incoming audio from
# Loopback,1,5 (using the rate/format/channels as
# defined in volumioDsp)
pcm.toDsp {
   type hw
   card "Loopback"
  #device 1
  #subdevice 0
}
# This PCM is used as the output by BruteFIR.
# It isn't technically necessary, but it makes
# it clear where the BruteFIR audio is supposed
# to go, and passes it back to Volumio.
# Note that this assumes that the BruteFIR
# output is using Linear samples (e.g. S16_LE,
# S24_LE, S32_LE etc). If not then a different
# plugin must be used to convert to linear, e.g.
# lfloat if the incoming audio is FLOAT format.
pcm.fromDsp {
  type copy
  slave.pcm "postDsp"
}

pcm.postDsp {
    type             copy
    slave.pcm       "volumioOutput"
}


# There is always a plug before the hardware to be safe
pcm.volumioOutput {
    type plug
    slave.pcm "volumioHw"
}

pcm.volumioHw {
    type hw
    card 5
}

Have you had any luck with this?

When V2B2 first came out I tried it and found the same problem so reverted to V1

Tom

No. I have tried to configure alsa mixer but it was not working as expected. Moreover I noticed that Plexamp on RPi forces reencoding to 128kbps so I decided that it is pointless.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.