Reply To: DebianSlug Arm package

#7869
thorstenhirsch
Participant

Alright, today I updated the tremor patch so that it can be applied to libvorbis-1.1.1. This patch also includes the endian patch. Here it is:

--- ogg123/Makefile.in~ 2005-06-27 11:29:11.000000000 +0200
+++ ogg123/Makefile.in 2007-10-07 22:05:41.000000000 +0200
@@ -209,7 +209,7 @@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
VORBISENC_LIBS = @VORBISENC_LIBS@
-VORBISFILE_LIBS = @VORBISFILE_LIBS@
+VORBISFILE_LIBS = -lvorbisidec
VORBIS_CFLAGS = @VORBIS_CFLAGS@
VORBIS_LIBS = @VORBIS_LIBS@
XGETTEXT = @XGETTEXT@
@@ -270,7 +270,7 @@
@PTHREAD_CFLAGS@ @SHARE_CFLAGS@ @I18N_CFLAGS@

ogg123_LDADD = @SHARE_LIBS@
- @VORBISFILE_LIBS@ @VORBIS_LIBS@ @OGG_LIBS@ @AO_LIBS@
+ -lvorbisidec @OGG_LIBS@ @AO_LIBS@
@SOCKET_LIBS@ @LIBICONV@ @CURL_LIBS@ @PTHREAD_CFLAGS@
@PTHREAD_LIBS@ @I18N_LIBS@ @FLAC_LIBS@ @SPEEX_LIBS@

--- ogg123/cmdline_options.c~ 2005-06-13 15:11:44.000000000 +0200
+++ ogg123/cmdline_options.c 2007-10-07 22:05:34.000000000 +0200
@@ -195,7 +195,7 @@
break;

case 'V':
- status_error(_("ogg123 from %s %sn"), PACKAGE, VERSION);
+ status_error(_("ogg123 (w/Tremor hack) from %s %sn"), PACKAGE, VERSION);
exit(0);
break;

--- ogg123/oggvorbis_format.c~ 2005-06-03 12:15:09.000000000 +0200
+++ ogg123/oggvorbis_format.c 2007-10-07 22:05:28.000000000 +0200
@@ -21,7 +21,7 @@
#include
#include
#include
-#include
+#include
#include "transport.h"
#include "format.h"
#include "vorbis_comments.h"
@@ -136,9 +136,7 @@
while (nbytes > 0) {

old_section = priv->current_section;
- ret = ov_read(&priv->vf, ptr, nbytes, audio_fmt->big_endian,
- audio_fmt->word_size, audio_fmt->signed_sample,
- &priv->current_section);
+ ret = ov_read(&priv->vf, ptr, nbytes, &priv->current_section);

if (ret == 0) {

--- oggdec/Makefile.in~ 2005-06-27 11:29:12.000000000 +0200
+++ oggdec/Makefile.in 2007-10-07 22:08:24.000000000 +0200
@@ -183,7 +183,7 @@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
VORBISENC_LIBS = @VORBISENC_LIBS@
-VORBISFILE_LIBS = @VORBISFILE_LIBS@
+VORBISFILE_LIBS = -lvorbisidec
VORBIS_CFLAGS = @VORBIS_CFLAGS@
VORBIS_LIBS = @VORBIS_LIBS@
XGETTEXT = @XGETTEXT@
--- oggdec/oggdec.c~ 2005-06-03 12:15:08.000000000 +0200
+++ oggdec/oggdec.c 2007-10-08 00:06:05.000000000 +0200
@@ -12,27 +12,25 @@
#include
#include
#include
+#include

#if defined(_WIN32) || defined(__EMX__) || defined(__WATCOMC__)
#include
#include
#endif

-#include
+#include

struct option long_options[] = {
{"quiet", 0,0,'Q'},
{"help",0,0,'h'},
{"version", 0, 0, 'v'},
- {"bits", 1, 0, 'b'},
- {"endianness", 1, 0, 'e'},
{"raw", 0, 0, 'R'},
- {"sign", 1, 0, 's'},
{"output", 1, 0, 'o'},
{NULL,0,0,0}
};

-#define VERSIONSTRING "OggDec 1.0.1n"
+#define VERSIONSTRING "OggDec 1.0.1 (Tremor)n"

static int quiet = 0;
static int bits = 16;
@@ -49,11 +47,6 @@
" --quiet, -Q Quiet mode. No console output.n"
" --help, -h Produce this help message.n"
" --version, -v Print out version number.n"
- " --bits, -b Bit depth for output (8 and 16 supported)n"
- " --endianness, -e Output endianness for 16 bit output. 0 forn"
- " little endian (default), 1 for big endiann"
- " --sign, -s Sign for output PCM, 0 for unsigned, 1 forn"
- " signed (default 1)n"
" --raw, -R Raw (headerless) output.n"
" --output, -o Output to given filename. May only be usedn"
" if there is only one input filen"
@@ -68,7 +61,7 @@
int option_index = 1;
int ret;

- while((ret = getopt_long(argc, argv, "Qhvb:e:Rs:o:",
+ while((ret = getopt_long(argc, argv, "QhvR:o:",
long_options, &option_index)) != -1)
{
switch(ret)
@@ -84,19 +77,6 @@
fprintf(stderr, VERSIONSTRING);
exit(0);
break;
- case 's':
- sign = atoi(optarg);
- break;
- case 'b':
- bits = atoi(optarg);
- if(bits <= 8)
- bits = 8;
- else
- bits = 16;
- break;
- case 'e':
- endian = atoi(optarg);
- break;
case 'o':
outfilename = strdup(optarg);
break;
@@ -242,7 +222,7 @@
}
}

- while((ret = ov_read(&vf, buf, buflen, endian, bits/8, sign, &bs)) != 0) {
+ while((ret = ov_read(&vf, buf, buflen, &bs)) != 0) {
if(bs != 0) {
fprintf(stderr, "Only one logical bitstream currently supportedn");
break;
@@ -255,6 +235,18 @@
continue;
}

+#ifdef BIG_ENDIAN
+ { /* byteswap */
+ int i;
+ char tmp_char;
+ for(i=0;i + tmp_char = buf;
+ buf
= buf[i+1];
+ buf[i+1] = tmp_char;
+ }
+ }
+#endif
+
if(fwrite(buf, 1, ret, out) != ret) {
fprintf(stderr, "Error writing to file: %sn", strerror(errno));
ov_clear(&vf);

However, 1 hunk will fail for oggdec.c. I don’t know why, I’ve created a new diff 3x with “diff -ruN”, but somehow this one damn line can’t be patched correctly. Maybe it’s also too late and I’m too tired.

The next problem: I still can’t play ogg files. 🙁
This is what I did:

1.) download tremor (svn co http://svn.xiph.org/trunk/Tremor/ tremor)
2.) autogen, configure, make, make install on the LS2
3.) download vorbis-tools-1.1.1
4.) apply my patch (and change this 1 line manually)
5.) configure, make, make install

Everything run successfully and I can also run the decoding script of firefly manually w/o problems:

/usr/local/bin/mt-daapd-ssc.sh "/som/ogg/file.ogg" 0 251.000 "ogg"

My LS2 tries to play the ogg file, but cancels at once and says, that it can’t play the song. This is the log entry of firefly:

2007-10-08 00:38:25 (00080003): Session 0: Streaming file 'someoggfile.ogg' to 192.168.0.22 (offset 0)

So no error and also no sound. The SB doesn’t even say, that it waits for the song to be cached (that’s what it did with the “normal” liboggdec/vorbis-tools).