Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ampache & Subsonic don't playback .m4a files #2695

Closed
spectrumcomputing opened this issue Apr 7, 2019 · 8 comments
Closed

Ampache & Subsonic don't playback .m4a files #2695

spectrumcomputing opened this issue Apr 7, 2019 · 8 comments
Labels
Feature request 🏭 META Everything that is not code related, e.g. GitHub, Wiki, website, community Solution available 🥂 Definite solution has been done
Milestone

Comments

@spectrumcomputing
Copy link
Contributor

spectrumcomputing commented Apr 7, 2019

Required Information

root@DietPi:~# #!/bin/bash
root@DietPi:~# G_DIETPI_VERSION_CORE=6
root@DietPi:~# G_DIETPI_VERSION_SUB=22
root@DietPi:~# G_DIETPI_VERSION_RC=3
root@DietPi:~# G_GITBRANCH=master
root@DietPi:~# G_GITOWNER=MichaIng
  • Distro version |
    stretch

  • Kernel version |
    Linux DietPi 4.14.98-v7+ Request | RT Kernel option #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/Linux

  • SBC device | echo $G_HW_MODEL_DESCRIPTION or (EG: RPi3)
    RPi 3 Model B (armv7l)

  • Power supply used | IQ Five Port Mains powered USB

  • SDcard used | Sandisk Ultra

Additional Information (if applicable)

  • Software title | Ampache & Subsonic
  • Fresh Install
  • Can this issue be replicated on a fresh installation of DietPi? Yes
  • dietpi-bugreport Bug report sent, reference code: 0da7208c-3094-4722-b71b-ccf5f2e53432

Steps to reproduce

  1. ... Place .m4a audio files in the music folder
  2. ...Try and play with Ampache

Expected behaviour

  • Music should play

Actual behaviour

  • ... Ampache Freezes

Extra details

Interesting AirSonic plays them back fine.

  • ...
@spectrumcomputing spectrumcomputing changed the title Ampache does not playback .m4a files Ampache & Subsonic don't playback .m4a files Apr 7, 2019
@spectrumcomputing
Copy link
Contributor Author

Hi again,

Following these instructions seems to fix it (at least in Subsonic). Is it possible to get this baked into DietPi, as well as upgrading to the new version of Subsonic:

http://pmdzsite.online.fr/index.php?article17/subsonic-on-raspberry-pi-3

Many thanks

@MichaIng
Copy link
Owner

MichaIng commented Apr 9, 2019

@spectrumcomputing
Thanks for this info.

Ah I found the bug in our code. That was already found and fixed for Airsonic but with Subsonic it's the same. Will fix this, many thanks for reporting!

EDIT: Ah no this was indeed only an issue with Airsonic. So actually we do everything from your link exactly the same way. Not sure if just v6.1.5 was the solution in your case?

@spectrumcomputing
Copy link
Contributor Author

Subsonic now plays .m4a files perfectly. Thank you. Ampache still does not. This may help:

https://github.com/ampache/ampache/wiki/Transcoding

@spectrumcomputing
Copy link
Contributor Author

I enabled logging in Ampache by making some changes in the config file and this is the contents when I try and play .m4a files:

