ssc-ffmpeg.so plugin fails to load

Bug #378390 reported by Dave Thiede on 2009-05-19
28
This bug affects 3 people
Affects Status Importance Assigned to Milestone
mt-daapd (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: mt-daapd

Description: Ubuntu 9.04
mt-daapd:
  Installed: 0.9~r1696.dfsg-9
2.6.28-11-generic #42-Ubuntu SMP Fri Apr 17 01:58:03 UTC 2009 x86_64 GNU/Linux
upgrading to jaunty from intrepid caused the ffmpeg plug into break. Performing the final update/upgrade prior to the distribution upgrade shows the following snippit in the mt-daapd log:

2009-05-16 10:07:09 (98bfbfcc): Firefly Version svn-1696: Starting with debuglevel 2
2009-05-16 10:07:09 (98bfbfcc): Error loading plugin /usr/lib/mt-daapd/plugins/ssc-script.so: plugin declined to load
2009-05-16 10:07:09 (98bfbfcc): Plugin loaded: ssc-ffmpeg/svn-1696
2009-05-16 10:07:09 (98bfbfcc): Plugin loaded: rsp/svn-1696
2009-05-16 10:07:09 (98bfbfcc): Plugin loaded: daap/svn-1696
2009-05-16 10:07:09 (98bfbfcc): Starting rendezvous daemon
2009-05-16 10:07:09 (98bfbfcc): Client running

after the dist upgrade to 9.04 I got the following:
2009-05-16 18:14:48 (ee71a56f): Firefly Version svn-1696: Starting with debuglevel 2
2009-05-16 18:14:48 (ee71a56f): Error loading plugin /usr/lib/mt-daapd/plugins/ssc-script.so: plugin declined to load
2009-05-16 18:14:48 (ee71a56f): Error loading plugin /usr/lib/mt-daapd/plugins/ssc-ffmpeg.so: /usr/lib/mt-daapd/plugins/ssc-ffmpeg.so: undefined symbol: avcodec_decode_audio
2009-05-16 18:14:48 (ee71a56f): Plugin loaded: rsp/svn-1696
2009-05-16 18:14:48 (ee71a56f): Plugin loaded: daap/svn-1696
2009-05-16 18:14:48 (ee71a56f): Starting signal handler
2009-05-16 18:14:48 (ee71a56f): Starting rendezvous daemon
2009-05-16 18:14:48 (ee71a56f): Client running

It would appear that either the plugin interface or the underlying ffmpeg libraries have changed. Loading this plugin seems to be required for streaming ogg and mpeg files to itunes and tivo respectively as both services are now broken.

CVE References

scnaifeh (scnaifeh) wrote :

I'm seeing the same problem on a clean install of Intrepid with mt-daapd version 0.9~r1696.dfsg-2

My mt-daapd log looks the same as Dave's:

2009-05-28 08:53:56 (faf335ab): Firefly Version svn-1696: Starting with debuglevel 2
2009-05-28 08:53:56 (faf335ab): Error loading plugin /usr/lib/mt-daapd/plugins/ssc-script.so: plugin declined to load
2009-05-28 08:53:56 (faf335ab): Plugin loaded: daap/svn-1696
2009-05-28 08:53:56 (faf335ab): Plugin loaded: ssc-ffmpeg/svn-1696

2009-05-28 08:53:56 (faf335ab): Plugin loaded: rsp/svn-1696

I don't know if this is related, by mt-daapd is crashing when I try to play some (but not all) transcoded flac files.

Dave Thiede (davidrthiede) wrote :

@scnaifeh: the ssc-script.so failure was present also in intrepid. I don't really know what that affects. the ssc-ffmpeg plugin works though. with jaunty, the ssc-ffmpeg fails to load giving the avcodec_decode_audio as an undefined symbol. doing a bit of googling indicates that that call was being deprecated some time back. it apparently was dropped. I don't know enough about codec and ffmpeg to do the necessary recoding.

I also can confirm that the ssc-ffmpeg plugin load also fails in a 32bit virtualbox install so this problem is not confined to only 64bit as might be inferred in my initial post.

scnaifeh (scnaifeh) wrote :

@Dave Thiede: You are right. The ssc-script plugin failure just had to do with not having a transcoding script (which is unnecessary when you use the ffmpeg plugin.

I have upgraded to Jaunty in an effort to resolve my other issue, and I can now confirm the same problem you are seeing.

scnaifeh (scnaifeh) wrote :

I downloaded the mt-daapd source from the Jaunty repositories and I managed to get ssc-ffmpeg plugin to compile (it took some doing, as the configure script would not run without tweaks even from a clean download of the source, at least with the minimal options I was giving it, and the path for the avcodec and avformat headers was broken). I just changed the calls to avcodec_decode_audio to avcodec_decode_audio2, which seems to be the replacement function in the ffmpeg library. So now I can get the ssc-ffmpeg script to load, an my music shows up on the client as wav files instead of the native format, but I still can't get mt-daapd talking to my client.

When I try to play a song from the server, the mt-daapd log shows the mt-daapd claims to be streaming it, but on the client side (amarok in my case), the song pops up for a second, and then ends right away, with no music coming it, but no error reported. It looks as if it sees it as a zero length wav. This happens with both flac and ogg files (mp3's stream natively without problem). Without ssc-ffmpeg, ogg files were streaming natively, but I was getting the same symptom with native flac files as I am now with the transcoded files.

Cirion (cyborgar) wrote :

I've got the same problem (ssc-ffmpeg.so not loading) after upgrading to ubuntu 9.04. I have flac files only, and this was working just fine with iTunes on my mac, before I upgraded to ubuntu 9.04. The shared library pops up in iTunes, but nothing happens when trying to play a song. The songs seems to have negative length (-4:30, etc.) in iTunes. No error messages what so ever. Shows up as MPEG sound file (external) in the info pane.
I also use the Songbird music player, and it plays everything just fine. But it has native flac suport, so I guess it should.

scnaifeh (scnaifeh) wrote :

I finally got this working. I had to make some changes to the ssc-ffmpeg.c file, but now it works with Amarok or iTunes (8.1 on a Mac) as the client. I'm attaching my patched source file. It involved changing the call to avcodec_decode_audio to avcodec_decode_audio2 and initializing the buffer size parameter passed to those calls.

Cirion (cyborgar) wrote :

@scnaifeh: Nice! How do you manage to get ssc-ffmpeg.c.patched to compile to a binary? I'm a novice on this, and would appreciate some directions on the subject... :-)

scnaifeh (scnaifeh) wrote :

@Cirion: The simplest way is as follows (though it will rebuild and reinstall all of mt-daapd and not just the plugin):

1. open a terminal window

1.5 uninstall the current version of mt-daapd

sudo apt-get remove mt-daapd

This should leave your songs database and /etc/mt-daapd.conf intact.

2. cd to an appropriate working directory (e.g. ~/source) - if you don't already have one you'll need to create it.

3. run (don't need to be root for this one)

apt-get source mt-daapd

4. run

sudo apt-get build-dep mt-daapd

5. cd into mt-daapd-0.9~r1696.dfsg (created by the apt-get source command in step 3 in the current directory)

6. copy the ssc-ffmpeg.c.patched attached above from whereever you downloaded it to ./src/plugins/ssc-ffmpeg.c (if it asks for confirmation to overwrite the existing file, say yes), e.g.:

cp /path/to/ssc-ffmpeg.c.patched ./src/plugins/ssc-ffmpeg.c

7. run

dpkg-buildpackage -rfakeroot -uc -b

8. cd back to the parent of the mt-daapd build directory:

cd ..

9. run

sudo dpkg -i mt-daapd_0.9~r1696.dfsg-9_amd64.deb

(this is if you are running 64 bit ubuntu -- if you are running a 32 bit os, subsitute "i386" for the "amd64" in the above filename). When it asks if you want to overwrite/keep/merge your /etc/mt-daapd.conf file, hit keep (N or O).

Take a look at /var/log/mt-daapd to confirm that the ssc-ffmpeg plugin successfully loaded. You should now be good to go.

Cirion (cyborgar) wrote :

@scnaifeh: Great stuff this! Went through your little howto, and the ssc-ffmpeg plugin is up and running again!

Just a few comments:

> When it asks if you want to overwrite/keep/merge your /etc/mt-daapd.conf file, hit keep (N or O).
Did not get this question.

> Take a look at /var/log/mt-daapd to confirm that the ssc-ffmpeg plugin successfully loaded.
In my case there is no mt-daapd log file. mt-daapd outputs directly to the syslog.
An other thing was that the mt-daapd service did not start at once. The plugin loaded successfully, but mt-daapd did not start due to an error:
"kernel: [332409.909542] mt-daapd[9712]: segfault at 4 ip 00007f526222bb00 sp 00007fff6d20c468 error 6 in libdbus-1.so.3.4.0[7f5262208000+3c000]".
#$@#4%^^, I thought, but after a reboot mt-daapd started up and everything has been just dandy after that!

Thx!

Dave Thiede (davidrthiede) wrote :

@scnaifeh: also have to say it is working for me. great reference for package build and manipulation. I still find the debian package system hard to deal with. rpm spec files are much clearer to me. where I have it working is a 9.04-64bit virtual install. dropped some ogg files in the appropriate place and it is working fine to my kids mac. somehow on my native install of the same config, I have package breakage and haven't got it going yet. the deb built on the virtual box does install though. aptitude and apt-get seem to have a difference of opinion on dependencies and broken packages.

The fixed package just got replaced on my main system by the update manager thinking that mt-daap needed an upgrade. time to work on package versioning.

@cirion. I didn't see the seg fault

nfroese (norbert-froesebc) wrote :

thank you scnaifeh. After following your intructions ssc-ffmpeg now loads for me (running Ubuntu 9.04):

Jun 12 23:24:14 nieko mt-daapd[4492]: Firefly Version svn-1696: Starting with debuglevel 2
Jun 12 23:24:14 nieko mt-daapd[4492]: Error loading plugin /usr/lib/mt-daapd/plugins/ssc-script.so: plugin declined to load
Jun 12 23:24:14 nieko mt-daapd[4492]: Plugin loaded: rsp/svn-1696
Jun 12 23:24:14 nieko mt-daapd[4492]: Plugin loaded: daap/svn-1696
Jun 12 23:24:14 nieko mt-daapd[4492]: Plugin loaded: ssc-ffmpeg/svn-1696
Jun 12 23:24:14 nieko mt-daapd[4492]: Starting signal handler
Jun 12 23:24:14 nieko mt-daapd[4493]: Starting rendezvous daemon
Jun 12 23:24:14 nieko mt-daapd[4493]: Client running
Jun 12 23:24:14 nieko mt-daapd[4493]: Initializing database
Jun 12 23:24:14 nieko mt-daapd[4493]: Starting web server from /usr/share/mt-daapd/admin-root on port 3689
Jun 12 23:24:14 nieko mt-daapd[4493]: Registering rendezvous names
Jun 12 23:24:14 nieko mt-daapd[4493]: Serving 418 songs. Startup complete in 0 seconds

however...when I invoke the ffmpeg plugin (by playing an ogg file in Banshee) mt-daapd crashes with the following error:

Jun 12 23:27:23 nieko kernel: [ 782.660991] mt-daapd[4500] general protection ip:b7abcce5 sp:b5fe1494 error:0 in libavcodec.so.52.20.0[b76d9000+4be000]

I am unsure how to proceed. A Google search with the error message was not helpful.

Nick Bell (nick-bell) wrote :

@scnaifeh: heartfelt thanks. Your fix has enabled me to stream FLAC from Ubuntu 9.04 to itunes 8.2.1 on a macbook.

cinchel (cinchel) wrote :

thank you for the patch and the compile info. streaming FLAC files to my itunes from firefly now works perfectly, but there was a bit of a problem for me at step "4. run

sudo apt-get build-dep mt-daapd"

I got a build depency error but with very little info. a bit of googling showed me that if i ran:

 sudo apt-get build-dep mt-daapd -o Debug::pkgProblemResolver=true

I saw what packages were missing and needed to run the following

sudo apt-get install libavcodec-dev libavutil-dev libavutil49 libavformat52

then i could complete STEP 4 with no problems.

I wanted to add this incase others ran into the same problems.

thank you for all your work. I have been googling all weekend to get firefly to transcode FLAC to itunes again after a jaunty upgrade.

sakana kun (albertgimeno) wrote :

Hi, scnaifeh.
I'm encountering some difficulties on step 7
am I missing some dependencies.

Please could you help me?
Thanks

Error

tmp/sources/mt-daapd-0.9~r1696.dfsg$ dpkg-buildpackage -rfakeroot -uc -b
dpkg-buildpackage: set CFLAGS to default value: -g -O2
dpkg-buildpackage: set CPPFLAGS to default value:
dpkg-buildpackage: set LDFLAGS to default value: -Wl,-Bsymbolic-functions
dpkg-buildpackage: set FFLAGS to default value: -g -O2
dpkg-buildpackage: set CXXFLAGS to default value: -g -O2
dpkg-buildpackage: source package mt-daapd
dpkg-buildpackage: source version 0.9~r1696.dfsg-13build1
dpkg-buildpackage: source changed by Stefan Potyra <email address hidden>
dpkg-buildpackage: host architecture i386
 fakeroot debian/rules clean
dh_testdir
dh_testroot
rm -f autotools-stamp build-stamp
# Cleanup leftover generated files
rm -f contrib/init.d/mt-daapd-fedora contrib/init.d/mt-daapd-suse contrib/init.d/mt-daapd-gentoo contrib/init.d/mtdaapd-bsd
rm -f contrib/mt-daapd.conf
# Add here commands to clean up after the build process.
[ ! -f Makefile ] || /usr/bin/make distclean
rm -f config.sub config.guess
dh_clean
dpatch deapply-all
20_build_system_update not applied to ./ .
16_enable_mpc_transcode_ffmpeg not applied to ./ .
15_compiler_warnings not applied to ./ .
14_ffmpeg_API not applied to ./ .
13_avahi_fix_and_handle_restart not applied to ./ .
12_no_applet not applied to ./ .
11_no_apache_2.0 not applied to ./ .
10_allow_out_of_webroot_dirs not applied to ./ .
09_ws_copyfile_io_error_fix not applied to ./ .
08_aac_scan_fix not applied to ./ .
07_xml_scan_fix not applied to ./ .
06_io_open_options_parsing not applied to ./ .
05_help_typos not applied to ./ .
04_taglib_api_calls not applied to ./ .
03_ws_addarg_retval_fix not applied to ./ .
02_CVE-2008-1771 not applied to ./ .
01_configuration not applied to ./ .
rm -rf patch-stamp patch-stampT debian/patched
 debian/rules build
test -d debian/patched || install -d debian/patched
dpatch apply-all
applying patch 01_configuration to ./ ... ok.
applying patch 02_CVE-2008-1771 to ./ ... ok.
applying patch 03_ws_addarg_retval_fix to ./ ... ok.
applying patch 04_taglib_api_calls to ./ ... ok.
applying patch 05_help_typos to ./ ... ok.
applying patch 06_io_open_options_parsing to ./ ... ok.
applying patch 07_xml_scan_fix to ./ ... ok.
applying patch 08_aac_scan_fix to ./ ... ok.
applying patch 09_ws_copyfile_io_error_fix to ./ ... ok.
applying patch 10_allow_out_of_webroot_dirs to ./ ... ok.
applying patch 11_no_apache_2.0 to ./ ... ok.
applying patch 12_no_applet to ./ ... ok.
applying patch 13_avahi_fix_and_handle_restart to ./ ... ok.
applying patch 14_ffmpeg_API to ./ ... failed.
make: *** [patch-stamp] Error 1
dpkg-buildpackage: error: debian/rules build gave error exit status 2

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers