Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device Unplugged & Plugged again #46

Open
ckdo opened this issue Nov 6, 2015 · 6 comments
Open

Device Unplugged & Plugged again #46

ckdo opened this issue Nov 6, 2015 · 6 comments
Labels

Comments

@ckdo
Copy link

ckdo commented Nov 6, 2015

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,

@hfujita hfujita added the bug label Nov 7, 2015
@hfujita
Copy link
Owner

hfujita commented Nov 7, 2015

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

@ckdo
Copy link
Author

ckdo commented Nov 7, 2015

I mean turn it off

@Toby-Haynes
Copy link

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
#46 (comment)
.

@ckdo
Copy link
Author

ckdo commented Nov 9, 2015

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

@Toby-Haynes
Copy link

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

@lurtz
Copy link

lurtz commented Dec 7, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants