lintweaker / mpd-dsd-019

DSD specific patches for MPD 0.19
GNU General Public License v2.0
10 stars 4 forks source link

compile on RPi2 #4

Closed Warter21 closed 9 years ago

Warter21 commented 9 years ago

Hello,

RPi2 / Debian / kernel 4.1.6 / mpd 0.19.10 + nativ dsd patch

I try to compile but I got this error:

g++ -DHAVE_CONFIG_H -I.  -DNDEBUG -I./src -pthread -isystem /usr/include/glib-2.0 -isystem /usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include -DSYSTEM_CONFIG_FILE_LOCATION='"/etc/mpd.conf"'  -I/usr/include/alsa   -I/usr/include/AL   -D_REENTRANT  -pthread  -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -std=gnu++0x -pthread -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -fvisibility=hidden -fno-threadsafe-statics -fmerge-all-constants -fno-exceptions -fno-rtti -ffast-math -ftree-vectorize -ffunction-sections -fdata-sections -Wall -Wextra -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wwrite-strings -Wsign-compare -c -o src/output/plugins/liboutput_plugins_a-AlsaOutputPlugin.o `test -f 'src/output/plugins/AlsaOutputPlugin.cxx' || echo './'`src/output/plugins/AlsaOutputPlugin.cxx
src/output/plugins/AlsaOutputPlugin.cxx: In function 'snd_pcm_format_t get_bitformat(SampleFormat)':
src/output/plugins/AlsaOutputPlugin.cxx:310:10: error: 'SND_PCM_FORMAT_DSD_U32_BE' was not declared in this scope
   return SND_PCM_FORMAT_DSD_U32_BE;
          ^
Makefile:11192: recipe for target 'src/output/plugins/liboutput_plugins_a-AlsaOutputPlugin.o' failed
make[3]: *** [src/output/plugins/liboutput_plugins_a-AlsaOutputPlugin.o] Error 1
make[3]: Leaving directory '/usr/src/mpdcomp/mpd-0.19.10'
Makefile:4288: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/usr/src/mpdcomp/mpd-0.19.10'
dh_auto_build: make -j1 returned exit code 2
debian/rules:140: recipe for target 'override_dh_auto_build' failed
make[1]: *** [override_dh_auto_build] Error 2
make[1]: Leaving directory '/usr/src/mpdcomp/mpd-0.19.10'
debian/rules:124: recipe for target 'binary' failed
make: *** [binary] Error 2
debuild: fatal error at line 1352:
couldn't exec debian/rules:

Do you have any idea what could be wrong?

Thanks, Warter

lintweaker commented 9 years ago

Hello,

Debian Wheezy's ALSA package is probably too old. It does not support the DSD sample formats. You can either patch it or upgrade ALSA. Patching is probably easier. I think other have done this before.

Warter21 commented 9 years ago

I use Debian Jessie. Alsa 1.0.28. Is it too old?

Warter21 commented 9 years ago

It seems you are right.

root@jessie-rpi:/usr/include/alsa# grep DSD *
pcm.h:  /* Direct Stream Digital (DSD) in 1-byte samples (x8) */
pcm.h:  SND_PCM_FORMAT_DSD_U8,
pcm.h:  /* Direct Stream Digital (DSD) in 2-byte samples (x16) */
pcm.h:  SND_PCM_FORMAT_DSD_U16_LE,
pcm.h:  SND_PCM_FORMAT_LAST = SND_PCM_FORMAT_DSD_U16_LE,
root@jessie-rpi:/usr/include/sound# grep DSD *
asound.h:#define        SNDRV_PCM_FORMAT_DSD_U8         ((snd_pcm_format_t) 48) /* DSD, 1-byte samples DSD (x8) */
asound.h:#define        SNDRV_PCM_FORMAT_DSD_U16_LE     ((snd_pcm_format_t) 49) /* DSD, 2-byte samples DSD (x16), little endian */
asound.h:#define        SNDRV_PCM_FORMAT_DSD_U32_LE     ((snd_pcm_format_t) 50) /* DSD, 4-byte samples DSD (x32), little endian */
asound.h:#define        SNDRV_PCM_FORMAT_DSD_U16_BE     ((snd_pcm_format_t) 51) /* DSD, 2-byte samples DSD (x16), big endian */
asound.h:#define        SNDRV_PCM_FORMAT_DSD_U32_BE     ((snd_pcm_format_t) 52) /* DSD, 4-byte samples DSD (x32), big endian */
asound.h:#define        SNDRV_PCM_FORMAT_LAST           SNDRV_PCM_FORMAT_DSD_U32_BE

Any idea? :)

lintweaker commented 9 years ago

I had to check my notes, it has been a while. It is a bit of a mess alsa-lib include vs includes from the kernel. ALSA 1.0.28 is still too old, 1.0.28 still needs these patches:

Patch5:   0001-pcm-Fix-DSD-formats-userland-usability.patch
Patch6:   0001-pcm-Add-missing-signed-and-endianess-definitions-for.patch
Patch7:   0001-pcm-2nd-round-of-pcm_misc-DSD-fixes.patch
Patch8:   alsa-lib-add-dsd-u32-le-v3.patch
Patch9:   alsa-lib-add-dsd-be-formats.patch

These can be found in my xmos-native-dsd repo.

Warter21 commented 9 years ago

I checked alsa site, it seems they added dsd 32 support in the 1.0.29 version. So I have to upgrade the alsa package. Thanks for your help.

lintweaker commented 9 years ago

No problem. Be carefull upgrading ALSA to a new major version. Patching the current version is safer.