warren-bank / Android-AirPlay-Client

AirPlay (version 1) client for Android
GNU General Public License v3.0
41 stars 5 forks source link

[Android 11] Crash on app start #1

Closed aca-info closed 2 years ago

aca-info commented 2 years ago

Hello,

Thank you for forking this project. I wanted to test the audio stream to an airport express but the application is crashing as soon as I launch it. I'm using the v0.5.0 on a Pocophone F1 on Android 11. The exception says that it needs android.permission.FOREGROUND_SERVICE.

Can you help me ?

warren-bank commented 2 years ago

That was a dumb oversight on my part.. thanks for letting me know; I'll add the permission today.. along with a minor release.

Funny that when I tested the app in Android 8.. it didn't crash with this exception.

However, regarding audio..

warren-bank commented 2 years ago

PS: there are other apps out there that specifically implement AirTunes v1..

PPS: actually, you can ignore that last comment..

PPPS: this is interesting..

warren-bank commented 2 years ago

v0.5.1 release adds some missing permissions.. so you should now be able to test the client app and see what (if anything) happens on your airport express receiver.

aca-info commented 2 years ago

Wow ! Thank you very much for the release and your fast answer. :)

I'm not a fan of Apple but I was using the airport as a cheap DAC to stream some audio into a very old HK amplifier. On linux, I was using this so I think you're right about the RTSP audio. The only app that works so far on Android is this one. But unfortunately it's not open source and only a trial... I didn't know about Toaster Cast maybe it will work for me also.

There's no crash on the new release anymore but I'm stuck with "No services found". Maybe it can't detect airport receiver ?

aca-info commented 2 years ago

I've also found this repo and this one which seems to have an Airtunes player implementation. I will try to look both this weekend.

warren-bank commented 2 years ago

I completely forgot about AirMusic..

I took only a super fast browse through this repo so far..

warren-bank commented 2 years ago

wait wait wait.. your 2nd repo.. this one is most definitely client code.. and it looks good!

PS: the upstream repo is ahead by a PR

interesting comment from the developer about its current state and audio format limitations. It currently only supports .wav files.. there's no built-in transcoders to convert other audio formats to .wav before streaming. I'd want to refer to the AirTunes v1 spec.. to see what it has to say about this.

warren-bank commented 2 years ago

spec says.. supported audio codecs are:

discussion on SO says.. WAV is a container format that 99.9% of the time contains PCM data (following a mandatory header).

warren-bank commented 2 years ago

this blog has a great tutorial that outlines how to transcode audio files in any format that is natively supported by Android.. to PCM

rather than writing the PCM buffers to an AudioTrack.. it would be written to the RTSP stream

touch points:

warren-bank commented 2 years ago

Before making any improvements to the "Peeler" app.. I'm curious if its basic functionality works.

I forked it and built an APK.. would you be willing to test it? ..remember, this version only supports WAV files.

aca-info commented 2 years ago

how in the world did you find this? :)

By searching in the depths of github ^^ (Really just using "airplay/airport express android" search terms and focusing on code instead of repositories)

any interest in a copy of the APK when I do?

Of course, I can to test it.

Concerning Peeler, that's some great news ! :) I installed the apk but no luck so far, the "Devices" tab is not showing any receiver and there's nothing in the logs...

warren-bank commented 2 years ago

Hmm.. that's not encouraging.

If this client could discover your receiver and play PCM from an audio file, then I'd be willing to tinker with it. But since it apparently needs much more work.. I apologize, but I'm out.

aca-info commented 2 years ago

No problem I understand. I'll try it myself. Thank you for all the information. :)