MPD

T
Techtronic
Mindaugas N.
  • 20 Spa '15

Turiu keleta problemu su naujausiu (dev) MPD, gal kas mokat jas spresti.

1 baisi problema

$ mpd --no-daemon --stderr --verbose
config_file: loading file /home/minde/.mpdconf
path: SetFSCharset: fs charset is:
libsamplerate: libsamplerate converter 'Fastest Sinc Interpolator'
db: reading DB
curl: version 7.38.0
curl: with OpenSSL/1.0.1j
state_file: Loading state file /dev/shm/mpd.state
client: [0] opened from 127.0.0.1:48916
client: [0] process command list
client: process command "add "http://radio.audiomastering.lt:8000/hq"" [^]
client: command returned 0
client: [0] process command list returned 0
client: [0] closed
client: [1] opened from 127.0.0.1:48918
client: [1] process command "play"
playlist: play 0:"http://radio.audiomastering.lt:8000/hq" [^]
client: [1] command returned 0
client: [1] process command list
client: process command "status"
client: command returned 0
client: process command "currentsong"
client: command returned 0
client: [1] process command list returned 0
client: [1] closed
curl: icy-metaint=16000
decoder_thread: probing plugin ffmpeg
ffmpeg: detected input format 'mp3' (MP2/3 (MPEG audio layer 2/3))
*** Error in `mpd': free(): invalid pointer: 0xb213f0bc ***

2 problema kuri nera kritiska, o daugiau nervinanti.

Kiekviena karta paleidus MPD pakeiciamas mpd.state failo teises i 0000 (---------).

T
Techtronic
Mindaugas N.
  • 23 Spa '15

Baisios problemos sprendimas pajudejo.
GDB jokios naudos neatnese, bet valgrind parase stai ka:

==22106== 1 errors in context 1 of 7:
==22106== Thread 4 decoder:
==22106== Invalid free() / delete / delete[] / realloc()
==22106==    at 0x40074BC: free (vg_replace_malloc.c:473)
==22106==    by 0x43468EF: ffio_ensure_seekback (aviobuf.c:829)
==22106==    by 0x43CB392: mp3_read_header (mp3dec.c:383)
==22106==    by 0x445A9EC: avformat_open_input (utils.c:473)
==22106==    by 0x8091CF6: FfmpegOpenInput (FfmpegDecoderPlugin.cxx:72)
==22106==    by 0x8091CF6: ffmpeg_decode(Decoder&, InputStream&) (FfmpegDecoderPlugin.cxx:605)
==22106==    by 0x80772F3: StreamDecode (DecoderPlugin.hxx:132)
==22106==    by 0x80772F3: decoder_stream_decode(DecoderPlugin const&, Decoder&, InputStream&) (DecoderThread.cxx:150)
==22106==    by 0x8077A78: __call<bool, const DecoderPlugin&, 0u, 1u, 2u, 3u, 4u> (functional:1264)
==22106==    by 0x8077A78: operator()<const DecoderPlugin&, bool> (functional:1323)
==22106==    by 0x8077A78: decoder_plugins_try<std::_Bind<bool (*(std::reference_wrapper<Decoder>, std::reference_wrapper<InputStream>, char const*, std::_Placeholder<1>, std::reference_wrapper<bool>))(Decoder&, InputStream&, char const*, const DecoderPlugin&, bool&)> > (DecoderList.hxx:60)
==22106==    by 0x8077A78: decoder_run_stream_locked (DecoderThread.cxx:247)
==22106==    by 0x8077A78: decoder_run_stream (DecoderThread.cxx:284)
==22106==    by 0x8077A78: decoder_run_song (DecoderThread.cxx:393)
==22106==    by 0x8077A78: decoder_run(DecoderControl&) (DecoderThread.cxx:449)
==22106==    by 0x8077C45: decoder_task(void*) (DecoderThread.cxx:472)
==22106==    by 0x80B144C: Thread::ThreadProc(void*) (Thread.cxx:108)
==22106==    by 0x44F861B4: start_thread (pthread_create.c:309)
==22106==    by 0x44E5982D: clone (clone.S:129)
==22106==  Address 0xaa630bc is on thread 4's stack
==22106==  in frame #4, created by ffmpeg_decode(Decoder&, InputStream&) (FfmpegDecoderPlugin.cxx:590)

aviobuf.c:829 yra https://github.com/FFmpeg/FFmpeg/blob/m ... buf.c#L829

B
  • 24 Spa '15

2 problema - kažkas panašaus pas mane nutiko, ir problema buvo tame kad MPD startavo ar tai su 'root' teisėmis, ar tai kaip 'mpd', o aš budamas user'is net 'mpd' grupei nepriklausiau
viskas susitvarkė kai mpd.config pakeičiau user "mpd" į savo 'username'

# This setting specifies the user that MPD will run as. MPD should never run as
# root and you may use this setting to make MPD change its user ID after
# initialization. This setting is disabled by default and MPD is run as the
# current user.
#
user                "mpd"
#
# This setting specifies the group that MPD will run as. If not specified
# primary group of user specified with "user" setting will be used (if set).
# This is useful if MPD needs to be a member of group such as "audio" to
# have permission to use sound card.
#
group                          "mpd"

ps: bet ko gero užtektų ir 'sudo usermod -a -G mpd YourUserName'

T
Techtronic
Mindaugas N.
  • 24 Spa '15

Labas @bark, pas mane tiek MPD tiek ffmpeg yra "rankomis" surinkti, as esu parases package manageri (kaip dpkg, rpm bet daugiau ideja BSD portu) kuris atsiuncia ir sukompiliuoja i ~/.bin/root, tai visas programas leidziu po user teisemis, ir jeigu jau reikia spec teisiu tai galbeja extended attributes, pvz bind porta kad galetum:

setcap 'cap_net_bind_service=+ep' ~/.bin/mpd

Useris/grupe config faile atrodo tvarkingai

$ id   
uid=1001(minde) gid=100(users) groups=100(users)
$ grep -E '^(user|group)' ~/.mpdconf 
user                "minde"
group                "users"

Sia problema nera sudetinga spresti (tikiuosi! ), man dabar svarbiausia paleisti ffmpeg decoder plugina.

Tiems kas turi problemu su ffmpeg tai yra paprastas work-around - ~/.mpdconf faile darasom:

decoder {
  plugin                   "ffmpeg"
  enabled                  "no"
}

Bugai reportuoti tiek mpd tiek ffmpeg, laukiam naujienu.

T
Techtronic
Mindaugas N.
  • 20 Lap '15

MPD-ffmpeg bug'as istaisytas, nors ir neskubejo autorius MPD pripazinti savo klaidos...

Del state failo teisiu nieko nekeiciau, nes MPD developeris commitino i 19 branch'a, o klaida 20. Bugas vis dar yra, bet nebeliko noro su tokiais developeriais prasideti.