{"action":"created","issue":{"url":"https://api.github.com/repos/MusicPlayerDaemon/MPD/issues/260","repository_url":"https://api.github.com/repos/MusicPlayerDaemon/MPD","labels_url":"https://api.github.com/repos/MusicPlayerDaemon/MPD/issues/260/labels{/name}","comments_url":"https://api.github.com/repos/MusicPlayerDaemon/MPD/issues/260/comments","events_url":"https://api.github.com/repos/MusicPlayerDaemon/MPD/issues/260/events","html_url":"https://github.com/MusicPlayerDaemon/MPD/issues/260","id":311224676,"number":260,"title":"Silence gap when playback begins","user":{"login":"joerg-krause","id":6870896,"avatar_url":"https://avatars2.githubusercontent.com/u/6870896?v=4","gravatar_id":"","url":"https://api.github.com/users/joerg-krause","html_url":"https://github.com/joerg-krause","followers_url":"https://api.github.com/users/joerg-krause/followers","following_url":"https://api.github.com/users/joerg-krause/following{/other_user}","gists_url":"https://api.github.com/users/joerg-krause/gists{/gist_id}","starred_url":"https://api.github.com/users/joerg-krause/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joerg-krause/subscriptions","organizations_url":"https://api.github.com/users/joerg-krause/orgs","repos_url":"https://api.github.com/users/joerg-krause/repos","events_url":"https://api.github.com/users/joerg-krause/events{/privacy}","received_events_url":"https://api.github.com/users/joerg-krause/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2018-04-04T13:14:42Z","updated_at":"2018-04-11T15:15:13Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Using latest MPD git master branch on an embedded Linux system (CPU is i.MX28) with ALSA output plugin. When playback begins an audible silence gap occurs as shown in the picture from an oscillator, where channel 1 is a GPIO toggled when ALSA audio device is opened/closed and channel 2 the audio data line (I2S).\r\n\r\nUsing git bisect led to commit b1c7649edb80285c113f4710dd4c19d8f7c1aef7 being the one where audio playback behavior changed. Before that commit, audio plays fine without any gap.\r\n\r\nThe default ALSA audio output device is a softvol PCM plugin. However, the behavior is the same when using plughw:1,0 instead.\r\n\r\nEDIT: This is the ALSA specific output from the debug log:\r\n\r\n```\r\nApr 04 13:42 : alsa_output: opened softvol type=SOFTVOL\r\nApr 04 13:42 : alsa_output: buffer: size=4..8192 time=90..185760\r\nApr 04 13:42 : alsa_output: period: size=4..1024 time=90..23220\r\nApr 04 13:42 : alsa_output: default period_time = buffer_time/4 = 185759/4 = 46439\r\nApr 04 13:42 : alsa_output: format=S24_LE (Signed 24 bit Little Endian)\r\nApr 04 13:42 : alsa_output: buffer_size=8192 period_size=1024\r\nApr 04 13:42 : output: opened \"ALSA\" (alsa) audio_format=44100:24:2\r\n```\r\n\r\n![img_0280](https://user-images.githubusercontent.com/6870896/38308660-215944c0-3818-11e8-9514-9dd0d9523476.JPG)\r\n\r\nYou're welcome to request for more information.\r\n"},"comment":{"url":"https://api.github.com/repos/MusicPlayerDaemon/MPD/issues/comments/380489361","html_url":"https://github.com/MusicPlayerDaemon/MPD/issues/260#issuecomment-380489361","issue_url":"https://api.github.com/repos/MusicPlayerDaemon/MPD/issues/260","id":380489361,"user":{"login":"joerg-krause","id":6870896,"avatar_url":"https://avatars2.githubusercontent.com/u/6870896?v=4","gravatar_id":"","url":"https://api.github.com/users/joerg-krause","html_url":"https://github.com/joerg-krause","followers_url":"https://api.github.com/users/joerg-krause/followers","following_url":"https://api.github.com/users/joerg-krause/following{/other_user}","gists_url":"https://api.github.com/users/joerg-krause/gists{/gist_id}","starred_url":"https://api.github.com/users/joerg-krause/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joerg-krause/subscriptions","organizations_url":"https://api.github.com/users/joerg-krause/orgs","repos_url":"https://api.github.com/users/joerg-krause/repos","events_url":"https://api.github.com/users/joerg-krause/events{/privacy}","received_events_url":"https://api.github.com/users/joerg-krause/received_events","type":"User","site_admin":false},"created_at":"2018-04-11T15:15:13Z","updated_at":"2018-04-11T15:15:13Z","author_association":"CONTRIBUTOR","body":"About the real-time scheduling: I followed the instructions from the manual to check that real-time scheduling is supported and enabled.\r\n\r\n```\r\n# ps H -q `pidof -s mpd` -o 'pid,tid,cls,rtprio,comm'\r\n  PID   TID CLS RTPRIO COMMAND\r\n  780   780  TS      - mpd\r\n  780   783  TS      - io\r\n  780   784  FF     50 rtio\r\n  780   785  TS      - player\r\n  780   786  TS      - decoder:mad\r\n  780   787  FF     50 output:ALSA\r\n```\r\n\r\nChecking for any SCHED kernel settings:\r\n```\r\n# zcat /proc/config.gz | grep SCHED\r\nCONFIG_GENERIC_SCHED_CLOCK=y\r\n# CONFIG_SCHED_AUTOGROUP is not set\r\nCONFIG_IOSCHED_NOOP=y\r\n# CONFIG_IOSCHED_DEADLINE is not set\r\nCONFIG_IOSCHED_CFQ=y\r\nCONFIG_DEFAULT_IOSCHED=\"cfq\"\r\n# CONFIG_MQ_IOSCHED_DEADLINE is not set\r\n# CONFIG_MQ_IOSCHED_KYBER is not set\r\n# CONFIG_IOSCHED_BFQ is not set\r\nCONFIG_SCHED_HRTICK=y\r\n# CONFIG_NET_SCHED is not set\r\nCONFIG_USB_EHCI_TT_NEWSCHED=y\r\n# CONFIG_SCHED_INFO is not set\r\n```\r\n\r\nRunning mpd:\r\n```\r\n# prlimit --rtprio=50 --rttime=unlimited;mpd --no-daemon --stderr /var/run/mpd/mpd.conf\r\nopus: libopus 1.2.1-fixed\r\nsndfile: libsndfile-1.0.28\r\nsimple_db: reading DB\r\nexception: Input plugin 'tidal' is unavailable: No Tidal application token configured\r\nexception: Input plugin 'qobuz' is unavailable: No Qobuz app_id configured\r\ncurl: version 7.59.0\r\ncurl: with OpenSSL/1.0.2o\r\nstate_file: Loading state file /var/lib/mpd/state\r\nplaylist: queue song 3:\"http://rtlberlin.hoerradar.de/spreeradio-live-mp3-128?sABC=5nnsr89s%230%233pn4285s298r2028ops4n4912742ns88%23xbagnxg&amsparams=playerid:kontakt;skey:1521477791\"\r\ncurl: icy-metaint=16000\r\ndecoder_thread: probing plugin mad\r\ndecoder: audio_format=44100:24:2, seekable=false\r\nalsa_output: opened hw:1,0 type=HW\r\nalsa_output: buffer: size=4..8192 time=90..185760\r\nalsa_output: period: size=4..1024 time=90..23220\r\nalsa_output: default period_time = buffer_time/4 = 185759/4 = 46439\r\nalsa_output: format=S24_LE (Signed 24 bit Little Endian)\r\nalsa_output: buffer_size=8192 period_size=1024\r\noutput: opened \"ALSA\" (alsa) audio_format=44100:24:2\r\nclient: [0] opened from 127.0.0.1:56432\r\nclient: [0] process command \"next\"\r\nplaylist: play 3:\"http://rtlberlin.hoerradar.de/spreeradio-live-mp3-128?sABC=5nnsr89s%230%233pn4285s298r2028ops4n4912742ns88%23xbagnxg&amsparams=playerid:kontakt;skey:1521477791\"\r\ncurl: icy-metaint=16000\r\ndecoder_thread: probing plugin mad\r\ndecoder: audio_format=44100:24:2, seekable=false\r\nclient: [0] command returned 0\r\nplaylist: queue song 0:\"http://inforadio.de/livemp3\"\r\nstate_file: Saving state file /var/lib/mpd/state\r\nclient: [0] process command list\r\nclient: process command \"status\"\r\nclient: command returned 0\r\nclient: process command \"currentsong\"\r\nclient: command returned 0\r\nclient: [0] process command list returned 0\r\nclient: [0] closed\r\nicy_metadata: unknown icy-tag: 'StreamUrl'\r\nstate_file: Saving state file /var/lib/mpd/state\r\nstate_file: Saving state file /var/lib/mpd/state\r\nclient: [1] opened from 127.0.0.1:56436\r\nclient: [1] process command \"next\"\r\nplaylist: play 0:\"http://inforadio.de/livemp3\"\r\ncurl: icy-metaint=16000\r\ndecoder_thread: probing plugin mad\r\ndecoder: audio_format=44100:24:2, seekable=false\r\nclient: [1] command returned 0\r\nplaylist: queue song 1:\"http://radioeins.de/stream\"\r\nstate_file: Saving state file /var/lib/mpd/state\r\nclient: [1] process command list\r\nclient: process command \"status\"\r\nclient: command returned 0\r\nclient: process command \"currentsong\"\r\nclient: command returned 0\r\nclient: [1] process command list returned 0\r\nclient: [1] closed\r\nclient: [2] opened from 127.0.0.1:56444\r\nclient: [2] process command \"next\"\r\nplaylist: play 1:\"http://radioeins.de/stream\"\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\ncurl: icy-metaint=16000\r\ndecoder_thread: probing plugin mad\r\ndecoder: audio_format=44100:24:2, seekable=false\r\nclient: [2] command returned 0\r\nplaylist: queue song 2:\"http://rbb-radioberlin-live.cast.addradio.de/rbb/radioberlin/live/mp3/128/stream.mp3\"\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\nclient: [2] process command list\r\nclient: process command \"status\"\r\nclient: command returned 0\r\nclient: process command \"currentsong\"\r\nclient: command returned 0\r\nclient: [2] process command list returned 0\r\nclient: [2] closed\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\nalsa_output: Underrun on ALSA device \"hw:1,0\"\r\n[...]\r\n```\r\n\r\nThe underrun does not go away until stopping playback."}}
{"actor":{"display_login":"joerg-krause"}}