Originally created by @higbee4 on GitHub (Jan 16, 2022).
Steps to reproduce
Stream a flac file using iOS safari or the iOS app. It never starts playing. It does work on Android.
Audiobookshelf Version:
Android App?
iOS App?
iOS Version: 15.2.1
Originally created by @higbee4 on GitHub (Jan 16, 2022).
### Steps to reproduce
1. Stream a flac file using iOS safari or the iOS app. It never starts playing. It does work on Android.
Audiobookshelf Version:
- [ ] Android App?
- [X] iOS App?
iOS Version: 15.2.1
adam
added the bug label 2026-04-24 23:05:12 +02:00
If anyone can test this on an earlier iOS version that would be helpful.
Notable: FLAC is the only audio format that uses fMP4 (specs)
2.25. The container format for xHE-AAC, Apple Lossless, and FLAC audio MUST be fMP4.
@advplyr commented on GitHub (Jan 18, 2022):
I am wondering if this is a bug they introduced in 15.2
https://developer.apple.com/forums/thread/695917
If anyone can test this on an earlier iOS version that would be helpful.
**Notable**: FLAC is the only audio format that uses fMP4 ([specs](https://developer.apple.com/documentation/http_live_streaming/hls_authoring_specification_for_apple_devices))
> 2.25. The container format for xHE-AAC, Apple Lossless, and FLAC audio MUST be fMP4.
I think I found the problem. The server transcodes the .flac files to aac. However, it also changes the segment to use fMP4. Since the file has been transcoded to aac it doesn't need fMP4.
I tested with the following change, and it worked for me. (Force aac transcode, but keep mpegts segment type).
get hlsSegmentType() {
var hasFlac = this.tracks.find(t => t.ext.toLowerCase() === '.flac')
if (hasFlac) this.transcodeOptions.forceAAC = true
return 'mpegts'
}
I tried to get it to work without transcoding and with fMP4 which I think would be preferable. But I haven't been able to figure out how to get that to work yet.
@higbee4 commented on GitHub (Feb 6, 2022):
I think I found the problem. The server transcodes the .flac files to aac. However, it also changes the segment to use fMP4. Since the file has been transcoded to aac it doesn't need fMP4.
I tested with the following change, and it worked for me. (Force aac transcode, but keep mpegts segment type).
```
get hlsSegmentType() {
var hasFlac = this.tracks.find(t => t.ext.toLowerCase() === '.flac')
if (hasFlac) this.transcodeOptions.forceAAC = true
return 'mpegts'
}
```
I tried to get it to work without transcoding and with fMP4 which I think would be preferable. But I haven't been able to figure out how to get that to work yet.
Thanks for digging into that, that makes sense. Were you able to replicate the crash with the flac transcodes?
@advplyr commented on GitHub (Feb 6, 2022):
Thanks for digging into that, that makes sense. Were you able to replicate the crash with the flac transcodes?
Before I tried changing the transcode on the server, I noticed the app was always returning 0 for getCurrentTime(). I think audioPlayer.currentItem was nil. Anyway, because that always returned 0, playback would stop with the error Audio current time has not increased - cancel interval and pause player.
@higbee4 commented on GitHub (Feb 6, 2022):
I'm not sure which crash you are referring to.
Before I tried changing the transcode on the server, I noticed the app was always returning 0 for getCurrentTime(). I think `audioPlayer.currentItem` was nil. Anyway, because that always returned 0, playback would stop with the error `Audio current time has not increased - cancel interval and pause player`.
I'm not sure why I said crash, I meant to say replicate the issue. The temp fix I guess will be to just transcode with mpegts segment type.
@advplyr commented on GitHub (Feb 6, 2022):
I'm not sure why I said crash, I meant to say replicate the issue. The temp fix I guess will be to just transcode with mpegts segment type.
Just pushed a server update v1.6.65 that will use mpegts for FLAC files and AAC transcode.
Tested on iphone X and was working.
@advplyr commented on GitHub (Feb 7, 2022):
Just pushed a server update `v1.6.65` that will use mpegts for FLAC files and AAC transcode.
Tested on iphone X and was working.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @higbee4 on GitHub (Jan 16, 2022).
Steps to reproduce
Audiobookshelf Version:
iOS Version: 15.2.1
@advplyr commented on GitHub (Jan 18, 2022):
I am wondering if this is a bug they introduced in 15.2
https://developer.apple.com/forums/thread/695917
If anyone can test this on an earlier iOS version that would be helpful.
Notable: FLAC is the only audio format that uses fMP4 (specs)
@higbee4 commented on GitHub (Feb 6, 2022):
I think I found the problem. The server transcodes the .flac files to aac. However, it also changes the segment to use fMP4. Since the file has been transcoded to aac it doesn't need fMP4.
I tested with the following change, and it worked for me. (Force aac transcode, but keep mpegts segment type).
I tried to get it to work without transcoding and with fMP4 which I think would be preferable. But I haven't been able to figure out how to get that to work yet.
@advplyr commented on GitHub (Feb 6, 2022):
Thanks for digging into that, that makes sense. Were you able to replicate the crash with the flac transcodes?
@higbee4 commented on GitHub (Feb 6, 2022):
I'm not sure which crash you are referring to.
Before I tried changing the transcode on the server, I noticed the app was always returning 0 for getCurrentTime(). I think
audioPlayer.currentItemwas nil. Anyway, because that always returned 0, playback would stop with the errorAudio current time has not increased - cancel interval and pause player.@advplyr commented on GitHub (Feb 6, 2022):
I'm not sure why I said crash, I meant to say replicate the issue. The temp fix I guess will be to just transcode with mpegts segment type.
@advplyr commented on GitHub (Feb 7, 2022):
Just pushed a server update
v1.6.65that will use mpegts for FLAC files and AAC transcode.Tested on iphone X and was working.