[Nexus 5 Original Android Development] st-w:
Music playback

Similar to the problem described above I'm facing the issue that music playback doesn't work, with these exceptions or special properties:

I tried several music apps (official "music" app; Google Play Music; Shuttle+) - same problem with all of them

problem doesn't affect playback via bluetooth; playback via speakers or connected headphones is affected

problem only affects music; videos are not effected, also special music file formats (like .wav files) are not affected; ringtone/alarm/notification sounds/etc. are not effected

problem does not occur immediately after reboot; it occurs when switching from currently playing music track to the next (but it doesn't always stop on the first time switching the track)

Once the problem occurs I haven't found a way to fix it again other than reboot

LineageOS 14.1-20181226-NIGHTLY-hammerhead

Logcat error messages during playback with "Google Play Music" when the problem exists:

01-07 00:06:12.726 231 16638 E audio_hw_primary: start_output_stream: cannot open device '/dev/snd/comprC0D9': Device or resource busy: /system/bin/audioserver
01-07 00:06:12.726 231 16638 W offload_visualizer: visualizer_hal_stop_output output not started: /system/bin/audioserver
01-07 00:06:12.726 231 16638 W offload_effect_bundle: offload_effects_bundle_hal_stop_output output not started: /system/bin/audioserver
01-07 00:06:12.726 231 16638 D audio_hw_primary: disable_audio_route: usecase(3) reset and update mixer path: compress-offload-playback: /system/bin/audioserver
01-07 00:06:12.740 241 16635 D AudioSink: callbackwrapper: EVENT_UNDERRUN (discarded): /system/bin/mediaserver
01-07 00:06:12.740 231 16638 D audio_hw_primary: enable_audio_route: usecase(3) apply and update mixer path: compress-offload-playback: /system/bin/audioserver
01-07 00:06:12.740 231 16638 E audio_hw_primary: start_output_stream: cannot open device '/dev/snd/comprC0D9': Device or resource busy: /system/bin/audioserver
01-07 00:06:12.740 231 16638 W offload_visualizer: visualizer_hal_stop_output output not started: /system/bin/audioserver
01-07 00:06:12.740 231 16638 W offload_effect_bundle: offload_effects_bundle_hal_stop_output output not started: /system/bin/audioserver
01-07 00:06:12.740 231 16638 D audio_hw_primary: disable_audio_route: usecase(3) reset and update mixer path: compress-offload-playback: /system/bin/audioserver
01-07 00:06:12.754 231 16638 D audio_hw_primary: enable_audio_route: usecase(3) apply and update mixer path: compress-offload-playback: /system/bin/audioserver
01-07 00:06:12.754 241 16635 D AudioSink: callbackwrapper: EVENT_UNDERRUN (discarded): /system/bin/mediaserver
01-07 00:06:12.754 231 16638 E audio_hw_primary: start_output_stream: cannot open device '/dev/snd/comprC0D9': Device or resource busy: /system/bin/audioserver
01-07 00:06:12.754 231 16638 W offload_visualizer: visualizer_hal_stop_output output not started: /system/bin/audioserver
01-07 00:06:12.754 231 16638 W offload_effect_bundle: offload_effects_bundle_hal_stop_output output not started: /system/bin/audioserver
01-07 00:06:12.754 231 16638 D audio_hw_primary: disable_audio_route: usecase(3) reset and update mixer path: compress-offload-playback: /system/bin/audioserver
01-07 00:06:12.767 241 16635 D AudioSink: callbackwrapper: EVENT_UNDERRUN (discarded): /system/bin/mediaserver
01-07 00:06:12.767 231 16638 D audio_hw_primary: enable_audio_route: usecase(3) apply and update mixer path: compress-offload-playback: /system/bin/audioserver
01-07 00:06:12.768 231 16638 E audio_hw_primary: start_output_stream: cannot open device '/dev/snd/comprC0D9': Device or resource busy: /system/bin/audioserver
01-07 00:06:12.768 231 16638 W offload_visualizer: visualizer_hal_stop_output output not started: /system/bin/audioserver
01-07 00:06:12.768 231 16638 W offload_effect_bundle: offload_effects_bundle_hal_stop_output output not started: /system/bin/audioserver
01-07 00:06:12.768 231 16638 D audio_hw_primary: disable_audio_route: usecase(3) reset and update mixer path: compress-offload-playback: /system/bin/audioserver
01-07 00:06:12.781 241 16635 D AudioSink: callbackwrapper: EVENT_UNDERRUN (discarded): /system/bin/mediaserver
01-07 00:06:12.781 231 16638 D audio_hw_primary: enable_audio_route: usecase(3) apply and update mixer path: compress-offload-playback: /system/bin/audioserver

In comparison to the problem described by VincyZed:

I did not upload new MP3 files recently and do not have big ones (like 100MB) on my phone.

My phone is currently not short on free storage space (and wasn't since I installed LineageOS).

I converted a 320kbps audio file to 96kbps (constant) and it doesn't play neither.

I don't use or have installed Magisk.

Music doesn't work no matter where in the internal storage it's stored.

I haven't noted playback position jumps/changes on volume change. For me the apps seems to play files normally, there's just no sound. Just when switching tracks the delay until playback starts seems to be a bit longer than usual.

I can't tell for sure that it worked previosly, because I switched from stock ROM to LineageOS just one month ago or so, but I think it worked (it definitely worked with the stock ROM). The only change to the system I can remember was installing a LineageOS security update in december (but I can't tell whether that has anything to do with the issue or not).

I already tried uninstalling many apps, but that didn't help.

Thanks for any help to fix that issue.