title: Android App wants Access to "/Data" Folder
body: <p>I want to stream AAC encoded audio Data from my Raspberry to my Android Phone.
  The part of receiving the data works well but there are some problems with decoding it. </p>
  
  <p>I use Media Extractor and Media Codec to decode the audio data. 
  Here is the important part of the code:</p>
  
  <pre><code>MediaExtractor extractor = new MediaExtractor();
  Uri path = Uri.fromFile(file);
  
  extractor.setDataSource(path.toString());
  
  format = extractor.getTrackFormat(0); 
      String mime = format.getString(MediaFormat.KEY_MIME); 
      decoder = MediaCodec.createDecoderByType(mime); 
      decoder.configure(format, null, null, 0); 
  
  
      while (!stopTrack) { 
  
  
          multicastSocket.receive(packet); 
  
          decoder.start(); 
          data = packet.getData(); 
  
          inputBuffers = decoder.getInputBuffers(); 
          outputBuffers = decoder.getOutputBuffers(); 
          inputBufferIndex = decoder.dequeueInputBuffer(-1); 
  
          if (inputBufferIndex &gt;= 0) 
          { 
              inputBuffer = inputBuffers[inputBufferIndex]; 
              inputBuffer.clear(); 
  
              inputBuffer.put(data); 
  
              decoder.queueInputBuffer(inputBufferIndex, 0, data.length, 0, 0); 
          } 
  
          bufferInfo = new MediaCodec.BufferInfo(); 
          outputBufferIndex = decoder.dequeueOutputBuffer(bufferInfo, 0); 
  
          while (outputBufferIndex &gt;= 0) 
          { 
              outputBuffer = outputBuffers[outputBufferIndex]; 
  
              outputBuffer.position(bufferInfo.offset); 
              outputBuffer.limit(bufferInfo.offset + bufferInfo.size); 
  
              outData = new byte[bufferInfo.size]; 
              outputBuffer.get(outData); 
  
              //  Log.d("AudioDecoder", outData.length + " bytes decoded"); 
  
             track.write(outData, 0, outData.length); 
  
              decoder.releaseOutputBuffer(outputBufferIndex, false); 
              outputBufferIndex = decoder.dequeueOutputBuffer(bufferInfo, 0); 
  
          } 
  </code></pre>
  
  <p>These are the error messages I receive in the logcat:</p>
  
  <pre><code>D/ExtendedUtils: Try creating ExtendedExtractor 
  E/MM_OSAL: FileSource::FileSource 
  E/MM_OSAL: FileSource::FileSource m_bEveryThingOK 1 
  E/MM_OSAL: MM_File_Create File Name /data/mmosal_logmask.cfg , Mode 0 
  E/MM_OSAL: MM_File_Create failed .Efs Error No -1 , File Name      /data/mmosal_logmask.cfg , Mode 0 
  E/MM_OSAL: Open or read fail on /data/mmosal_logmask.cfg. Possible permission denied issue. Looking for /data/misc/media/mmosal_logmask.cfg 
  E/MM_OSAL: MM_File_Create File Name /data/misc/media/mmosal_logmask.cfg , Mode 0  
  E/MM_OSAL: MM_File_Create failed .Efs Error No -1 , File Name /data/misc/media/mmosal_logmask.cfg , Mode 0 
  E/MMParserExtractor:  FileSourceWrapper::New returned NULL 
  D/ExtendedUtils: default extractor is NULL, return extended extractor 
  E/MM_OSAL: FileSource::FileSource 
  E/MM_OSAL: FileSource::FileSource m_bEveryThingOK 1 
  E/MM_OSAL: MM_File_Create File Name /data/mmosal_logmask.cfg , Mode 0 
  E/MM_OSAL: MM_File_Create failed .Efs Error No -1 , File Name /data/mmosal_logmask.cfg , Mode 0 
  E/MM_OSAL: Open or read fail on /data/mmosal_logmask.cfg. Possible permission denied issue. Looking for /data/misc/media/mmosal_logmask.cfg 
  E/MM_OSAL: MM_File_Create File Name /data/misc/media/mmosal_logmask.cfg , Mode 0 
  E/MM_OSAL: MM_File_Create failed .Efs Error No -1 , File Name /data/misc/media/mmosal_logmask.cfg , Mode 0 
  E/MM_OSAL: parseTransportStreamPacket isPESPacket failed 18954 
  E/MM_OSAL: parseTransportStreamPacket isPESPacket failed 18783 
  E/MM_OSAL: parseTransportStreamPacket isPESPacket failed 18954 
  E/MM_OSAL: parseTransportStreamPacket isPESPacket failed 18783 
  I/OMXClient: Using client-side OMX mux. 
  E/OMXMaster: A component of name 'OMX.qcom.audio.decoder.aac' already exists, ignoring this one. 
  D/MediaCodec: MediaCodec[kWhatConfigure]: video-output-protection: 00000000, audio-output-protection: 00000000 
  E/Format:: audio/mp4a-latm 
  W/SoftAAC2: aacDecoder_DecodeFrame decoderErr = 0x4004 
  W/SoftAAC2: AAC decoder returned error 0x4004, substituting silence 
  I/SoftAAC2: Reconfiguring decoder: 0-&gt;44100 Hz, 0-&gt;0 channels 
  </code></pre>
  
  <p>What is MM_OSAL and why does it want to create a file in the "/data" folder on my phone? I searched for it and found out that you need root rights to have access to this folder. 
  I debug the app with android studio directly connected with my phone over USB, is this a problem?</p>
  
  <p>Thanks for any help!</p>