Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

My attempt to record sound with sox on Raspberry PI fails:

pi@raspberrypi ~/tmp $ rec new.wav
Segmentation fault

And so does play:

pi@raspberrypi ~/tmp $ play test.wav
Segmentation fault

Yet it will convert files for me:

pi@raspberrypi ~/tmp $ sox message.wav message.flac rate 16k
pi@raspberrypi /tmp $ mplayer message.flac
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
libavcodec version 53.35.0 (external)
Mismatching header version 53.32.2
AUDIO: 16000 Hz, 2 ch, s16le, 160.0 kbit/31.26% (ratio: 20004->64000)
Selected audio codec: [ffflac] afm: ffmpeg (FFmpeg FLAC audio)
==========================================================================

The debug information don't seem to provide a whole lot of info:

pi@raspberrypi ~/tmp $ sox -V5 -d new.wav
sox DBUG formats: opening format plugin `lsx_amr_nb_format_fn': library 0x1af6308, entry point 0x4038f2c8
sox DBUG formats: opening format plugin `lsx_amr_wb_format_fn': library 0x1af6a80, entry point 0x4000ee10
sox DBUG formats: opening format plugin `lsx_ao_format_fn': library 0x1af71e0, entry point 0x4003ebb8
sox DBUG formats: opening format plugin `lsx_ffmpeg_format_fn': library 0x1af7918, entry point 0x403de914
sox DBUG formats: opening format plugin `lsx_flac_format_fn': library 0x1afe1e0, entry point 0x419f70a8
sox DBUG formats: opening format plugin `lsx_gsm_format_fn': library 0x1b0e570, entry point 0x403e8cf4
sox DBUG formats: opening format plugin `lsx_lpc10_format_fn': library 0x1b0e978, entry point 0x41a5dcc4
sox DBUG formats: opening format plugin `lsx_mp3_format_fn': library 0x1b0ed80, entry point 0x41a6bd1c
sox DBUG formats: opening format plugin `lsx_oss_format_fn': library 0x1b0fb00, entry point 0x41a77d74
sox DBUG formats: opening format plugin `lsx_pulseaudio_format_fn': library 0x1b0ff70, entry point 0x41ac9a80
sox DBUG formats: opening format plugin `lsx_sndfile_format_fn': library 0x1b153f8, entry point 0x41e98ec0
sox DBUG formats: opening format plugin `lsx_vorbis_format_fn': library 0x1b15830, entry point 0x41ad49ec
sox DBUG formats: opening format plugin `lsx_wavpack_format_fn': library 0x1b15c68, entry point 0x41ea57c8
sox INFO oss: OSS driver only supports bytes and words
sox INFO oss: Forcing to signed linear word
Segmentation fault

Here is some version data that might be helpful:

pi@raspberrypi ~/tmp $ sox --version
sox:      SoX v14.4.0

pi@raspberrypi ~/tmp $ cat ~/.asoundrc
pcm.!default {
    type asym
    playback.pcm {
        type plug
        slave.pcm "hw:2,0"
        }
    capture.pcm {
        type plug
        slave.pcm "hw:1,0"
        }
}

pi@raspberrypi ~/tmp $ uname -a
Linux raspberrypi 3.2.27+ #250 PREEMPT Thu Oct 18 19:03:02 BST 2012 armv6l GNU/Linux
share|improve this question
add comment

1 Answer

Is this SoX based on the Debian package? Because the problem very much looks like Debian bug #676167 that was introduced in version 14.4.0-3 and fixed in 14.4.0-5.

It also appears (from the list of format plugins) that you don’t have the libsox-fmt-alsa package installed, but you’ll need it for ALSA playback.

So, you should install libsox-fmt-alsa and either upgrade the sox package to at least 14.4.0-5, or set the environment variable AUDIODRIVER=alsa for a workaround.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.