HermesApp / Hermes

Compact macOS Pandora client that doesn’t use Flash
http://hermesapp.org/
MIT License
381 stars 99 forks source link

Audio Quality Very Low in 1.2.7 #263

Closed fridaynext closed 8 years ago

fridaynext commented 8 years ago

I've just upgraded to 1.2.7, and even with 'High' quality checked, it sounds like the stream has downgraded to about 64kbps. There is an incredibly noticeable difference between playing a 192kbps version of a song in my iTunes library, and listening to the same song being streamed with the 'high' setting checked in Hermes.

nriley commented 8 years ago

Was this better in 1.2.6? I've noticed it too. Also — do you subscribe to Pandora One?

fridaynext commented 8 years ago

Yep, it was WAY better in 1.2.6 - indecipherable from my iTunes library. My Pandora One subscription did run out about 3 months ago, but the high def tunes kept playing in Hermes. Upon updating, it's now very low quality. Maybe it reset my login connection and is only pulling low quality songs now.

I just tried restoring the app from a Time Machine Backup, and it is still low quality.

nriley commented 8 years ago

OK, I dug into this a bit. First, yes, probably Pandora noticed that you're no longer subscribed. The best you're going to get without Pandora One should be 128 Kbps MP3, but it's possible something is going wrong and you're getting something lower quality (64 or 32 Kbps AAC+).

Try this version of Hermes: http://sabi.net/temp/Hermes-1.2.8d1.zip. Start it while holding down the Option key, play a different station (this will trigger a playlist to be fetched, otherwise it's cached) then look in ~/Library/Logs/Hermes/ for the log file.

This version has a lot more debugging related to audio formats. Pandora provides audio in two different ways, first via audioUrlMap which you should see as follows, if at all (this is the expected output if you do subscribe to Pandora One):

Pandora.m:489 __35-[Pandora fetchPlaylistForStation:]_block_invoke High quality audio from audioUrlMap is 192 Kbps mp3
Pandora.m:494 __35-[Pandora fetchPlaylistForStation:]_block_invoke Medium quality audio from audioUrlMap is 64 Kbps aacplus

and second from additionalAudioUrl which should just be a list of 3 URLs (if it's fewer or more, that's something to report!)

Pandora.m:499 __35-[Pandora fetchPlaylistForStation:]_block_invoke additionalAudioUrl ( ... )

When the playlist finishes loading it should show you which qualities were fetched, which should all be the same and your desired quality:

Station.m:157 -[Station songsLoaded:] Received hermes.fragment-fetched.54735089062526622 from <Pandora: 0x7fcca16c7160> with qualities: high high high high

Then when audio starts playing you should see what format it actually is:

ASPlaylist.m:78 -[ASPlaylist bitrateReady:] <AudioStreamer: 0x7fcca22a8200> 44.1 KHz '.mp3' ~192 Kbps

I've made some changes to simplify/hopefully improve the format decoding process itself in this version, too, so it may solve your problem, but probably not. Let me know how it goes.

fridaynext commented 8 years ago

Here's what I'm seeing i that log, with the new version you provided me the download for:

