pulseaudio-raop2 icon indicating copy to clipboard operation
pulseaudio-raop2 copied to clipboard

Device Unplugged & Plugged again

Open ckdo opened this issue 9 years ago • 6 comments

Hi,

First... thank you for this great job ! I have an issue, but I don't really know if it is related to raop2 module or not. First, I'm using raop2 module with an Apple Airport Express Gen#2, and it's working fine, in a "normal" situation.

Because I would like to use in this way, I tested the following procedure:

  • Airport is on, music is playing
  • I just unplugged the airport
  • I plugged it again, and expected the music to be played once the airport is ready

It's not the case, pulseaudio process seems to be frozen, I actually use it with mpd and the mpd process is frozen too (because of pulse I guess), restarting pulseaudio fix the problem, and the music is back again. I tested the same procedure with paplay, and it is the same.

Why am I interested with this ? I'm using mpd with multiple output (DAC & AirPlay device), playing music all the time, and I would be able to have the music played just by switch my airport on in a specific room.

Regards,

ckdo avatar Nov 06 '15 13:11 ckdo

Just to confirm, by unplugging did you mean turning it off (or just disconnect from network)?

hfujita avatar Nov 07 '15 18:11 hfujita

I mean turn it off

ckdo avatar Nov 07 '15 18:11 ckdo

I have seen something similar to this with my Logitech UE AirSpeaker. If someone turns it off, I have to unload and load the raop_discover module to get it back in working order.

Attached is the script I use to knock things back into shape.

I think this is a similar issue to the 'someone else's device uses the same Airplay device'.

Cheers, Toby Haynes

On Sat, 7 Nov 2015 at 13:51 ckdo [email protected] wrote:

I mean turn it off

— Reply to this email directly or view it on GitHub https://github.com/hfujita/pulseaudio-raop2/issues/46#issuecomment-154738531 .

Toby-Haynes avatar Nov 09 '15 00:11 Toby-Haynes

Hi Toby-Haynes,

Could you please upload your script there ? It seems that you have answered by email and it's not automatically joined to your message.

ckdo

ckdo avatar Nov 09 '15 13:11 ckdo

Here's the example script in plain text. A simple search and replace on the raop_output sink name should make it appropriate for other devices.

#! /bin/sh

# Find out if the Air Speaker is visible
checkAirplay=`pacmd list-sinks | grep -E 'name:.*raop_output.Logitech-UE-Air-Speaker'`
if [ -z "$checkAirplay" ]; then
   # Best to unload and reload the discover module
   pactl unload-module module-raop-discover
   pactl load-module module-raop-discover
   sleep 5
fi

checkAirplay=`pacmd list-sinks | grep -E 'name:.*raop_output.Logitech-UE-Air-Speaker'`
if [ -z "$checkAirplay" ]; then
   echo "Failed to find Logitech UE Air Speaker"
   exit -1
fi

# Look for mpd
mpdActive=`ps -ef | grep -v grep | grep -E ' mpd$'`
if [ -z "$mpdActive" ]; then 
    echo Starting MPD
    nohup mpd &
fi

# Ensure that the volume of the speaker is not too loud
pactl set-sink-volume raop_output.Logitech-UE-Air-Speaker-39DB34.local '65%'

# Default all sounds to the normal computer speakers
pacmd set-default-sink alsa_output.pci-0000_00_14.2.analog-stereo

# Show the Music Player Client
if [ -n "$DISPLAY" ]; then
    gmpc &
else
    ps -ef | grep -E 'pulseaudio|mpd'
    echo "Available sound outputs"
    pacmd list-sinks | grep name:
fi

Toby-Haynes avatar Nov 14 '15 00:11 Toby-Haynes

I have a similar issue.

I got a Denon AVR-1912. When I change its input from NET to e.g. DVD music moves back to the laptop speakers as it should. But afterwards I cannot activate the RAOP2 output in pulseaudio again. I need to either restart pulseaudio or reload module-raop-discover like Toby-Haynes to make it work again.

Turning the receiver off causes also the same problem. Probably it is the same when killing a shairport-sync instance.

But there is something strange. I tried to create some steps to reproduce it with shairport-sync, but then it worked as it should. I send audio to the shaircast-sync and kill shaircast-sync. Pulseaudio automatically switches to the AVR-1912 still using the RAOP2 protocol. I start shaircast-sync and I can select it without the need to reload module-raop-discover.

lurtz avatar Dec 07 '15 17:12 lurtz