Re: [android-developers] Re: MediaPlayer suddenly stopped working in Android 4.2

2013-02-20 Thread Jeff Sharkey
Starting in Android 4.2, processes may have different views of the
filesystem depending on which user they're running as.  For example,
/sdcard/foo.mp3 could refer to different files for different users.

To correctly disambiguate filesystem paths, you'll need to open the
file in your app process and pass the FileDescriptor to the
mediaserver (which is shared between all users on a device).
Something like this should work:

MediaPlayer player;
FileInputStream fis = new FileInputStream(myFile);
try {
player.setDataSource(fis.getFD());
} finally {
fis.close();
}

It sounds like the setDataSource(String path) method needs to be
fixed; tracking in 7962739.

j

On Fri, Feb 15, 2013 at 8:43 AM, Brill Pappin br...@pappin.ca wrote:
 So I've now tested many different ways to try and figure this out and I need
 to reset the code (as I've introduced some silly errors).
 That error is most definitely a path problem which I need to retest and make
 sure I didn't introduce with my own hacking :)

 I *do* know that what was working in 4.1.1 does not work in 4.2.1.

 FYI - I'm also now seeing error 19, which is Error due to general port
 processing whatever that means.

 --
 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Android Developers group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.





--
Jeff Sharkey
jshar...@android.com

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: MediaPlayer suddenly stopped working in Android 4.2

2013-02-20 Thread Brill Pappin
I'm actually using a dynamically generated path based on what the OS says is 
the user's partition, so it's unlikely that the path is incorrect.
What i discovered is that the MediaPlayer refuses to play a file in a custom 
directory under the apps external directory, but will play it if I put it in 
the cache dir. The difference between he two is minimal. e.g.

This *will not* work:
external/Android/data/my.package.name/custom/audio

This *will* work:
external/Android/data/my.package.name/cache/audio

The only difference is the private directory (that is still world readable) at 
the same level in the same parent directory.

Personally I think limiting the audio source for the MediaPlayer like that is 
broken in the first place, but this seems to be an issue that doesn't match 
what the documentation says.

- Brill Pappin



On 2013-02-17, at 2:39 AM, Jeff Sharkey jshar...@google.com wrote:

 Starting in Android 4.2, processes may have different views of the
 filesystem depending on which user they're running as.  For example,
 /sdcard/foo.mp3 could refer to different files for different users.
 
 To correctly disambiguate filesystem paths, you'll need to open the
 file in your app process and pass the FileDescriptor to the
 mediaserver (which is shared between all users on a device).
 Something like this should work:
 
 MediaPlayer player;
 FileInputStream fis = new FileInputStream(myFile);
 try {
player.setDataSource(fis.getFD());
 } finally {
fis.close();
 }
 
 It sounds like the setDataSource(String path) method needs to be
 fixed; tracking in 7962739.
 
 j

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: MediaPlayer suddenly stopped working in Android 4.2

2013-02-19 Thread Brill Pappin
So, for all of you paying attention to this thread or having a similar 
issues with MediaPlayer.

It appears that the MediaPlayer is picky about what directly the files are 
stored in.

This is the change I made that suddenly caused things to start working 
again:

// File root = context.getExternalFilesDir(audio);
File root = new File(context.getExternalCacheDir(), audio);
root.mkdirs();


*If you are an Android OS dev reading this, this is broken!*

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: MediaPlayer suddenly stopped working in Android 4.2

2013-02-19 Thread Mark Murphy
If you can create a sample project that reproduces the error, post it
and your description as an issue on http://b.android.com. If you think
of it, reply on this thread with the issue link.

On Tue, Feb 19, 2013 at 5:18 PM, Brill Pappin br...@pappin.ca wrote:
 So, for all of you paying attention to this thread or having a similar
 issues with MediaPlayer.

 It appears that the MediaPlayer is picky about what directly the files are
 stored in.

 This is the change I made that suddenly caused things to start working
 again:

 // File root = context.getExternalFilesDir(audio);
 File root = new File(context.getExternalCacheDir(), audio);
 root.mkdirs();


 If you are an Android OS dev reading this, this is broken!

 --
 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Android Developers group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.





--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training in DC: http://marakana.com/training/android/

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: MediaPlayer suddenly stopped working in Android 4.2

2013-02-19 Thread Brill Pappin
I can try that. I should have some time away from the crunch later in the 
month :)

