Skip to content

Songs stored locally that contain a # in the filename cannot be played #209

@maddavid123

Description

@maddavid123

🌎 Environment

  • Environment: Downloaded from Play Store
  • Device: Google Pixel 8
  • OS: Android 16
  • App Version & Build: Latest from Play Store?

💬 Description

With files store directly on the device, if a song filename contains the # character the song will fail to play. It will successfully be detected and shown as part of your library, but whenever the user attempts to playback this media, no audio plays.

I discovered this due to Utsu-P's album "#SUPER SHIBORIKASU", in which, every file was named: {Artist} - {Album Title} - {Track No}. - {Track name}. (with the actual values filled in.) Removing the album title from the filename resulted in audio playing back correctly. Similarly, I modified the filename of a different song that previously I had no trouble with to include a #, and then that song failed to play.

🦶 Reproduction Steps

Steps to reproduce the behavior:

  1. Store a valid audio file mp3/flac, whatever.
  2. Try to play the song (it works)
  3. Rename the file to include a # character in the name
  4. Try to play the song (it doesn't play)

Not sure how critical this really is — I've unblocked myself simply by changing the filenames, but figure it's worth reporting.


From Debug:

onPlayerError()
com.google.android.exoplayer2.ExoPlaybackException: Source error
	at q5.z.l(SourceFile:17)
	at q5.z.handleMessage(SourceFile:306)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.dispatchMessage(Looper.java:315)
	at android.os.Looper.loopOnce(Looper.java:251)
	at android.os.Looper.loop(Looper.java:349)
	at android.os.HandlerThread.run(HandlerThread.java:100)
Caused by: com.google.android.exoplayer2.upstream.FileDataSource$FileDataSourceException: uri has query and/or fragment, which are not supported. Did you call Uri.parse() on a string containing '?' or '#'? Use Uri.fromFile(new File(path)) to avoid this. path=/storage/emulated/0/Music/Utsu-P/2020 - SUPER SHIBORIKASU/鬱P - 01 ,query=null,fragment= 風邪.flac
	at com.google.android.exoplayer2.upstream.FileDataSource.v(SourceFile:115)
	at com.google.android.exoplayer2.upstream.FileDataSource.g(SourceFile:10)
	at h7.l.g(SourceFile:315)
	at h7.r.g(SourceFile:13)
	at com.google.android.exoplayer2.source.m$a.a(SourceFile:26)
	at com.google.android.exoplayer2.upstream.Loader$c.run(SourceFile:37)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1154)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:652)
	at java.lang.Thread.run(Thread.java:1563)
Caused by: java.io.FileNotFoundException: /storage/emulated/0/Music/Utsu-P/2020 - SUPER SHIBORIKASU/鬱P - 01 : open failed: ENOENT (No such file or directory)
	at libcore.io.IoBridge.open(IoBridge.java:574)
	at java.io.RandomAccessFile.<init>(RandomAccessFile.java:307)
	at java.io.RandomAccessFile.<init>(RandomAccessFile.java:237)
	at java.io.RandomAccessFile.<init>(RandomAccessFile.java:154)
	at com.google.android.exoplayer2.upstream.FileDataSource.v(SourceFile:16)
	... 8 more
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
	at libcore.io.Linux.open(Native Method)
	at libcore.io.ForwardingOs.open(ForwardingOs.java:574)
	at libcore.io.BlockGuardOs.open(BlockGuardOs.java:274)
	at libcore.io.ForwardingOs.open(ForwardingOs.java:574)
	at android.app.AndroidForwardingOs.open(AndroidForwardingOs.java:120)
	at libcore.io.IoBridge.open(IoBridge.java:560)
	... 12 more

Looks like the critical line is:
Caused by: com.google.android.exoplayer2.upstream.FileDataSource$FileDataSourceException: uri has query and/or fragment, which are not supported. Did you call Uri.parse() on a string containing '?' or '#'? Use Uri.fromFile(new File(path)) to avoid this. path=/storage/emulated/0/Music/Utsu-P/2020 - SUPER SHIBORIKASU/鬱P - 01 ,query=null,fragment= 風邪.flac

It's incorrectly interpreting the character as a delimiter URI fragment

So possibly this?

Unfortunately I'm not at all booked up on Android well enough to determine whether the recommended fix in the Exception is satisfactory, or whether it would cause unintentional behavioural changes. My device also isn't set up for Android dev, so I shall not be opening a pull for this issue.

As mentioned, simple fix in user-land is to simply rename the file to remove the character, that's enough to unblock me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions