masmu / pulseaudio-dlna

A lightweight streaming server which brings DLNA / UPNP and Chromecast support to PulseAudio and Linux
GNU General Public License v3.0
1.25k stars 161 forks source link

Sounds switches back to PC audio card #360

Open ghomem opened 5 years ago

ghomem commented 5 years ago

I'm not sure if this is an pulseaudio-dlna issue and if it is not sure if it is a bug. If so, i apologize for the noise.

When I am using pulseaudio-dlna to stream from mixcloud using Firefox I first select the stream from pavucontrol and route it to the cast device. Once the mixcloud track is finished and the next one starts playing, the sound gets routed again to the PC audio card and I need to re-reoute it manually to the cast device.

Is there something that can be done about this?

Update: seems to affect mixcloud but not soundcloud. Update 2: after a dist-upgrade this doesn't seem to affect mixcloud anymore

OvermindDL1 commented 5 years ago

When I am using pulseaudio-dlna to stream from mixcloud using Firefox I first select the stream from pavucontrol and route it to the cast device. Once the mixcloud track is finished and the next one starts playing, the sound gets routed again to the PC audio card and I need to re-reoute it manually to the cast device.

That sounds like the site is diconnecting the audio connection then reconnecting instead of just changing the audio being sent. Just normal PA handling then, you can just change the default of the firefox audio stream routing to the output stream that you want.

ghomem commented 5 years ago

you can just change the default of the firefox audio stream routing to the output stream that you want.

I'm sorry if I overlooked something but I'm not finding a way to do that (Firefox 63). A quick search took me to others asking about this but no answers.

OvermindDL1 commented 5 years ago

Ah, apparently Firefox now owns its pulseaudio context as of version 53 or 57 or something like that! Try going to about:config and looking through the media. options, it's "supposed to be" all settable in there.

I.E. blame Firefox. :-)

ghomem commented 5 years ago

No luck.

And it seems that it is not possible in a practical way to change the default pulse audio output on the fly. Complicated answer here:

https://askubuntu.com/questions/71863/how-to-change-pulseaudio-sink-with-pacmd-set-default-sink-during-playback/72076#72076

Conclusion: it seems not possible to stream continuously from firefox (chrome supports casting natively and can stream a tab but it also sends the tab image, which is a waste of bandwidth and not always reliable via wireless).

ghomem commented 5 years ago

No luck on about:config and it also seems that there is no practical way to switch the default Pulseaudio sink to just use the cast device. Complicated answer (with scripts) here:

https://askubuntu.com/questions/71863/how-to-change-pulseaudio-sink-with-pacmd-set-default-sink-during-playback/72076#72076

Therefore, seems that it is not possible to continuously cast from Firefox by means of Pulse Audio. (Chrome can cast a tab natively but it also sends the tab image, which is a waste of bandwidth and not always reliable via wireless).

ghomem commented 5 years ago

(pardon the duplicated comments, there is some refresh issue with github)

ghomem commented 5 years ago

This problem happened to me several time but today it is not happening - I did dist-upgrade for other reasons which may or may not be related.

I suggest we leave this issue open for sometime to see if other users are affected or not.

Thanks @OvermindDL1 for your answers.