To really reproduce exactly what I was doing, I'll need to be able to 
download an mp3 to the external memory, but I assume that a test could be 
set up even if the file is no longer there.

- Brill

On Tuesday, February 19, 2013 5:46:24 PM UTC-5, Mark Murphy (a Commons Guy) 
wrote:

 If you can create a sample project that reproduces the error, post it 
 and your description as an issue on http://b.android.com. If you think 
 of it, reply on this thread with the issue link. 

 On Tue, Feb 19, 2013 at 5:18 PM, Brill Pappin br...@pappin.cajavascript: 
 wrote: 
  So, for all of you paying attention to this thread or having a similar 
  issues with MediaPlayer. 
 


-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: MediaPlayer suddenly stopped working in Android 4.2

2013-02-15 Thread Brill Pappin
Hi Bob,

This is all being run on real hardware (I never use the emulator for 
anything).


On Thursday, February 14, 2013 3:46:37 PM UTC-5, bob wrote:

 Have you tried it on a real device or just the emulator?



 On Thursday, February 14, 2013 11:38:22 AM UTC-6, Brill Pappin wrote:

 I've been working on an app that plays MP3 files and have started with 
 out with the lowest supported android version and working upward toward JB.

 For some reason the MediaPlayer starts generating an error in Android 4.2 
 when it has been working just fine until now.
 Nobody seems to know what has changed or how to work around it. The only 
 suggestions I've found so far are to do with permissions, but unless they 
 have changed radically for external storage, the MediaPlayer should have 
 permission to read the files.

 Here is some relevant information. Notice there is no stack trace, just a 
 message printed out.
 (I've included some of my debugging output for reference).

 02-14 12:24:05.210: I/MessageListFragment(29567): *** FILE [exists:true]: 
 file:///storage/emulated/0/Android/data/com.primaltech.vvm/files/audio/V2013011508.mp3
 02-14 12:24:06.001: D/MessageListFragment(29567): Local data file: id=1, 
 rid=V2013011508, 
 uri=file:///storage/emulated/0/Android/data/com.primaltech.vvm/files/audio/V2013011508.mp3
 02-14 12:24:06.001: D/MessageListFragment(29567): Preparing to play: 
 file:///storage/emulated/0/Android/data/com.primaltech.vvm/files/audio/V2013011508.mp3
 02-14 12:24:06.011: E/MediaPlayer(29567): error (1, -2147483648)
 02-14 12:24:06.051: E/MediaPlayer(29567): Error (1,-2147483648)
 02-14 12:24:06.051: E/MessageListFragment(29567): what: 
 MediaPlayer.MEDIA_ERROR_UNKNOWN

 So far I have seen this on both a Nexus 7 and a Nexus 4 running JB 4.2.1, 
 it seems to work fine for the prior versions that I've been able to test 
 (4.0.4, 4.1.1).






-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: MediaPlayer suddenly stopped working in Android 4.2

2013-02-15 Thread Brill Pappin
I have now verified this same error pops up on a Nexus 10 as well... so now 
we've got it happening on all three (Nexus 4, 7, 10), which is a pretty 
good indication that it's a problem in the MediaPlayer in Android 4.2.x.
This really needs the attention of a google engineer.

Apparently I'm not the only one seeing this:
http://stackoverflow.com/questions/8236095/android-mediaplayer-mediaplayer658-error-1-2147483648

I'm about to do some tests to see if its relate to the encoding of the MP3 
file, however it it worked in android 4.1 it should also work in android 
4.2.

- Brill Pappin



On Thursday, February 14, 2013 12:38:22 PM UTC-5, Brill Pappin wrote:

 I've been working on an app that plays MP3 files and have started with out 
 with the lowest supported android version and working upward toward JB.

 For some reason the MediaPlayer starts generating an error in Android 4.2 
 when it has been working just fine until now.
 Nobody seems to know what has changed or how to work around it. The only 
 suggestions I've found so far are to do with permissions, but unless they 
 have changed radically for external storage, the MediaPlayer should have 
 permission to read the files.

 Here is some relevant information. Notice there is no stack trace, just a 
 message printed out.
 (I've included some of my debugging output for reference).

 02-14 12:24:05.210: I/MessageListFragment(29567): *** FILE [exists:true]: 
 file:///storage/emulated/0/Android/data/com.primaltech.vvm/files/audio/V2013011508.mp3
 02-14 12:24:06.001: D/MessageListFragment(29567): Local data file: id=1, 
 rid=V2013011508, 
 uri=file:///storage/emulated/0/Android/data/com.primaltech.vvm/files/audio/V2013011508.mp3
 02-14 12:24:06.001: D/MessageListFragment(29567): Preparing to play: 
 file:///storage/emulated/0/Android/data/com.primaltech.vvm/files/audio/V2013011508.mp3
 02-14 12:24:06.011: E/MediaPlayer(29567): error (1, -2147483648)
 02-14 12:24:06.051: E/MediaPlayer(29567): Error (1,-2147483648)
 02-14 12:24:06.051: E/MessageListFragment(29567): what: 
 MediaPlayer.MEDIA_ERROR_UNKNOWN

 So far I have seen this on both a Nexus 7 and a Nexus 4 running JB 4.2.1, 
 it seems to work fine for the prior versions that I've been able to test 
 (4.0.4, 4.1.1).






-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: MediaPlayer suddenly stopped working in Android 4.2

2013-02-15 Thread Brill Pappin
More clues:

So it looks like the media player can't open the file. The file URL looks 
borked as well. I know the file exists and (I can see it in code and in 
DDMS).
Here is the trace for it. Note that I'm not *positive* that the path its 
outputting is borked internally or just logging it, but at this point I'm 
assuming that its printing what its seeing.


02-15 10:27:55.611: I/AwesomePlayer(127): setDataSource_l(URL suppressed)
02-15 10:27:55.621: E/(127): Failed to open file 
'/file:/storage/emulated/0/Android/data/com.primaltech.vvm/files/audio/V2013012505.mp3'.
 
(No such file or directory)
02-15 10:27:55.621: E/MediaPlayer(24202): error (1, -2147483648)
02-15 10:27:55.631: E/MediaPlayer(24202): Error (1,-2147483648)
02-15 10:27:55.631: E/MessageListFragment(24202): what: MEDIA_ERROR_UNKNOWN
02-15 10:28:05.006: I/MessageListFragment(24202): *** FILE [true]: 
file:///storage/emulated/0/Android/data/com.primaltech.vvm/files/audio/V2013012505.mp3

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: MediaPlayer suddenly stopped working in Android 4.2

2013-02-15 Thread Brill Pappin
More tests indicate that MediaPlayer can't open the file, even thought the 
file existence and location has been verified, both manually and in code.
The key is from a Nexus 10 running Android 4.2.1 which outputs:
02-15 11:00:40.101: E/(127): Failed to open file 
'/file:/storage/emulated/0/Android/data/com.primaltech.vvm/files/audio/V2013012802.mp3'.
 
(No such file or directory)
02-15 11:00:40.101: E/MediaPlayer(24202): error (1, -2147483648)


I'd say this is a bug in Android 3.2.1.

Task now is to find a way to work around it.

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: MediaPlayer suddenly stopped working in Android 4.2

2013-02-15 Thread Nobu Games
The Stackoverflow thread mentions file permission problems. Is that file 
world readable?

On Friday, February 15, 2013 10:03:35 AM UTC-6, Brill Pappin wrote:

 More tests indicate that MediaPlayer can't open the file, even thought the 
 file existence and location has been verified, both manually and in code.
 The key is from a Nexus 10 running Android 4.2.1 which outputs:
 02-15 11:00:40.101: E/(127): Failed to open file 
 '/file:/storage/emulated/0/Android/data/com.primaltech.vvm/files/audio/V2013012802.mp3'.
  
 (No such file or directory)
 02-15 11:00:40.101: E/MediaPlayer(24202): error (1, -2147483648)


 I'd say this is a bug in Android 3.2.1.

 Task now is to find a way to work around it.


-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: MediaPlayer suddenly stopped working in Android 4.2

2013-02-15 Thread Mahabaleshwara Adiga
Hi,

Can you check your audio codec formats ? Some of the mp3 audio codecs will
be differed.. So by default Media palyer could not play the some mp3 audio
codecs. If you want to see different audio codecs,  go to 'Mediaplayer
codecs in android'. Use proper audio codecs and play smoothly..



On Fri, Feb 15, 2013 at 9:33 PM, Brill Pappin br...@pappin.ca wrote:

 More tests indicate that MediaPlayer can't open the file, even thought the
 file existence and location has been verified, both manually and in code.
 The key is from a Nexus 10 running Android 4.2.1 which outputs:
 02-15 11:00:40.101: E/(127): Failed to open file
 '/file:/storage/emulated/0/Android/data/com.primaltech.vvm/files/audio/V2013012802.mp3'.
 (No such file or directory)
 02-15 11:00:40.101: E/MediaPlayer(24202): error (1, -2147483648)


 I'd say this is a bug in Android 3.2.1.

 Task now is to find a way to work around it.

 --
 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Android Developers group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: MediaPlayer suddenly stopped working in Android 4.2

2013-02-15 Thread Brill Pappin
Yes its readable.

On Friday, February 15, 2013 11:14:34 AM UTC-5, Nobu Games wrote:

 The Stackoverflow thread mentions file permission problems. Is that file 
 world readable?

 On Friday, February 15, 2013 10:03:35 AM UTC-6, Brill Pappin wrote:

 More tests indicate that MediaPlayer can't open the file, even thought 
 the file existence and location has been verified, both manually and in 
 code.
 The key is from a Nexus 10 running Android 4.2.1 which outputs:
 02-15 11:00:40.101: E/(127): Failed to open file 
 '/file:/storage/emulated/0/Android/data/com.primaltech.vvm/files/audio/V2013012802.mp3'.
  
 (No such file or directory)
 02-15 11:00:40.101: E/MediaPlayer(24202): error (1, -2147483648)


 I'd say this is a bug in Android 3.2.1.

 Task now is to find a way to work around it.



-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: MediaPlayer suddenly stopped working in Android 4.2

2013-02-15 Thread Brill Pappin
Its pretty basic. and works fine up until  4.2.1 (e.g. its working in 
4.1.1).



On Friday, February 15, 2013 11:17:39 AM UTC-5, Mahabaleshwara Adiga wrote:

 Hi,

 Can you check your audio codec formats ? Some of the mp3 audio codecs will 
 be differed.. So by default Media palyer could not play the some mp3 audio 
 codecs. If you want to see different audio codecs,  go to 'Mediaplayer 
 codecs in android'. Use proper audio codecs and play smoothly..



 On Fri, Feb 15, 2013 at 9:33 PM, Brill Pappin br...@pappin.cajavascript:
  wrote:

 More tests indicate that MediaPlayer can't open the file, even thought 
 the file existence and location has been verified, both manually and in 
 code.
 The key is from a Nexus 10 running Android 4.2.1 which outputs:
 02-15 11:00:40.101: E/(127): Failed to open file 
 '/file:/storage/emulated/0/Android/data/com.primaltech.vvm/files/audio/V2013012802.mp3'.
  
 (No such file or directory)
 02-15 11:00:40.101: E/MediaPlayer(24202): error (1, -2147483648)


 I'd say this is a bug in Android 3.2.1.

 Task now is to find a way to work around it.

 -- 



-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: MediaPlayer suddenly stopped working in Android 4.2

2013-02-15 Thread Brill Pappin
So I've now tested many different ways to try and figure this out and I 
need to reset the code (as I've introduced some silly errors).
That error is most definitely a path problem which I need to retest and 
make sure I didn't introduce with my own hacking :)

I *do* know that what was working in 4.1.1 does not work in 4.2.1.

FYI - I'm also now seeing error 19, which is Error due to general port 
processing whatever that means.

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: MediaPlayer suddenly stopped working in Android 4.2

2013-02-14 Thread bob
 

Have you tried it on a real device or just the emulator?



On Thursday, February 14, 2013 11:38:22 AM UTC-6, Brill Pappin wrote:

 I've been working on an app that plays MP3 files and have started with out 
 with the lowest supported android version and working upward toward JB.

 For some reason the MediaPlayer starts generating an error in Android 4.2 
 when it has been working just fine until now.
 Nobody seems to know what has changed or how to work around it. The only 
 suggestions I've found so far are to do with permissions, but unless they 
 have changed radically for external storage, the MediaPlayer should have 
 permission to read the files.

 Here is some relevant information. Notice there is no stack trace, just a 
 message printed out.
 (I've included some of my debugging output for reference).

 02-14 12:24:05.210: I/MessageListFragment(29567): *** FILE [exists:true]: 
 file:///storage/emulated/0/Android/data/com.primaltech.vvm/files/audio/V2013011508.mp3
 02-14 12:24:06.001: D/MessageListFragment(29567): Local data file: id=1, 
 rid=V2013011508, 
 uri=file:///storage/emulated/0/Android/data/com.primaltech.vvm/files/audio/V2013011508.mp3
 02-14 12:24:06.001: D/MessageListFragment(29567): Preparing to play: 
 file:///storage/emulated/0/Android/data/com.primaltech.vvm/files/audio/V2013011508.mp3
 02-14 12:24:06.011: E/MediaPlayer(29567): error (1, -2147483648)
 02-14 12:24:06.051: E/MediaPlayer(29567): Error (1,-2147483648)
 02-14 12:24:06.051: E/MessageListFragment(29567): what: 
 MediaPlayer.MEDIA_ERROR_UNKNOWN

 So far I have seen this on both a Nexus 7 and a Nexus 4 running JB 4.2.1, 
 it seems to work fine for the prior versions that I've been able to test 
 (4.0.4, 4.1.1).






-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: MediaPlayer suddenly stopped working in Android 4.2

2013-02-14 Thread Alex Lockwood
The emulated directory you see in the pathname doesn't mean he is using 
the emulator. This directory structure was modified in API 17 due to the 
addition of multiuser support.

I'm having the same problem... trying to figure it out now.

On Thursday, February 14, 2013 3:46:37 PM UTC-5, bob wrote:

 Have you tried it on a real device or just the emulator?



 On Thursday, February 14, 2013 11:38:22 AM UTC-6, Brill Pappin wrote:

 I've been working on an app that plays MP3 files and have started with 
 out with the lowest supported android version and working upward toward JB.

 For some reason the MediaPlayer starts generating an error in Android 4.2 
 when it has been working just fine until now.
 Nobody seems to know what has changed or how to work around it. The only 
 suggestions I've found so far are to do with permissions, but unless they 
 have changed radically for external storage, the MediaPlayer should have 
 permission to read the files.

 Here is some relevant information. Notice there is no stack trace, just a 
 message printed out.
 (I've included some of my debugging output for reference).

 02-14 12:24:05.210: I/MessageListFragment(29567): *** FILE [exists:true]: 
 file:///storage/emulated/0/Android/data/com.primaltech.vvm/files/audio/V2013011508.mp3
 02-14 12:24:06.001: D/MessageListFragment(29567): Local data file: id=1, 
 rid=V2013011508, 
 uri=file:///storage/emulated/0/Android/data/com.primaltech.vvm/files/audio/V2013011508.mp3
 02-14 12:24:06.001: D/MessageListFragment(29567): Preparing to play: 
 file:///storage/emulated/0/Android/data/com.primaltech.vvm/files/audio/V2013011508.mp3
 02-14 12:24:06.011: E/MediaPlayer(29567): error (1, -2147483648)
 02-14 12:24:06.051: E/MediaPlayer(29567): Error (1,-2147483648)
 02-14 12:24:06.051: E/MessageListFragment(29567): what: 
 MediaPlayer.MEDIA_ERROR_UNKNOWN

 So far I have seen this on both a Nexus 7 and a Nexus 4 running JB 4.2.1, 
 it seems to work fine for the prior versions that I've been able to test 
 (4.0.4, 4.1.1).






-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.