DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#26 2008-10-24 15:54:14

boilerjt
Member
From: Minnesota, USA
Registered: 2008-09-15
Posts: 122

Re: [REL] MediaTomb 0.12.0 SVN 1899

If there is anyone else trying out these MediaTomb builds, please let me know how it is working.  Jin (the MediaTomb developer) is interested in what I am doing and hopes to figure out how to compile a static build for all Marvell Orion based hardware.

Thanks smile

Offline

 

#27 2008-10-25 14:40:19

Rival
Member
From: Budapest
Registered: 2008-03-13
Posts: 53
Website

Re: [REL] MediaTomb 0.12.0 SVN 1899

I stuck with aac stream transcoding. I tried to use streamripper and vlc.

With the first one I can only rip the stream and make a file with .aac extension to the disk. I know that this .aac file could be transcoded with faad but I don't know how to combine these two programs and use with mediatomb.

With VLC I stuck at the beginning. I've installed it as optware (ipkg install vlc), and after all the command 'setuidgid user vlc' (vlc can't run with root privileges) says:

VLC media player 0.9.4 Grishenko
Illegal instruction


The easy way would be VLC because it could transcode the stream automatically (source):

- Make a script named vlcaudio

#!/bin/sh

INPUT="$1"
OUTPUT="$2"
AUDIO_CODEC="s16l"
AUDIO_BITRATE="192"
AUDIO_SAMPLERATE="44100"
AUDIO_CHANNELS="2"
FORMAT="wav"

exec /usr/bin/vlc -I dummy "${INPUT}" --sout "#transcode{acodec=${AUDIO_CODEC},\
ab=${AUDIO_BITRATE},channels=${AUDIO_CHANNELS}}:\
standard{access=file,mux=${FORMAT},dst=${OUTPUT}}" vlc:quit >/dev/null 2>&1


- Put into config.xml transcoding section:

<transcode mimetype="audio/x-aac" using="vlcwav"/>
<transcode mimetype="audio/mp4" using="vlcwav"/>


...

<profile name="vlcwav" enabled="yes" type="external">
    <use-chunked-encoding>no</use-chunked-encoding>
        <mimetype>audio/wav</mimetype>
        <accept-url>yes</accept-url>
        <first-resource>yes</first-resource>
        <agent command="vlcaudio" arguments="%in %out"/>
        <buffer size="300000" chunk-size="10000" fill-size="32000"/>
</profile>



...everything would be nice, but something is wrong with the binary. sad

Last edited by Rival (2008-10-25 15:14:28)

Offline

 

#28 2008-10-25 15:14:49

Rival
Member
From: Budapest
Registered: 2008-03-13
Posts: 53
Website

Re: [REL] MediaTomb 0.12.0 SVN 1899

Additional information to mediatomb usage: when you use it to play or transcode streams, you probably realised when a stream disconnects, mediatomb tries to play the next item in the container. It means if you have a container named "Online stations" and it contains several "External Link (URL)" items, in case of disconnection the next station started from the list. I shortcut this problem:

Make a container for each online station with only one URL item (the station itself). Set the player to repeat songs in case of end of the playlist. This way the disconnected stream reconnects automatically.

Offline

 

#29 2008-10-25 17:20:33

boilerjt
Member
From: Minnesota, USA
Registered: 2008-09-15
Posts: 122

Re: [REL] MediaTomb 0.12.0 SVN 1899

I also have MediaTomb running in Ubuntu Hardy linux and I can play AAC streams sending the URL as an input to VLC using exactly the same VLC script you are using (I wrote that script for transcoding to my device smile )  The problem is that VLC uses faad2 (compiled into it) and this faad2 is floating point.  Since the DNS-323 does not have a floating point unit (FPU), it must emulate it and it is much too slow to transcode.  The faad2 I am using in my DNS-323 was compiled as fixed point (integer math) and this runs really well.

The issue with apps like VLC, ffmpeg, and mplayer is that there is so much floating point code in them that they become practically useless running on a NAS.

There is really no need for streamripper because MediaTomb can do this using curl, which I have compiled into the MediaTomb binary.  It basically rips the audio from an HTTP URL and streams it in a fifo to the transcoding application.  To use this, set <accept-url>no</accept-url> in the transcoding profile.  I have tried this and faad does not want to play it from the fifo.  It also won't accept a URL as an input.


Rival wrote:

