mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
26.99k stars 2.85k forks source link

Can't play music over airplay #1366

Closed selsta closed 9 years ago

selsta commented 9 years ago

Since 4b65bd5086f832228303cd891a6abd231eeea790 playing music over airplay does not work anymore:

[ao/coreaudio] requested format: 44100 Hz, stereo channels, s16p
[ao/coreaudio] selected audio output device: AirPlay (55)
[ao/coreaudio] failed to convert channel tag to descriptions (561211770)
[ao/coreaudio] layout: tag: <6619138>, bitmap: <0>, descriptions <0>
[ao/coreaudio] could not select a suitable channel map among the hardware supported ones. Make sure to configure your output device correctly in 'Audio MIDI Setup.app'
[ao/coreaudio_exclusive] requested format: 44100 Hz, stereo channels, s16p
[ao/coreaudio_exclusive] selected audio output device: AirPlay (55)
[ao/coreaudio_exclusive] selected device doesn't support digital formats
[ao/null] requested format: 44100 Hz, stereo channels, s16p
[ao/null] device buffer: 8704 samples.
[ao/null] using soft-buffer of 8820 samples.
[cplayer] AO: [null] 44100Hz stereo 2ch s16p
[cplayer] AO: Description: Null audio output

Full log: http://a.pomf.se/pnqniz.txt

I'm running the latest git-master on OS X 10.10.1

selsta commented 9 years ago

https://github.com/selsta/mpv/commit/2314db6e334eb9945a3d1e850f459a948772f633 seemed to fix it for me and did not break 5.1 audio like it did before 4b65bd5086f832228303cd891a6abd231eeea790

pigoz commented 9 years ago

The patch you posted is wrong because you always report back to mpv core that your hardware supports the requested channel layout, so you'd break 7.1 playback (it would not downmix) on broken 5.1 setups and mpv would not even complain (because you would report back you have 8 channels when it's not true and it would not downmix).

The problem in this case is AirPlay is not reporting a meaningful channel layout that can be converted to a bitmap. We could make the fallback to stereo a bit stronger. i.e.: if no channel maps where added to che chmap_sel add a stereo one. Can AirPlay do 5.1?

selsta commented 9 years ago

AirPlay can do 5.1 when the media file is in the .mp4 container. Not sure if it does support it when only the audio output on the Mac is set to play over AirPlay.

ChrisK2 commented 9 years ago

If anything, AirPlay can only do AC3/DTS (although the device doesn't seem to advertise an Encoded Audio mode). It most likely doesn't support discrete 5.1 channels. Assuming a Stereo layout should be pretty safe. screen shot 2014-12-19 at 20 01 34

spaghetti2514 commented 9 years ago

Though I know nothing about this issue and haven't looked into it at all, I would like to report that since this same commit, audio is silent when streaming from twitch.tv to mpv via livestreamer for me. No AirPlay involved, just internal speakers. I've since rolled back my installed version of mpv, but if any verbose logs would be helpful, I'll happily recompile head and report back.