2019-04-10 19:47:32 [admin] (session) -> miudmi14q4v0gvd29vseo3g1m0 has been extended to Wed, 10 Apr 2019 20:47:32 +0100 extension length 3600
2019-04-10 19:47:32 [admin] (session) -> Session created: 79c1c4dc84c22e022fc77ec029bd09ed
2019-04-10 19:47:32 [admin] (session) -> miudmi14q4v0gvd29vseo3g1m0 has been extended to Wed, 10 Apr 2019 20:47:32 +0100 extension length 3600
2019-04-10 19:47:32 [admin] (session) -> miudmi14q4v0gvd29vseo3g1m0 has been extended to Wed, 10 Apr 2019 20:47:32 +0100 extension length 3600
2019-04-10 19:47:32 [admin] (ajax.server.php) -> Called for page: {index}
2019-04-10 19:47:32 [admin] (session) -> miudmi14q4v0gvd29vseo3g1m0 has been extended to Wed, 10 Apr 2019 20:47:32 +0100 extension length 3600
2019-04-10 19:47:32 [admin] (ajax.server.php) -> Called for page: {index}
2019-04-10 19:47:35 [admin] (session) -> miudmi14q4v0gvd29vseo3g1m0 has been extended to Wed, 10 Apr 2019 20:47:35 +0100 extension length 3600
2019-04-10 19:47:35 [admin] (ajax.server.php) -> Called for page: {stream}
2019-04-10 19:47:35 [admin] (stream.ajax.php) -> Called for action {directplay}
2019-04-10 19:47:35 [admin] (stream.ajax.php) -> Play type {}
2019-04-10 19:47:36 [admin] (session) -> miudmi14q4v0gvd29vseo3g1m0 has been extended to Wed, 10 Apr 2019 20:47:36 +0100 extension length 3600
2019-04-10 19:47:36 [admin] (session) -> miudmi14q4v0gvd29vseo3g1m0 has been extended to Wed, 10 Apr 2019 20:47:36 +0100 extension length 3600
2019-04-10 19:47:36 [admin] (stream.php) -> Asked for {play_item}.
2019-04-10 19:47:36 [admin] (stream.php) -> Stream Type: web_player Media IDs: [{"object_type":"song","object_id":"45"}]
2019-04-10 19:47:36 [admin] (session) -> Session created: b0a3015d38735faab013fc9d85f5cdb8
2019-04-10 19:47:36 [admin] (media) -> Using default target format
2019-04-10 19:47:36 [admin] (media) -> Transcode settings: from m4a to mp3
2019-04-10 19:47:36 [admin] (media) -> Command: ffmpeg Arguments: -i %FILE% -vn -b:a %SAMPLE%K -c:a libmp3lame -f mp3 pipe:1
2019-04-10 19:47:36 [admin] (media) -> Changing play url type from {m4a} to {mp3} due to encoding settings...
2019-04-10 19:47:36 [admin] (stream_playlist.class.php) -> Adding url {{"properties":["url","title","author","time","info_url","image_url","album","type","codec","track_num"]}}...
2019-04-10 19:47:36 [admin] (stream_playlist) -> Generating a {web_player} object...
2019-04-10 19:47:36 [admin] (media) -> Using default target format
2019-04-10 19:47:36 [admin] (media) -> Transcode settings: from m4a to mp3
2019-04-10 19:47:36 [admin] (media) -> Command: ffmpeg Arguments: -i %FILE% -vn -b:a %SAMPLE%K -c:a libmp3lame -f mp3 pipe:1
2019-04-10 19:47:36 [admin] (webplayer.class.php) -> Types {{"real":"mp3","player":"mp3"}}
2019-04-10 19:47:36 [admin] (webplayer.class.php) -> Return get_media_js_param {{"title":"Episode 2","artist":"BBC Radio 4 Extra","artist_id":"9","album_id":"9","replaygain_track_gain":"0.000000","replaygain_track_peak":"0.000000","replaygain_album_gain":"0.000000","replaygain_album_peak":"0.000000","media_id":"45","media_type":"song","filetype":"mp3","url":"http://192.168.1.167/ampache/play/index.php?ssid=b0a3015d38735faab013fc9d85f5cdb8&type=song&oid=45&uid=3&name=BBC%20Radio%204%20Extra%20-%20Episode%202.mp3&transcode_to=mp3","poster":"http://192.168.1.167/ampache/image.php?object_id=9&object_type=album&auth=b0a3015d38735faab013fc9d85f5cdb8&thumb=3&name=art.jpg"}}
2019-04-10 19:47:36 [admin] (media) -> Using default target format
2019-04-10 19:47:36 [admin] (media) -> Transcode settings: from m4a to mp3
2019-04-10 19:47:36 [admin] (media) -> Command: ffmpeg Arguments: -i %FILE% -vn -b:a %SAMPLE%K -c:a libmp3lame -f mp3 pipe:1
2019-04-10 19:47:36 [admin] (webplayer.class.php) -> Types {{"real":"mp3","player":"mp3"}}
2019-04-10 19:47:36 [admin] (webplayer.class.php) -> Return get_media_js_param {{"title":"Episode 2","artist":"BBC Radio 4 Extra","artist_id":"9","album_id":"9","replaygain_track_gain":"0.000000","replaygain_track_peak":"0.000000","replaygain_album_gain":"0.000000","replaygain_album_peak":"0.000000","media_id":"45","media_type":"song","filetype":"mp3","url":"http://192.168.1.167/ampache/play/index.php?ssid=b0a3015d38735faab013fc9d85f5cdb8&type=song&oid=45&uid=3&name=BBC%20Radio%204%20Extra%20-%20Episode%202.mp3&transcode_to=mp3","poster":"http://192.168.1.167/ampache/image.php?object_id=9&object_type=album&auth=b0a3015d38735faab013fc9d85f5cdb8&thumb=3&name=art.jpg"}}
2019-04-10 19:47:36 [admin] (session) -> miudmi14q4v0gvd29vseo3g1m0 has been extended to Wed, 10 Apr 2019 20:47:36 +0100 extension length 3600
2019-04-10 19:47:36 [admin] (media) -> Using default target format
2019-04-10 19:47:36 [admin] (media) -> Transcode settings: from m4a to mp3
2019-04-10 19:47:36 [admin] (media) -> Command: ffmpeg Arguments: -i %FILE% -vn -b:a %SAMPLE%K -c:a libmp3lame -f mp3 pipe:1
2019-04-10 19:47:36 [admin] (webplayer.class.php) -> Types {{"real":"mp3","player":"mp3"}}
2019-04-10 19:47:36 [admin] (media) -> Using default target format
2019-04-10 19:47:36 [admin] (media) -> Transcode settings: from m4a to mp3
2019-04-10 19:47:36 [admin] (media) -> Command: ffmpeg Arguments: -i %FILE% -vn -b:a %SAMPLE%K -c:a libmp3lame -f mp3 pipe:1
2019-04-10 19:47:36 [admin] (webplayer.class.php) -> Types {{"real":"mp3","player":"mp3"}}
2019-04-10 19:47:36 [admin] (webplayer.class.php) -> Return get_media_js_param {{"title":"Episode 2","artist":"BBC Radio 4 Extra","artist_id":"9","album_id":"9","replaygain_track_gain":"0.000000","replaygain_track_peak":"0.000000","replaygain_album_gain":"0.000000","replaygain_album_peak":"0.000000","media_id":"45","media_type":"song","filetype":"mp3","url":"http://192.168.1.167/ampache/play/index.php?ssid=b0a3015d38735faab013fc9d85f5cdb8&type=song&oid=45&uid=3&name=BBC%20Radio%204%20Extra%20-%20Episode%202.mp3&transcode_to=mp3","poster":"http://192.168.1.167/ampache/image.php?object_id=9&object_type=album&auth=b0a3015d38735faab013fc9d85f5cdb8&thumb=3&name=art.jpg"}}
2019-04-10 19:47:36 [ampache] (play) -> Asked for type {song}
2019-04-10 19:47:36 [admin] (session) -> b0a3015d38735faab013fc9d85f5cdb8 has been extended to Wed, 10 Apr 2019 21:47:36 +0100 extension length 7200
2019-04-10 19:47:36 [admin] (play) -> Playing file (/mnt/dietpi_userdata/Music/Everyone Quite Likes Justin/Everyone_Quite_Likes_Justin_Series_1_-_2.Episode_2_b01292g0_original.m4a}...
2019-04-10 19:47:36 [admin] (play) -> Media type {m4a}
2019-04-10 19:47:36 [admin] (play) -> Custom play action {}
2019-04-10 19:47:36 [admin] (play) -> Transcode to {mp3}
2019-04-10 19:47:36 [admin] (play) -> Transcoding due to explicit request for mp3
2019-04-10 19:47:36 [admin] (stream.class.php) -> Starting transcode for {/mnt/dietpi_userdata/Music/Everyone Quite Likes Justin/Everyone_Quite_Likes_Justin_Series_1
-_2.Episode_2_b01292g0_original.m4a}. Type {mp3}. Options: Array
2019-04-10 19:47:36 [admin] (stream.class.php) -> (
2019-04-10 19:47:36 [admin] (stream.class.php) -> )
2019-04-10 19:47:36 [admin] (stream.class.php) -> }...
2019-04-10 19:47:36 [admin] (media) -> Explicit format request {mp3}
2019-04-10 19:47:36 [admin] (media) -> Transcode settings: from m4a to mp3
2019-04-10 19:47:36 [admin] (media) -> Command: ffmpeg Arguments: -i %FILE% -vn -b:a %SAMPLE%K -c:a libmp3lame -f mp3 pipe:1
2019-04-10 19:47:36 [admin] (stream) -> Configured bitrate is 32
2019-04-10 19:47:36 [admin] (stream) -> Final transcode bitrate is 32
2019-04-10 19:47:36 [admin] (stream) -> %BITRATE% not in transcode command
2019-04-10 19:47:36 [admin] (stream) -> %MAXBITRATE% not in transcode command
2019-04-10 19:47:36 [admin] (stream) -> %RESOLUTION% not in transcode command
2019-04-10 19:47:36 [admin] (stream) -> %QUALITY% not in transcode command
2019-04-10 19:47:36 [admin] (stream) -> Transcode command: ffmpeg -i '/mnt/dietpi_userdata/Music/Everyone Quite Likes Justin/Everyone_Quite_Likes_Justin_Series_1
-_2.Episode_2_b01292g0_original.m4a' -vn -b:a 32K -c:a libmp3lame -f mp3 pipe:1
2019-04-10 19:47:36 [admin] (stream) -> Transcode command prefix: exec
2019-04-10 19:47:36 [admin] (play) -> Starting stream of /mnt/dietpi_userdata/Music/Everyone Quite Likes Justin/Everyone_Quite_Likes_Justin_Series_1
-_2.Episode_2_b01292g0_original.m4a with size 68568290
2019-04-10 19:47:36 [admin] (play) -> Registering stream stats for {BBC Radio 4 Extra - Episode 2}...
2019-04-10 19:47:37 [admin] (user.class.php) -> Updating stats for {song/45} {Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36}...
2019-04-10 19:47:37 [admin] (user.class.php) -> save_mediaplay...
2019-04-10 19:47:37 [admin] (Last.FM) -> No session key, not scrobbling (need to grant Ampache to last.fm)
2019-04-10 19:47:37 [ampache] (play) -> Asked for type {song}
2019-04-10 19:47:37 [admin] (session) -> b0a3015d38735faab013fc9d85f5cdb8 has been extended to Wed, 10 Apr 2019 21:47:37 +0100 extension length 7200
2019-04-10 19:47:37 [admin] (session) -> miudmi14q4v0gvd29vseo3g1m0 has been extended to Wed, 10 Apr 2019 20:47:37 +0100 extension length 3600
2019-04-10 19:47:37 [admin] (session) -> miudmi14q4v0gvd29vseo3g1m0 has been extended to Wed, 10 Apr 2019 20:47:37 +0100 extension length 3600
2019-04-10 19:47:37 [admin] (ajax.server.php) -> Called for page: {}
2019-04-10 19:47:37 [admin] (play) -> Playing file (/mnt/dietpi_userdata/Music/Everyone Quite Likes Justin/Everyone_Quite_Likes_Justin_Series_1
-_2.Episode_2_b01292g0_original.m4a}...
2019-04-10 19:47:37 [admin] (play) -> Media type {m4a}
2019-04-10 19:47:37 [admin] (play) -> Custom play action {}
2019-04-10 19:47:37 [admin] (play) -> Transcode to {mp3}
2019-04-10 19:47:37 [admin] (play) -> Transcoding due to explicit request for mp3
2019-04-10 19:47:37 [admin] (stream.class.php) -> Starting transcode for {/mnt/dietpi_userdata/Music/Everyone Quite Likes Justin/Everyone_Quite_Likes_Justin_Series_1
-_2.Episode_2_b01292g0_original.m4a}. Type {mp3}. Options: Array
2019-04-10 19:47:37 [admin] (stream.class.php) -> (
2019-04-10 19:47:37 [admin] (stream.class.php) -> )
2019-04-10 19:47:37 [admin] (stream.class.php) -> }...
2019-04-10 19:47:37 [admin] (media) -> Explicit format request {mp3}
2019-04-10 19:47:37 [admin] (media) -> Transcode settings: from m4a to mp3
2019-04-10 19:47:37 [admin] (media) -> Command: ffmpeg Arguments: -i %FILE% -vn -b:a %SAMPLE%K -c:a libmp3lame -f mp3 pipe:1
2019-04-10 19:47:37 [admin] (stream) -> Configured bitrate is 32
2019-04-10 19:47:37 [admin] (stream) -> Final transcode bitrate is 32
2019-04-10 19:47:37 [admin] (stream) -> %BITRATE% not in transcode command
2019-04-10 19:47:37 [admin] (stream) -> %MAXBITRATE% not in transcode command
2019-04-10 19:47:37 [admin] (stream) -> %RESOLUTION% not in transcode command
2019-04-10 19:47:37 [admin] (stream) -> %QUALITY% not in transcode command
2019-04-10 19:47:37 [admin] (stream) -> Transcode command: ffmpeg -i '/mnt/dietpi_userdata/Music/Everyone Quite Likes Justin/Everyone_Quite_Likes_Justin_Series_1
-_2.Episode_2_b01292g0_original.m4a' -vn -b:a 32K -c:a libmp3lame -f mp3 pipe:1
2019-04-10 19:47:37 [admin] (stream) -> Transcode command prefix: exec
2019-04-10 19:47:37 [admin] (play) -> Starting stream of /mnt/dietpi_userdata/Music/Everyone Quite Likes Justin/Everyone_Quite_Likes_Justin_Series_1
-_2._Episode_2_b01292g0_original.m4a with size 68568290
2019-04-10 19:47:37 [admin] (play) -> Registering stream stats for {BBC Radio 4 Extra - Episode 2}...
2019-04-10 19:47:37 [admin] (user.class.php) -> Updating stats for {song/45} {Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36}...
2019-04-10 19:47:37 [admin] (user.class.php) -> save_mediaplay...
2019-04-10 19:47:37 [admin] (Last.FM) -> No session key, not scrobbling (need to grant Ampache to last.fm)
2019-04-10 19:47:37 [admin] (statistics) -> Statistics insertion ignored due to graceful delay.
2019-04-10 19:47:37 [admin] (statistics) -> Statistics insertion ignored due to graceful delay.
2019-04-10 19:47:37 [admin] (statistics) -> Statistics insertion ignored due to graceful delay.
2019-04-10 19:47:37 [admin] (play) -> Transcode stderr: ffmpeg version git-2017-04-18-6108805 Copyright (c) 2000-2017 the FFmpeg developers
2019-04-10 19:47:37 [admin] (play) -> built with gcc 4.9.2 (Raspbian 4.9.2-10)
2019-04-10 19:47:37 [admin] (play) -> configuration: --prefix=/usr --enable-static --enable-gpl --enable-libx264 --enable-pthreads --enable-nonfree --enable-omx --enable-omx-rpi --enable-libfdk-aac --enable-libmp3lame
2019-04-10 19:47:37 [admin] (play) -> libavutil 55. 61.100 / 55. 61.100
2019-04-10 19:47:37 [admin] (play) -> libavcodec 57. 93.100 / 57. 93.100
2019-04-10 19:47:37 [admin] (play) -> libavformat 57. 72.101 / 57. 72.101
2019-04-10 19:47:37 [admin] (play) -> libavdevice 57. 7.100 / 57. 7.100
2019-04-10 19:47:37 [admin] (play) -> libavfilter 6. 84.101 / 6. 84.101
2019-04-10 19:47:37 [admin] (play) -> libswscale 4. 7.101 / 4. 7.101
2019-04-10 19:47:37 [admin] (play) -> libswresample 2. 8.100 / 2. 8.100
2019-04-10 19:47:37 [admin] (play) -> libpostproc 54. 6.100 / 54. 6.100
2019-04-10 19:47:37 [admin] (play) ->
2019-04-10 19:47:37 [admin] (session) -> miudmi14q4v0gvd29vseo3g1m0 has been extended to Wed, 10 Apr 2019 20:47:37 +0100 extension length 3600
2019-04-10 19:47:37 [admin] (ajax.server.php) -> Called for page: {song}
2019-04-10 19:48:32 [admin] (session) -> miudmi14q4v0gvd29vseo3g1m0 has been extended to Wed, 10 Apr 2019 20:48:32 +0100 extension length 3600
2019-04-10 19:48:32 [admin] (ajax.server.php) -> Called for page: {index}
2019-04-10 19:49:33 [admin] (session) -> miudmi14q4v0gvd29vseo3g1m0 has been extended to Wed, 10 Apr 2019 20:49:33 +0100 extension length 3600
2019-04-10 19:49:33 [admin] (ajax.server.php) -> Called for page: {index}
2019-04-10 19:50:33 [admin] (session) -> miudmi14q4v0gvd29vseo3g1m0 has been extended to Wed, 10 Apr 2019 20:50:33 +0100 extension length 3600
2019-04-10 19:50:33 [admin] (ajax.server.php) -> Called for page: {index}
2019-04-10 19:51:33 [admin] (session) -> miudmi14q4v0gvd29vseo3g1m0 has been extended to Wed, 10 Apr 2019 20:51:33 +0100 extension length 3600
2019-04-10 19:51:33 [admin] (ajax.server.php) -> Called for page: {index}
2019-04-10 19:52:01 [admin] (stream) -> Process is not running, kill skipped.
2019-04-10 19:52:01 [admin] (play) -> Stream ended at 6826476 (6826476) bytes out of
2019-04-10 19:52:01 [admin] (stream) -> Process is not running, kill skipped.
2019-04-10 19:52:01 [admin] (play) -> Stream ended at 6826476 (6826476) bytes out of