I stuck with aac stream transcoding. I tried to use streamripper and vlc.

With the first one I can only rip the stream and make a file with .aac extension to the disk. I know that this .aac file could be transcoded with faad but I don't know how to combine these two programs and use with mediatomb.

With VLC I stuck at the beginning. I've installed it as optware (ipkg install vlc), and after all the command 'setuidgid user vlc' (vlc can't run with root privileges) says:

VLC media player 0.9.4 Grishenko
Illegal instruction


The easy way would be VLC because it could transcode the stream automatically (source):

- Make a script named vlcaudio

#!/bin/sh

INPUT="$1"
OUTPUT="$2"
AUDIO_CODEC="s16l"
AUDIO_BITRATE="192"
AUDIO_SAMPLERATE="44100"
AUDIO_CHANNELS="2"
FORMAT="wav"

exec /usr/bin/vlc -I dummy "${INPUT}" --sout "#transcode{acodec=${AUDIO_CODEC},\
ab=${AUDIO_BITRATE},channels=${AUDIO_CHANNELS}}:\
standard{access=file,mux=${FORMAT},dst=${OUTPUT}}" vlc:quit >/dev/null 2>&1


- Put into config.xml transcoding section:

<transcode mimetype="audio/x-aac" using="vlcwav"/>
<transcode mimetype="audio/mp4" using="vlcwav"/>


...

<profile name="vlcwav" enabled="yes" type="external">
    <use-chunked-encoding>no</use-chunked-encoding>
        <mimetype>audio/wav</mimetype>
        <accept-url>yes</accept-url>
        <first-resource>yes</first-resource>
        <agent command="vlcaudio" arguments="%in %out"/>
        <buffer size="300000" chunk-size="10000" fill-size="32000"/>
</profile>



...everything would be nice, but something is wrong with the binary. sad

Offline

 

#30 2008-10-25 17:47:27

Rival
Member
From: Budapest
Registered: 2008-03-13
Posts: 53
Website

Re: [REL] MediaTomb 0.12.0 SVN 1899

But it's available from DNS-323 optware packages so I think it should work on a dns-323. If it works on a Asus router (see here) it should do the same on a dns-323... smile

Mod.: When I try to run curl I also get the message 'Illegal instruction'!

/mnt/HD_a2/mediatomb12 # curl http://80.86.106.110:8002
ICY 200 OK
icy-notice1:<BR>This stream requires <a href="http://www.winamp.com/">Winamp</a><BR>
icy-notice2:SHOUTcast Distributed Network Audio Server/Linux v1.9.8<BR>
Illegal instruction


Mod2: Sorry I missed the info that curl is compiled into your mediatomb. Just a small, dumb question: what your curl compilation tells servers as user-agent? Winamp? If not, the answer from an aac stream server is that stream requires Winamp, and faad can't do anything with this content... smile