Pandora.m:489 35-[Pandora fetchPlaylistForStation:]_block_invoke High quality audio from audioUrlMap is 64 Kbps aacplus Pandora.m:494 35-[Pandora fetchPlaylistForStation:]_block_invoke Medium quality audio from audioUrlMap is 64 Kbps aacplus Pandora.m:499 __35-[Pandora fetchPlaylistForStation:]_block_invoke additionalAudioUrl (

So it's pulling 64kbps for High Quality too, which I guess makes since, because Pandora "caught on" that I no longer have Pandora One. Thanks for helping me debug this. Now I just need to see if any more of those $36/year cards still exist.

nriley commented 8 years ago

Sorry, I didn't carefully read my own post or yours (was sick over the weekend, but no excuse). This is not what Hermes should have been doing. audioUrlMap was only providing the 64 and 32 Kbps AAC+ versions (which may have to do with Hermes pretending to be the Android client) but the other way Hermes requests audio URLs, it was getting a 128 Kbps MP3 (which it was using, prior to 1.2.7). So, try this version (http://sabi.net/temp/Hermes-1.2.8d2.zip). You will need to switch stations to get it to re-fetch but you should see a line like this in the log:

2016-05-23 19:42:58.850 Hermes[65845:6180774] ASPlaylist.m:78 -[ASPlaylist bitrateReady:] <AudioStreamer: 0x6250000af100> 44.1 KHz '.mp3' ~128 Kbps

which indicates that it is actually playing a 128 Kbps MP3. This is a pretty substantial regression so I think I'll probably do a release relatively soon if this fixes it for you.

fridaynext commented 8 years ago

Hey! I think that got me back up to 128kbps again. Here's some relevant logging. (Sounds much better than that 64kbps stream)

Pandora.m:456 -[Pandora fetchPlaylistForStation:] Getting fragment for Keane Radio... Pandora.m:834 -[Pandora sendRequest:] https://tuner.pandora.com/services/json/?method=station.getPlaylist&partner_id=42&auth_token=VIRwLG1mGpKtC2XEeo9VqN3MF4EdlrccW95ktqsuAmdlrn9aof83%2F%2B1w%3D%3D&user_id=205810524 Pandora.m:506 35-[Pandora fetchPlaylistForStation:]_block_invoke High quality audio from audioUrlMap is 64 Kbps aacplus Pandora.m:512 35-[Pandora fetchPlaylistForStation:]_block_invoke Medium quality audio from audioUrlMap is 64 Kbps aacplus Pandora.m:518 35-[Pandora fetchPlaylistForStation:]_block_invoke Low quality audio from audioUrlMap is 32 Kbps aacplus Pandora.m:506 35-[Pandora fetchPlaylistForStation:]_block_invoke High quality audio from audioUrlMap is 64 Kbps aacplus Pandora.m:512 35-[Pandora fetchPlaylistForStation:]_block_invoke Medium quality audio from audioUrlMap is 64 Kbps aacplus Pandora.m:518 35-[Pandora fetchPlaylistForStation:]_block_invoke Low quality audio from audioUrlMap is 32 Kbps aacplus Pandora.m:506 35-[Pandora fetchPlaylistForStation:]_block_invoke High quality audio from audioUrlMap is 64 Kbps aacplus Pandora.m:512 35-[Pandora fetchPlaylistForStation:]_block_invoke Medium quality audio from audioUrlMap is 64 Kbps aacplus Pandora.m:518 35-[Pandora fetchPlaylistForStation:]_block_invoke Low quality audio from audioUrlMap is 32 Kbps aacplus Pandora.m:506 35-[Pandora fetchPlaylistForStation:]_block_invoke High quality audio from audioUrlMap is 64 Kbps aacplus Pandora.m:512 35-[Pandora fetchPlaylistForStation:]_block_invoke Medium quality audio from audioUrlMap is 64 Kbps aacplus Pandora.m:518 35-[Pandora fetchPlaylistForStation:]_block_invoke Low quality audio from audioUrlMap is 32 Kbps aacplus Station.m:157 -[Station songsLoaded:] Received hermes.fragment-fetched.1302768038982216540 from <Pandora: 0x7fee92f64400> with qualities: high high high high Station.m:157 -[Station songsLoaded:] Received hermes.fragment-fetched.1302768038982216540 from <Pandora: 0x7fee92f64400> with qualities: high high high high PlaybackController.m:228 -[PlaybackController playbackStateChanged:] Stream playing: <Song 0x7fee9892d310 Keane - Perfect Symmetry> FMEngine.m:37 -[FMEngine performMethod:withCallback:withParameters:useSignature:httpMethod:] { album = "Perfect Symmetry "; "api_key" = 31fc44bcd6e21954afb404d179a09e9a; "api_sig" = 264ccb7adebe1ce1ca8f32cbe6414071; artist = Keane; chosenByUser = 0; method = "track.updateNowPlaying"; sk = 7720c6d5bd8acebd9c7ca4cb969a1dd3; timestamp = 1464106224; track = "Perfect Symmetry"; } ASPlaylist.m:78 -[ASPlaylist bitrateReady:] <AudioStreamer: 0x7fee95213a00> 44.1 KHz '.mp3' ~128 Kbps

nriley commented 8 years ago

Nice! OK, closing this for real.