@MichaIng
Copy link
Owner

@spectrumcomputing
Thanks for the link. From there it seems quite clear how to enable:

G_CONFIG_INJECT 'transcode_m4a[[:blank:]]' 'transcode_m4a      = allowed' /var/www/ampache/config/ampache.cfg.php

But there are reported as well several issues with transcoding enabled on Ampache, which is why it is disabled by default: ampache/ampache#1048

@spectrumcomputing
Copy link
Contributor Author

You sir are a genius :-) Subsonic and Ampache now working perfectly. I will make a donation to the project over the weekend.

@MichaIng
Copy link
Owner

@spectrumcomputing
Thanks for reporting back.

I will add this as info to our online docs. As of above mentioned issues with transcoding on Ampache, we will not implement it by default, but instead direct users to the documentation about how to do so manually. Makes sense as well as you can enable much more sound formats that way.

@MichaIng MichaIng added Allo GUI META Everything that is not code related, e.g. GitHub, Wiki, website, community Solution available 🥂 Definite solution has been done Feature request 🏭 and removed Bug 🐞 Allo GUI labels Apr 16, 2019
@MichaIng MichaIng modified the milestones: v6.23, Website/Wiki Tasks Apr 16, 2019
@MichaIng
Copy link
Owner

Info added to online docs: https://dietpi.com/phpbb/viewtopic.php?p=554#p554
Will mark this as closed. Feel free to reopen, if required.

@MichaIng MichaIng modified the milestones: Website/Wiki Tasks, v6.23 May 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request 🏭 META Everything that is not code related, e.g. GitHub, Wiki, website, community Solution available 🥂 Definite solution has been done
Projects
None yet
Development

No branches or pull requests

2 participants