Mod3.: When I type the URL of an aac stream to browser (ex. http://80.86.106.110:8002) it brings up a status display (ex. Shoutcast). So I think the user-agent string of the browser instructs shoutcast not to stream but show the status page... I don't know, I'm just thinking... smile

Last edited by Rival (2008-10-25 18:22:23)

Offline

 

#31 2008-10-25 19:58:19

boilerjt
Member
From: Minnesota, USA
Registered: 2008-09-15
Posts: 122

Re: [REL] MediaTomb 0.12.0 SVN 1899

I've found a few of the optware packages that do not work for the DNS-323.  MediaTomb uses the curl library and I don't know about the details.  It's explained in the MediaTomb documentation.  I'm using it right now to play mp3 streams (mostly Shoutcast).  MediaTomb uses curl to rip the stream, then redirects the mp3 stream to a fifo, then I use madplay to transcode it to wav since my client cannot play mp3 directly.

Rival wrote:

But it's available from DNS-323 optware packages so I think it should work on a dns-323. If it works on a Asus router (see here) it should do the same on a dns-323... smile

Mod.: When I try to run curl I also get the message 'Illegal instruction'!

/mnt/HD_a2/mediatomb12 # curl http://80.86.106.110:8002
ICY 200 OK
icy-notice1:<BR>This stream requires <a href="http://www.winamp.com/">Winamp</a><BR>
icy-notice2:SHOUTcast Distributed Network Audio Server/Linux v1.9.8<BR>
Illegal instruction


Mod2: Sorry I missed the info that curl is compiled into your mediatomb. Just a small, dumb question: what your curl compilation tells servers as user-agent? Winamp? If not, the answer from an aac stream server is that stream requires Winamp, and faad can't do anything with this content... smile

Mod3.: When I type the URL of an aac stream to browser (ex. http://80.86.106.110:8002) it brings up a status display (ex. Shoutcast). So I think the user-agent string of the browser instructs shoutcast not to stream but show the status page... I don't know, I'm just thinking... smile

Offline

 

#32 2008-10-25 20:25:30

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: [REL] MediaTomb 0.12.0 SVN 1899

Rival wrote:

Mod.: When I try to run curl I also get the message 'Illegal instruction'!

KyleK has made a curl package, too. It's around for quite some time, so I assume it works.
http://dns323.kood.org/forum/viewtopic. … 91&p=1

Offline

 

#33 2008-10-26 02:13:00

Rival
Member
From: Budapest
Registered: 2008-03-13
Posts: 53
Website

Re: [REL] MediaTomb 0.12.0 SVN 1899

I'm on the road to the aac transcoding heaven... but I think the wrong way... smile

I try to figure out why mediatomb doesn't work with aac streams. My curl problem (Illegal instruction) caused by library version mismatch. In /opt/bin curl version did not match with the previously installed one in /bin. After all I made a test.

I made a fifo:

mkfifo test.aac

Then put some data into it:

curl http://80.86.106.110:8002 -A Winamp -o test.aac

And started faad in an other terminal:

faad -o test.wav test.aac

Faad output were:

test.aac file info:
RAW

Error: Channel coupling not yet implemented


I give up ... and wait for a new and working faad or vlc opt... grrrrrr... big_smile

Last edited by Rival (2008-10-26 02:22:27)

Offline

 

#34 2008-10-26 02:45:08

boilerjt
Member
From: Minnesota, USA
Registered: 2008-09-15
Posts: 122

Re: [REL] MediaTomb 0.12.0 SVN 1899

I tried the same thing except I saved test.aac to a regular file and got the same results with faad.  Also, in my testing, I played my test.aac that I got from curl in VLC (on my PC) and it played perfectly.  It reported that it was AAC with SBR (HE-AAC) and this is supported by faad (VLC uses faad libs).   This shows me that curl has no issue with aac streams.  My conclusion is that the command line faad will not play online streams.  Maybe someone that knows that knows more than you or I can modify faad to work with aac streams by looking at the VLC source and see how they do it.  Ideally, faad should accept a URL as an input and we wouldn't need to use curl.

Rival wrote:

I'm on the road to the aac transcoding heaven... but I think the wrong way... smile

I try to figure out why mediatomb doesn't work with aac streams. My curl problem (Illegal instruction) caused by library version mismatch. In /opt/bin curl version did not match with the previously installed one in /bin. After all I made a test.

I made a fifo:

mkfifo test.aac

Then put some data into it:

curl http://80.86.106.110:8002 -A Winamp -o test.aac

And started faad in an other terminal:

faad -o test.wav test.aac

Faad output were:

test.aac file info:
RAW

Error: Channel coupling not yet implemented


I give up ... and wait for a new and working faad or vlc opt... grrrrrr... big_smile

Offline

 

#35 2008-10-26 12:30:38

Rival
Member
From: Budapest
Registered: 2008-03-13
Posts: 53
Website

Re: [REL] MediaTomb 0.12.0 SVN 1899

And what about the User-Agent string that curl sends to server?
Did you use the command line that I did (curl with -A parameter)?

For exaple you can get an ogg stream without a problem from URL http://89.37.193.62:8000/highband.ogg with no -A parameter but not from the http://80.86.106.110:8002 aac stream. Because ShoutCast server may recognise curl as a browser or something and shows an info line that stream requires Winamp... so my question is what User-Agent string is used when your mediatomb calls curl to get the stream?

I could play my test.aac with Winamp too. But I could make this test.aac file with curl (...) -A Winamp parameter only.

You're right, the ideal thing would be an URL-capable faad... and we wouldn't need curl...
I think I can't listen to aac streams on my MusicPal in the near future... smile

First solution: aac capable firmware for MusicPal
Second solution: URL capable faad for DNS-323
Third solution: runnable vlc for DNS-323
Fourth solution: not to listen to aac streams... but most stations I need are aac only...
Fifth solution: having some walk, cooking something, drinking a beer and relax...

The last one is the best thing I can do now... thanks for your help, I'll be back... big_smile

Offline

 

#36 2008-10-26 12:55:17

boilerjt
Member
From: Minnesota, USA
Registered: 2008-09-15
Posts: 122

Re: [REL] MediaTomb 0.12.0 SVN 1899

Rival wrote:

And what about the User-Agent string that curl sends to server?
Did you use the command line that I did (curl with -A parameter)?

For exaple you can get an ogg stream without a problem from URL http://89.37.193.62:8000/highband.ogg with no -A parameter but not from the http://80.86.106.110:8002 aac stream. Because ShoutCast server may recognise curl as a browser or something and shows an info line that stream requires Winamp... so my question is what User-Agent string is used when your mediatomb calls curl to get the stream?

I could play my test.aac with Winamp too. But I could make this test.aac file with curl (...) -A Winamp parameter only.

You're right, the ideal thing would be an URL-capable faad... and we wouldn't need curl...
I think I can't listen to aac streams on my MusicPal in the near future... smile

First solution: aac capable firmware for MusicPal
Second solution: URL capable faad for DNS-323
Third solution: runnable vlc for DNS-323
Fourth solution: not to listen to aac streams... but most stations I need are aac only...
Fifth solution: having some walk, cooking something, drinking a beer and relax...

The last one is the best thing I can do now... thanks for your help, I'll be back... big_smile

It works for me without the -A parameter using the Curl that I built for the DNS-323:

/mnt/HD_a2/Test # curl -o test1.aac http://80.86.106.110:8002
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  356k    0  356k    0     0   8034      0 --:--:--  0:00:45 --:--:--  6155[1

I can then play test1.aac using VLC from my PC, but faad won't play it from the NAS or PC.
Perhaps someone will come up with a solution...

Offline

 

#37 2008-10-26 18:37:10

Rival
Member
From: Budapest
Registered: 2008-03-13
Posts: 53
Website

Re: [REL] MediaTomb 0.12.0 SVN 1899

boilerjt wrote:

It works for me without the -A parameter using the Curl that I built for the DNS-323...

Oops... it works for me too... roll

Offline

 

#38 2008-10-26 19:38:36

boilerjt
Member
From: Minnesota, USA
Registered: 2008-09-15
Posts: 122

Re: [REL] MediaTomb 0.12.0 SVN 1899

Just wanted to let you know I haven't forgotten about you smile  In the latest build, it can read mp4 audio tags (m4a) using the libmp4v2 library built into the mediatomb binary.  As for wma tags, I'm still working on it.  The wma patch for taglib 1.4 was made for x86 and I finally got it compiled for the DNS-323.  It can now read all wma tags, except for the track number and the tracks would be displayed in alphabetical order.  Another problem is that MediaTomb only looks for mp3, flac, and ogg tags using taglib, so the code would have to be hacked to retrieve the wma tags with taglib.  My Ubuntu build of MediaTomb actually reads wma tags and from the best I can tell, it uses ffmpeg to read these tags.   I'd rather not mess with trying to cross-compile ffmpeg...

Update: I've got the track number issue fixed.  Whoever wrote this Taglib patch missed something.  There are two methods of writing the track number into the tag data in a wma file and he only accounted for one of them.  Luckily, he used ffmpeg code and I was able to get it working.  I also wrote a crude hack in Mediatomb to test it reading wma tags with taglib and it seems to work OK.  I'm going to pass this info on to the MediaTomb developer and see if he will add the WMA support for taglib.

scarcow wrote:

Thanks, i could try it now. It works fine now, of course i had to tweak the config.xml a little. I could try the flac transcoding (this was the main reason i wanted to try your build), and it also works fine.
One little issue i found, is that wma and mp4 tags are not read. Is it possible to make taglib read those? I found one patch to taglib that makes it possible to read wma tags, but i am totally noob in compiling programs, so i can't even start to try to compile it.

Do you have time to look into this?

Anyway, thanks once more for this, it really makes me happy that i can play my flac now on the media player smile

-sc

Last edited by boilerjt (2008-10-26 23:38:39)

Offline

 

#39 2008-10-28 01:03:55

scarcow
Member
From: Hungary
Registered: 2008-10-10
Posts: 16

Re: [REL] MediaTomb 0.12.0 SVN 1899

Hi,

Great news, this means that all the music files i have will have properly read tags, which is good. Thanks for the update, your work is really appreciated. smile

Btw, a little feedback: i am now using the static build you did earlier and it works nicely, also as you mentioned m4a tags are read. For the wma, i have a crude workaround using the import.js, that MT reads the folder structure if it cannot read the tags - of course the real tags would be much better.

One thing i noticed, is that when i import my files into MT (something like 1500 songs), the memory usage goes quite high (66% - ok, i know that the DNS doesn't have too much memory, but anyway) and stays there. If i restart it, then the memory usage goes down to around 13%. Is this a normal behaviour?

-sc

Last edited by scarcow (2008-10-28 01:04:48)

Offline

 

#40 2008-10-28 03:08:00

boilerjt
Member
From: Minnesota, USA
Registered: 2008-09-15
Posts: 122

Re: [REL] MediaTomb 0.12.0 SVN 1899

scarcow wrote:

Hi,

Great news, this means that all the music files i have will have properly read tags, which is good. Thanks for the update, your work is really appreciated. smile

Btw, a little feedback: i am now using the static build you did earlier and it works nicely, also as you mentioned m4a tags are read. For the wma, i have a crude workaround using the import.js, that MT reads the folder structure if it cannot read the tags - of course the real tags would be much better.

One thing i noticed, is that when i import my files into MT (something like 1500 songs), the memory usage goes quite high (66% - ok, i know that the DNS doesn't have too much memory, but anyway) and stays there. If i restart it, then the memory usage goes down to around 13%. Is this a normal behaviour?

-sc

I ran an experiment to check this out.  First off, I rebooted the NAS to get it into a known state.  When I launched MediaTomb in daemon mode (the way it is started in mediatomb.sh), it uses 12% of the memory and 0% CPU (using top).  I then imported about 7000 tracks.  The CPU usage is between 80-85% and the memory slowly climbed to 21%.  When the import finished, CPU dropped back to 0%, but the memory stayed at 21%.  I'm going to check it later to see if it stays at 21%.  There may be a memory leak and if so, I'll report it to the MediaTomb developer (Jin).  I definitely did not see 66%....

I asked Jin about taglib with wma support and he said he will not include this patched taglib in the static builds he will release for 0.12.0.  He is going to use the stock version of taglib 1.5.  However, he is open to adding a configure option to enable wma processing by taglib for those who wish to "roll their own binaries." smile  This is good because I'd rather compile with an unaltered MediaTomb.

Thanks for the feedback smile

Offline

 

#41 2008-10-28 22:05:14

mb16
New member
Registered: 2008-10-28
Posts: 4

Re: [REL] MediaTomb 0.12.0 SVN 1899

I know this is off topic, but this thread is by the people with the knowlage that might help me out.
I managed to compile mediatomb 0.11.0 on my device including js. I'm trying to serve audio to my reciva based DNT-IPDIO-mini.
Basic functions including a virtual layout suitable for my requirements work great.

Now I have the idea of something like "whole album playback" or "nearly gapless playback". In fact the track switching times are annoying on some albums...
I tried to do some simple tests and failed up to now.

I tried to add to config.xml something like:
...
      <transcode mimetype="mymime/mymode" using="toComplete"/>
... and
      <profile name="toComplete" enabled="yes" type="external">
        <mimetype>audio/x-wav</mimetype>
        <accept-url>yes</accept-url>
        <first-resource>yes</first-resource>
        <accept-ogg-theora>no</accept-ogg-theora>
        <agent command="/mnt/HD_a2/mediatomb/test.sh" arguments="%out"/>
        <buffer size="1048576" chunk-size="131072" fill-size="262144"/>
      </profile>
...
I wrote a script test.sh:
#!/bin/sh
echo script called with $1
cat "/mnt/HD_a2/mediatomb/testmedia/04_I Heard Love Is Blind.wav" > $1

I Added a virtual item to the database:
Title: Test
Mimetype: mymime/mymode
Location: pointing to my script

Now I can see the Test entry on my device, but playback does not work. I tried the same using an mp3 file, same result. The script is invoked a couple of times as soon as I try to play the file.

Can someone give me a hint?
Thanks

Markus

Offline

 

#42 2008-10-28 22:54:41

boilerjt
Member
From: Minnesota, USA
Registered: 2008-09-15
Posts: 122

Re: [REL] MediaTomb 0.12.0 SVN 1899

Rival wrote:

First solution: aac capable firmware for MusicPal
Second solution: URL capable faad for DNS-323
Third solution: runnable vlc for DNS-323
Fourth solution: not to listen to aac streams... but most stations I need are aac only...
Fifth solution: having some walk, cooking something, drinking a beer and relax...

The last one is the best thing I can do now... thanks for your help, I'll be back... big_smile

How about Solution #3?

Download it here: http://www.box.net/shared/q75032a4ck
Or here:              http://www.mediafire.com/file/ozj5zud1x … ffp0.5.tgz

Right now, the package is pretty large.  Someday, I'll try to make it smaller by getting rid of some one useless stuff that won't work on the NAS anyway...

After installing it using funpkg -i, create a script called vlcaudio in /ffp/bin with the following and make it executable (chmod +x vlcaudio):

Code:

#!/ffp/bin/bash

INPUT="$1"
OUTPUT="$2"
AUDIO_CODEC="s16l"
AUDIO_BITRATE="192"
AUDIO_SAMPLERATE="44100"
AUDIO_CHANNELS="2"
FORMAT="wav"

exec /usr/bin/vlc -I dummy "${INPUT}" --sout "#transcode{acodec=${AUDIO_CODEC},\
ab=${AUDIO_BITRATE},channels=${AUDIO_CHANNELS}}:\
standard{access=file,mux=${FORMAT},dst=${OUTPUT}}" vlc:quit >/dev/null

Edit these lines in config.xml:

Code:

<transcode mimetype="audio/mp4" using="vlcwav"/>
<transcode mimetype="audio/x-aac" using="vlcwav"/>

Then add this transcode profile:

Code:

  
      <profile name="vlcwav" enabled="yes" type="external">
        <use-chunked-encoding>no</use-chunked-encoding> 
        <mimetype>audio/wav</mimetype>
        <accept-url>yes</accept-url>
        <first-resource>yes</first-resource>
        <agent command="vlcaudio" arguments="%in %out"/>
        <buffer size="1048576" chunk-size="131072" fill-size="262144"/>
      </profile>

I'm sure you'll have to play around with buffer size, chunk-size, and fill-size to get it optimized.  You'll also probably have to manually change your mimetypes in your playlist from the web UI to make sure it calls this profile.  This is all experimental at this point and I'm not sure how stable it is. 

One strange thing I have noticed is that it plays at the correct speed on my media device, but when I stream to a file and play it, it only plays at half speed...

You now owe me big time wink

Last edited by boilerjt (2008-10-28 23:15:57)

Offline

 

#43 2008-10-28 23:04:11

boilerjt
Member
From: Minnesota, USA
Registered: 2008-09-15
Posts: 122

Re: [REL] MediaTomb 0.12.0 SVN 1899

mb16 wrote:

I know this is off topic, but this thread is by the people with the knowlage that might help me out.
I managed to compile mediatomb 0.11.0 on my device including js. I'm trying to serve audio to my reciva based DNT-IPDIO-mini.
Basic functions including a virtual layout suitable for my requirements work great.

Now I have the idea of something like "whole album playback" or "nearly gapless playback". In fact the track switching times are annoying on some albums...
I tried to do some simple tests and failed up to now.

I tried to add to config.xml something like:
...
      <transcode mimetype="mymime/mymode" using="toComplete"/>
... and
      <profile name="toComplete" enabled="yes" type="external">
        <mimetype>audio/x-wav</mimetype>
        <accept-url>yes</accept-url>
        <first-resource>yes</first-resource>
        <accept-ogg-theora>no</accept-ogg-theora>
        <agent command="/mnt/HD_a2/mediatomb/test.sh" arguments="%out"/>
        <buffer size="1048576" chunk-size="131072" fill-size="262144"/>
      </profile>
...
I wrote a script test.sh:
#!/bin/sh
echo script called with $1
cat "/mnt/HD_a2/mediatomb/testmedia/04_I Heard Love Is Blind.wav" > $1

I Added a virtual item to the database:
Title: Test
Mimetype: mymime/mymode
Location: pointing to my script

Now I can see the Test entry on my device, but playback does not work. I tried the same using an mp3 file, same result. The script is invoked a couple of times as soon as I try to play the file.

Can someone give me a hint?
Thanks

Markus

This is something beyond what I have done in MediaTomb and Jin (the Mediatomb developer) would probably be the best person to ask.  There is a MediaTomb forum at https://sourceforge.net/forum/?group_id=129766 where you can ask your question.  Jin is usually pretty quick in responding.  There are also other experts over there that may help you smile

Offline

 

#44 2008-10-29 20:56:35

Rival
Member
From: Budapest
Registered: 2008-03-13
Posts: 53
Website

Re: [REL] MediaTomb 0.12.0 SVN 1899

boilerjt wrote:

How about Solution #3?
(...)
You now owe me big time wink

You're a god... smile I can hear an aac! But the bad thing is that I can play streams only in half speed too. It seems it's a samplerate bug with transcoding aac+ in earlier vlc versions (I don't know that recent vlc 0.9.x has it or not). I unsuccessfully tried to variate codecs, muxers, but nothing... half speed.

But it's the right way... does not consume too much CPU time (~20-30%), and works with mediatomb. I hope there will be a solution to this problem in the near future.

Thank you again... smile

Offline

 

#45 2008-10-29 21:30:22

boilerjt
Member
From: Minnesota, USA
Registered: 2008-09-15
Posts: 122

Re: [REL] MediaTomb 0.12.0 SVN 1899

Rival wrote:

boilerjt wrote:

How about Solution #3?
(...)
You now owe me big time wink

You're a god... smile I can hear an aac! But the bad thing is that I can play streams only in half speed too. It seems it's a samplerate bug with transcoding aac+ in earlier vlc versions (I don't know that recent vlc 0.9.x has it or not). I unsuccessfully tried to variate codecs, muxers, but nothing... half speed.

But it's the right way... does not consume too much CPU time (~20-30%), and works with mediatomb. I hope there will be a solution to this problem in the near future.

Thank you again... smile

Crap, I was hoping it would work at normal speed for you.  One thing you can try is streaming to your device using pcm.

In the vlcaudio script:
Change AUDIO_CODEC="s16l" to AUDIO_CODEC="s16h"
Change FORMAT="wav" to FORMAT="raw"

In Config.xml in the vlcwav profile:
Change <mimetype>audio/wav</mimetype> to <mimetype>audio/L16</mimetype>

I'll try to compile the latest VLC.  I was avoiding it because of the problem running as root, but I see that there is a configure option (--enable-run-as-root) that might work.

Offline

 

#46 2008-10-29 22:10:45

Rival
Member
From: Budapest
Registered: 2008-03-13
Posts: 53
Website

Re: [REL] MediaTomb 0.12.0 SVN 1899

boilerjt wrote:

Crap, I was hoping it would work at normal speed for you.  One thing you can try is streaming to your device using pcm.

Making a device to know a thing that it didn't do before is a very exciting thing to me. I love linux... smile

But let's be serious: I tried these settings but my device didn't start playing. From the running processes I know that vlc starts and stops immediately but I don't know why.

If you could tell me how to show debug info or output screen of vlc we could know why it stops. >/dev/tty or >/mnt/HD_a2/text.file didn't work for me... just created a 0 byte long file. (Of course I've made it writable before).

But if we could try out new vlc it would be nice and if it worked I could call you master of the universe... smile

Offline

 

#47 2008-10-29 23:27:59

boilerjt
Member
From: Minnesota, USA
Registered: 2008-09-15
Posts: 122

Re: [REL] MediaTomb 0.12.0 SVN 1899

Rival wrote:

boilerjt wrote:

Crap, I was hoping it would work at normal speed for you.  One thing you can try is streaming to your device using pcm.

Making a device to know a thing that it didn't do before is a very exciting thing to me. I love linux... smile

But let's be serious: I tried these settings but my device didn't start playing. From the running processes I know that vlc starts and stops immediately but I don't know why.

If you could tell me how to show debug info or output screen of vlc we could know why it stops. >/dev/tty or >/mnt/HD_a2/text.file didn't work for me... just created a 0 byte long file. (Of course I've made it writable before).

But if we could try out new vlc it would be nice and if it worked I could call you master of the universe... smile

It could be that your device cannot play a pcm stream and mediatomb kills the vlc process.  To see the vlc output, edit the mediatomb.sh file and remove the -d option.  Make sure you kill the mediatomb daemon first (killall mediatomb) before restarting it.  This will start mediatomb in normal command line mode (not the daemon mode) and vlc output will be directed to the terminal.  If a vlc error occurs, it does complain about it smile  My device can play both wav and pcm and I've used the vlc script in both ways.

I'll try to start working on compiling the latest vlc tonight.

Offline

 

#48 2008-10-31 00:01:25

Rival
Member
From: Budapest
Registered: 2008-03-13
Posts: 53
Website

Re: [REL] MediaTomb 0.12.0 SVN 1899

I made these changes you wrote:

Change AUDIO_CODEC="s16l" to AUDIO_CODEC="s16h"
Change FORMAT="wav" to FORMAT="raw"

VLC said:

-----
2008-10-30 22:47:31    INFO: Arguments: %in %out
VLC media player 0.8.6i Janus
starting VLC root wrapper... using UID 0 (root)
***************************************
* Running VLC as root is discouraged. *
***************************************
It is potentially dangerous, and might not even work properly.
[00000222] dummy interface: using the dummy interface module...
[00000230] mux_dummy private: Open
[00000232] access_http access: Raw-audio server found, m4a demuxer selected
[00000235] packetizer_mpeg4audio packetizer: AAC channels: 2 samplerate: 22050
[00000226] stream_out_transcode private error: cannot find encoder ((null))
[00000226] stream_out_transcode private error: cannot create audio chain
[00000236] main packetizer error: cannot create packetizer output (mp4a)
-----

No encoder found. With the wav settings vlc says:

-----
2008-10-30 22:49:40    INFO: Arguments: %in %out
VLC media player 0.8.6i Janus
starting VLC root wrapper... using UID 0 (root)
***************************************
* Running VLC as root is discouraged. *
***************************************
It is potentially dangerous, and might not even work properly.
[00000222] dummy interface: using the dummy interface module...
[00000232] access_http access: Raw-audio server found, m4a demuxer selected
[00000235] packetizer_mpeg4audio packetizer: AAC channels: 2 samplerate: 22050
-----

But it's half speed. As you can see it might be a samplerate detection problem. I've found in a forum somewhere the same exact problem, the reply was that this is a bug in transcoding module... I googled the whole net, don't ask me where I found this thread... smile

If you listen to an AAC+ stream with Winamp (for example) you can hear a sound quality improvement in the first second. Like a samplerate change from 22050 to 44100. This vlc build might unable to handle this change in radio streams while transcoding...

As I know you can't force vlc to use a predefined input samplerate, this can only be autodetected.

I'm looking forward to new vlc build.

Last edited by Rival (2008-10-31 00:03:23)

Offline

 

#49 2008-10-31 01:06:37

boilerjt
Member
From: Minnesota, USA
Registered: 2008-09-15
Posts: 122

Re: [REL] MediaTomb 0.12.0 SVN 1899

Rival wrote:

I made these changes you wrote:

...

But it's half speed. As you can see it might be a samplerate detection problem. I've found in a forum somewhere the same exact problem, the reply was that this is a bug in transcoding module... I googled the whole net, don't ask me where I found this thread... smile

If you listen to an AAC+ stream with Winamp (for example) you can hear a sound quality improvement in the first second. Like a samplerate change from 22050 to 44100. This vlc build might unable to handle this change in radio streams while transcoding...

As I know you can't force vlc to use a predefined input samplerate, this can only be autodetected.

I'm looking forward to new vlc build.

Maybe I forgot is include the LPCM module in vlc... It would probably still be half speed anyway.  I think the only reason it works on my device (DirecTV HR20) is a fluke because my device cannot play any samplerate below 32000.  It probably sees the 22050 in the wav header and defaults to 44100.

Build vlc 0.9.5 is proving to be a real challenge.  It took me 3 hours last night just to get through the configure script.  I have tried to compile it and have been greeted with error after error...  One error that I overcame in building 0.8.6i was getting vlc to not compile with ipv6 support which as far as I can see, will not work with the DNS-323 kernel.  In 0.8.6i, ipv6 was a plugin module that I told vlc not to include.  In 0.9.5, ipv6 support seems to built in the main vlc library and won't compile.  There are also many pthread issues... Fun stuff...

Offline

 

#50 2008-10-31 01:20:06

bodbod
Member
Registered: 2007-11-22
Posts: 109

Re: [REL] MediaTomb 0.12.0 SVN 1899

Hi Guys,

maybe you ll be able to help me on that issue, is it possible to keep the directory structure limited to the shared one.
I mean without all the parents directory before

thx you

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB