Transcoding from FLAC to OGG for your Android FAIL

Need help? Post your questions here.

Moderator: moderators

Transcoding from FLAC to OGG for your Android FAIL

Postby papatel » Tue Nov 30, 2010 8:28 am

I'm finally posting here because I've tried so hard to get this working reliably over the past year and it just will not work as expected.

I have streaming working under perfect data conditions (ie wifi). I can stream my FLAC collection to my android and save files preserving gapless tracks! Woohoo awesome, thanks Sindre!

The issue is when I'm on 3g/edge. Almost every time I try to download a song not on wifi, the connection gets interrupted at some point. This is fine and expected on a mobile device and for transcoding to mp3 the stream recovers perfectly. For ogg, its a different story. The stream seems to recover (the download shows progress) but when trying to playback the track at some point it throws: Error Playing "songname". MediaPlayer error:-131 (0) (Exception)

I think this is a generic code for "the stream is effed up and I can't play it"

These are the transcoding configurations, both work as described above but have the same problem mentioned:

Single stage (FLAC>OGG):
1: oggenc -q 7 %s -o - (this preserves tags, WOW!)

Dual stage method (FLAC>OGG):
1: ffmpeg -i %s -f wav -
2: oggenc -q 7 -t %t -a %a -l %l -

I'm running on Linux (Debian Lenny, with latest subsonic 4.2) No special stuff here, plain install. Client is a Nexus One running latest available client from market.

Anyone can replicate this by simply using the transcoding settings above for their Android device, start streaming something over wifi, turn off wifi, then turn wifi back on. This will cause a data interruption and will show the woes of ogg streaming I've had the last year with subsonic.

The bug is particularly annoying because subsonic saves the file to the android device as if it was successful, so unless you go back and manually delete the file, you'll have a busted version of that song forever.

I think there is something wrong with the data stream resume on the client side. I'd really appreciate some advice here and especially someone to repro this to make sure I'm not crazy. Sindre, can you confirm this configuration works? Seriously, this the only way to get decent quality music on your android device while preserving gapless tracks... period.

Why is no one else complaining about this?
papatel
 
Posts: 21
Joined: Fri Jul 09, 2010 12:10 am

Postby papatel » Tue Dec 07, 2010 3:17 am

bump. Anyone else seen flac>ogg transcoding to be unreliable with intermittent data connectivity?
papatel
 
Posts: 21
Joined: Fri Jul 09, 2010 12:10 am

Postby gabbott » Sun Dec 12, 2010 1:51 am

Yeah, I've had some issues with what seems like corrupted files. Also, I've yet to get flac transcoded to ogg with tags preserved. I've used all 3 of the ones you mentioned above.
gabbott
 
Posts: 17
Joined: Tue Nov 30, 2010 12:17 am
Location: US

Postby papatel » Sun Dec 12, 2010 11:18 pm

make sure your flac files are tagged properly to begin with. I had to retag a bunch of stuff using media monkey/winamp to get it all working. Keep at it.

I was hoping Sindre would take a look at this streaming problem with ogg since he's been so diligent about maintaining the Android app. Apparently getting album art working consistently is more important than smooth audio playback currently :)
papatel
 
Posts: 21
Joined: Fri Jul 09, 2010 12:10 am

Postby grimm26 » Mon Dec 20, 2010 7:29 pm

I still can't get flac -> ogg or native off to stream to anything. I tried your recipes and I get nothing.
grimm26
 
Posts: 9
Joined: Mon Dec 20, 2010 7:06 pm

Postby GJ51 » Mon Dec 20, 2010 7:31 pm

You need to search Stozher's posts. He's the man when it comes to transcoding.
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Postby tschan » Sat Jan 01, 2011 9:46 pm

I have exactely the same problems as papatel.

Whenever the internet connection on the phone is interrupted I end up with a corrupted OGG file, regardless of the transcoding settings of subsonic.
tschan
 
Posts: 16
Joined: Sat Jan 01, 2011 9:43 pm

Postby tschan » Wed Jan 05, 2011 11:26 pm

It would be really great if someone (especially a developer) could acknowledge this problem. It should not disappear in the depths of this forum. :)
tschan
 
Posts: 16
Joined: Sat Jan 01, 2011 9:43 pm

Postby GJ51 » Thu Jan 06, 2011 1:23 am

Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Postby tschan » Thu Jan 06, 2011 12:09 pm

The thing is: it is not a transcoding problem per se. Transcoding to OGG is working beautifully and if the phone is connected through wifi or has a steady connection through 3G or whatever, I have a fully working OGG file.

The mentioned problem only occurs when the phone loses its connection while it is downloading the file. It will go on downloading as soon as it has a connection again but the resulting file will be corrupt and unplayable from a certain point forward.

If it helps I could provide an example file where this happened.
tschan
 
Posts: 16
Joined: Sat Jan 01, 2011 9:43 pm

Postby GJ51 » Thu Jan 06, 2011 5:53 pm

That's a problem that I'm pretty sure only Sindre can address. He would need you to send an example phone log that contains the error information. As someone who is unfamiliar with OGG, can I ask why you would use it on the Android as opposed to just transcoding to mp3?

In my transcoding settings, there's an entry ogg>mp3 with

Step 1: ffmpeg -i %s -f wav -

Step 2: lame -b %b - -
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Postby tschan » Thu Jan 06, 2011 6:23 pm

I've determined through double blind testing that I can reach near transparency with OGG at 64 kbit/s. With MP3 I would need at least double that. And because my data plan is capped at 300 mb I want to save as much bandwidth as I can.

So how would I go about getting said phone log?
Last edited by tschan on Thu Jan 06, 2011 11:48 pm, edited 1 time in total.
tschan
 
Posts: 16
Joined: Sat Jan 01, 2011 9:43 pm

Postby GJ51 » Thu Jan 06, 2011 6:58 pm

I use an app called "Log Collector".
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Still not working :(

Postby papatel » Thu Jan 06, 2011 11:34 pm

I got all excited today when I saw the android app update note: "Support for native OGG streaming" I have no idea what this means but it did not fix the above mentioned issue. Same exact behavior. Ogg stream is not able to recover if data connection is lost even momentarily. I tried all the transcoding methods possible for ogg I could think of and no luck.

If someone can guide me how to collect the client (android side) log, I can dump it here. I'd rather just have Sindre take 10 minutes of his time and take a look at this. The repro is sooo simple. He'll probably root cause in minutes and propose some solutions. Looks like he's at least thinking about it after the android app update note.

Please stop asking why we want to stream ogg. If you are happy with your mp3 format, stay that way. Some of us have tasted the benefits of ogg and can never go back.
papatel
 
Posts: 21
Joined: Fri Jul 09, 2010 12:10 am

Postby GJ51 » Fri Jan 07, 2011 12:21 am

Well, excuse us for trying to expand our knowledge while we try to help solve your problem.

If it says the player supports native streaming, then there is no transcoding needed. Just go into the settings for the player and unchek the box that defines the transcoding for the Android player and the ogg file will just pass through without any transcoding. Performance will improve and CPU load at the server will drop to next to nothing.

Please stop asking me how to fix ogg streaming. If you're not happy with it, don't stay that way. Some of us don't have the hassles you do and don't want to. Our servers work and we can never go back. :lol:
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Next

Return to Help

Who is online

Users browsing this forum: No registered users and 14 guests