Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Soundbridge FLAC to ALAC #1182

Closed
frankusb opened this issue Jan 28, 2021 · 11 comments
Closed

Soundbridge FLAC to ALAC #1182

frankusb opened this issue Jan 28, 2021 · 11 comments

Comments

@frankusb
Copy link

Is there a way to set the transcoding of FLAC to ALAC? Wired clients have no issue with 1.4Mbps WAV but the Soundbridge Radio only has 802.11b and I've been fighting it buffering for some time. I've setup a dedicated access point for 2 wireless Soundbridges but so far haven't quite gotten it physically close enough to be buffer free.

https://soundbridge.roku.com/support/dwnld_update_2_7.php states "Apple Lossless (ALAC) files may now be played natively, without transcoding on the server. Please note that some ALAC encoders don't write file information in the expected way, and these files may not play. Files encoded by iTunes should work fine."

@ejurgensen
Copy link
Member

There is no way to do that right now, but I tried implementing just to see if it would work. I set ffmpeg to transcode to ALAC and to format as mpeg-4 (mp4/m4a). The latter turned out to be a problem. Apparently, mp4 doesn't work with streamed encoding. Or maybe I just don't know how to get ffmpeg to do it.

I don't know if there are other formats for ALAC that the Soundbridge will understand.

Did you try converting some of your FLAC to MP4/ALAC and then setting "no_decode = { "alac" }" in the config file? Then I think the raw files should be served to your Soundbridge. Not exactly the solution you are after, but that way you can test if buffering is solved.

@frankusb
Copy link
Author

I made the change to the config file, restarted forked-daapd, performed the below command and it played fine and showed the type as Kind: Apple Lossless audio file, Bit Rate: 870kbps.

ffmpeg -i song.flac -vn -acodec alac song.m4a

@frankusb
Copy link
Author

I have other devices that do not support ALAC. Maybe ffmpegfs might be an option. Why can't everyone get along?

@ejurgensen
Copy link
Member

I could add alac to this list, then by default any Roku clients would get the source files, and your other devices might still work? Do you think that could work?

@frankusb
Copy link
Author

Sorry, I meant devices not served by forked-daapd but copied from the same music files (portable music player, car).

So from the link regarding mp4 doesn't work with streamed encoding, I guess this implies ffmpegfs must do the entire file before responding?

@frankusb
Copy link
Author

I don't see why you shouldn't allow alac to be served directly to Soundbridges though.

@ejurgensen
Copy link
Member

Yes, seems the entire file needs to be encoded before the header can be written.

I've added alac. Other than that I can't think of anything to do, so I will close the issue.

@frankusb
Copy link
Author

I appreciate you looking at it.

whatdoineed2do pushed a commit to whatdoineed2do/forked-daapd that referenced this issue Feb 17, 2021
@frankusb
Copy link
Author

frankusb commented Oct 9, 2023

I'm curious how Airplay clients can get served ALAC streams from FLAC source files but Soundbridge clients cannot.

@ejurgensen
Copy link
Member

I don't exactly recall the issues with this, but re-reading the above indicates that we would need to serve the alac as m4a formated files, and that requires a different encoding/muxing paradigm. With Airplay, the container of the alac is RTP packets.

@frankusb
Copy link
Author

frankusb commented Oct 9, 2023

Ah, that makes sense. Thank you.

ejurgensen added a commit that referenced this issue Dec 19, 2023
Also changes WAV encoding to use source quality instead of fixed 44100/16/2.
Sets the default to WAV, since it has the best quality, and doesn't have the
delay that creating an MP4 container for ALAC currently has (TODO prepare
the headers to avoid the delay).

Ref issue #1182 and #1665
ejurgensen added a commit that referenced this issue Jan 7, 2024
Also changes WAV encoding to use source quality instead of fixed 44100/16/2.
Sets the default to WAV, since it has the best quality, and doesn't have the
delay that creating an MP4 container for ALAC currently has (TODO prepare
the headers to avoid the delay).

Ref issue #1182 and #1665
ejurgensen added a commit that referenced this issue Jun 17, 2024
Also changes WAV encoding to use source quality instead of fixed 44100/16/2.
Sets the default to WAV, since it has the best quality, and doesn't have the
delay that creating an MP4 container for ALAC currently has (TODO prepare
the headers to avoid the delay).

Ref issue #1182 and #1665
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants