[a52 plugin] no sound/audio, traps: pulseaudio[25921] trap divide error ip:7fe46a303a57 sp:7fff825b91d0 error:0 in libavutil.so.51.22.1

Bug #1241439 reported by Gal Miara
46
This bug affects 10 people
Affects Status Importance Assigned to Milestone
libav (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

upgraded to 13.10 64 bit
no sound at all
aplay lists the devices

syslog is full of repeating messages:
desktop kernel: [ 891.907148] traps: pulseaudio[19742] trap divide error ip:7fde05efca57 sp:7fff94bff400 error:0 in libavutil.so.51.22.1[7fde05ee9000+1c000]
Oct 18 00:57:11 desktop pulseaudio[19746]: [pulseaudio] pid.c: Stale PID file, overwriting.
Oct 18 00:57:11 desktop pulseaudio[19743]: [pulseaudio] main.c: Daemon startup failed.

had to turn off respawning in client.conf

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: pulseaudio 1:4.0-0ubuntu6
ProcVersionSignature: Ubuntu 3.11.0-12.19-generic 3.11.3
Uname: Linux 3.11.0-12-generic x86_64
ApportVersion: 2.12.5-0ubuntu2
Architecture: amd64
AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/by-path', '/dev/snd/controlC1', '/dev/snd/hwC1D0', '/dev/snd/pcmC1D3p', '/dev/snd/controlC0', '/dev/snd/hwC0D2', '/dev/snd/pcmC0D0c', '/dev/snd/pcmC0D0p', '/dev/snd/pcmC0D1p', '/dev/snd/pcmC0D2c', '/dev/snd/pcmC0D2p', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1:
Date: Fri Oct 18 11:47:26 2013
InstallationDate: Installed on 2013-04-30 (170 days ago)
InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Release amd64 (20130424)
MarkForUpload: True
PulseList: Error: command ['pacmd', 'list'] failed with exit code 1: No PulseAudio daemon running, or not running as session daemon.
SourcePackage: pulseaudio
UpgradeStatus: Upgraded to saucy on 2013-10-17 (0 days ago)
dmi.bios.date: 08/21/2012
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: F11
dmi.board.asset.tag: To be filled by O.E.M.
dmi.board.name: H77-D3H
dmi.board.vendor: Gigabyte Technology Co., Ltd.
dmi.board.version: x.x
dmi.chassis.asset.tag: To Be Filled By O.E.M.
dmi.chassis.type: 3
dmi.chassis.vendor: Gigabyte Technology Co., Ltd.
dmi.chassis.version: To Be Filled By O.E.M.
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrF11:bd08/21/2012:svnGigabyteTechnologyCo.,Ltd.:pnTobefilledbyO.E.M.:pvrTobefilledbyO.E.M.:rvnGigabyteTechnologyCo.,Ltd.:rnH77-D3H:rvrx.x:cvnGigabyteTechnologyCo.,Ltd.:ct3:cvrToBeFilledByO.E.M.:
dmi.product.name: To be filled by O.E.M.
dmi.product.version: To be filled by O.E.M.
dmi.sys.vendor: Gigabyte Technology Co., Ltd.

Revision history for this message
Gal Miara (miara-gal) wrote :
summary: - no sound/audio, pulseaudio failure
+ no sound/audio, traps: pulseaudio[25921] trap divide error
+ ip:7fe46a303a57 sp:7fff825b91d0 error:0 in libavutil.so.51.22.1
Revision history for this message
Launchpad Janitor (janitor) wrote : Re: no sound/audio, traps: pulseaudio[25921] trap divide error ip:7fe46a303a57 sp:7fff825b91d0 error:0 in libavutil.so.51.22.1

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in pulseaudio (Ubuntu):
status: New → Confirmed
Revision history for this message
segler (segler-alex) wrote :

i get this error after trying a52 plugin for alsa (https://help.ubuntu.com/community/DigitalAC-3Pulseaudio)

[ 1018.821102] traps: pulseaudio[4609] trap divide error ip:7ffa52100a57 sp:7fff053ea510 error:0 in libavutil.so.51.22.1[7ffa520ed000+1c000]
[ 1019.662313] traps: pulseaudio[4616] trap divide error ip:7fe8c003da57 sp:7fff5672fd30 error:0 in libavutil.so.51.22.1[7fe8c002a000+1c000]
[ 1023.878323] traps: pulseaudio[4682] trap divide error ip:7f4b285d2a57 sp:7fff34c1bfe0 error:0 in libavutil.so.51.22.1[7f4b285bf000+1c000]
[ 1026.173589] traps: pulseaudio[4690] trap divide error ip:7f0ff55dda57 sp:7fff73481b70 error:0 in libavutil.so.51.22.1[7f0ff55ca000+1c000]
[ 1032.169982] traps: pulseaudio[4698] trap divide error ip:7fc5a2c13a57 sp:7fff827c2070 error:0 in libavutil.so.51.22.1[7fc5a2c00000+1c000]

this error only appears if if add the following to ~/.asound.rc

pcm.a52 {
    @args [ CARD ]
    @args.CARD {
               type string
               default 0
    }
    type plug
    slave {
           pcm {
               type a52
               card $CARD
           }
    }
}

maybe this will help geting to the error

Revision history for this message
segler (segler-alex) wrote :

i did forget to mention that i did not compile anything myself, i only installed libasound2-plugins-extra

Revision history for this message
segler (segler-alex) wrote :

i use ubuntu 13.10 64bit too
without using a52 plugin, all works. but when i saw you guys packaged it i really had to try it :)

Revision history for this message
Luke Swamy (luke-swamy+launchpad) wrote :

I had a similar file as segler's asound.rc in /usr/share/alsa/alsa.conf.d/a52.conf. Removing it seems to fix the issue for me.
I also tried recompiling the a52 plugin following the link above and that didn't make a difference.

I am also on ubuntu 13.10 64bit after upgrading from 13.04.

Revision history for this message
Gal Miara (miara-gal) wrote :

Did a little reverse installations on https://help.ubuntu.com/community/DigitalAC-3Pulseaudio.

Renamed the following files (in order to disable them):
/usr/share/alsa/alsa.conf.d/a52.conf
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_a52.la
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_a52.so

reloaded alsa
reloaded pulseaudio (after re-enabling the respawning in /etc/pulse/client.conf)

The indicator came back to life and everything seems to be OK. Is it still considered a BUG?

Did NOT remove libasound2-plugins, libavcodec-dev, libavformat-dev

Too bad Ubuntu does not support digital surround 5.1 on the s/pdif output.

Revision history for this message
Raymond (superquad-vortex2) wrote :

do your motherboard have two spdif out ?

Node 0x0e [Audio Output] wcaps 0x611: Stereo Digital
  Control: name="IEC958 Playback Con Mask", index=0, device=0
  Control: name="IEC958 Playback Pro Mask", index=0, device=0
  Control: name="IEC958 Playback Default", index=0, device=0
  Control: name="IEC958 Playback Switch", index=0, device=0
  Control: name="IEC958 Default PCM Playback Switch", index=0, device=0
  Device: name="VT2020 Digital", type="SPDIF", device=1
  Converter: stream=8, channel=0
  Digital: Enabled Non-Audio GenLevel
  Digital category: 0x2
  IEC Coding Type: 0x0
  PCM:
    rates [0x5e0]: 44100 48000 88200 96000 192000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM
  Power states: D0 D1 D2 D3
  Power: setting=D0, actual=D0
Node 0x0f [Audio Output] wcaps 0x611: Stereo Digital
  Converter: stream=8, channel=0
  Digital: Enabled Non-Audio GenLevel
  Digital category: 0x2
  IEC Coding Type: 0x0
  PCM:
    rates [0x5e0]: 44100 48000 88200 96000 192000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM
  Power states: D0 D1 D2 D3
  Power: setting=D0, actual=D0

Node 0x2d [Pin Complex] wcaps 0x400701: Stereo Digital
  Control: name="SPDIF Phantom Jack", index=0, device=0
  Pincap 0x00000010: OUT
  Pin Default 0x074511f0: [Jack] SPDIF Out at Ext Rear Panel
    Conn = Optical, Color = Black
    DefAssociation = 0xf, Sequence = 0x0
    Misc = NO_PRESENCE
  Pin-ctls: 0x40: OUT
  Power states: D0 D1 D2 D3
  Power: setting=D0, actual=D0
  Connection: 1
     0x0e
Node 0x2e [Pin Complex] wcaps 0x400701: Stereo Digital
  Control: name="SPDIF Phantom Jack", index=1, device=0
  Pincap 0x00000010: OUT
  Pin Default 0x074511f0: [Jack] SPDIF Out at Ext Rear Panel
    Conn = Optical, Color = Black
    DefAssociation = 0xf, Sequence = 0x0
    Misc = NO_PRESENCE
  Pin-ctls: 0x40: OUT
  Power states: D0 D1 D2 D3
  Power: setting=D0, actual=D0
  Connection: 1
     0x0f

Revision history for this message
Raymond (superquad-vortex2) wrote :

seem missing "stereo mix"

Node 0x21 [Audio Mixer] wcaps 0x20050b: Stereo Amp-In
  Control: name="Front Mic Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=3, ofs=0
  Control: name="Front Mic Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=3, ofs=0
  Control: name="Rear Mic Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=1, ofs=0
  Control: name="Rear Mic Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=1, ofs=0
  Control: name="Line Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=2, ofs=0
  Control: name="Line Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=2, ofs=0
  Amp-In caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1
  Amp-In vals: [0x80 0x80] [0x82 0x82] [0x0c 0x0c] [0x80 0x80] [0x80 0x80]
  Power states: D0 D1 D2 D3
  Power: setting=D0, actual=D0
  Connection: 5
     0x2c 0x2b 0x2a 0x29 0x28
  In-driver Connection: 6
     0x2c 0x2b 0x2a 0x29 0x28 0x08

you can record from Audio Output node 0x08

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/plain/Documentation/sound/alsa/HD-Audio.txt

Hint Strings
~~~~~~~~~~~~
The codec parser have several switches and adjustment knobs for
matching better with the actual codec or device behavior. Many of
them can be adjusted dynamically via "hints" strings as mentioned in
the section above.

- add_stereo_mix_input (bool): add the stereo mix (analog-loopback
  mix) to the input mux if available

Early Patching
~~~~~~~~~~~~~~
When CONFIG_SND_HDA_PATCH_LOADER=y is set, you can pass a "patch" as a
firmware file for modifying the HD-audio setup before initializing the
codec. This can work basically like the reconfiguration via sysfs in
the above, but it does it before the first codec configuration.

Revision history for this message
Raymond (superquad-vortex2) wrote :

> Too bad Ubuntu does not support digital surround 5.1 on the s/pdif output.

http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=814c0371a493cf47df4e6e27253cfd5ec3cef783

+ pa_snprintf(device_name, len, "%s,AES0=6", u->device_name);

http://git.alsa-project.org/?p=alsa-plugins.git;a=commitdiff;h=2559a56209c6729574b8cb16c5be63e1cc2f1c04;hp=bc0c2843db4dea70251e8c5b4a9272ce40caa7f2

+ snprintf(devstr, sizeof(devstr),
+ "plug:iec958:{AES0 0x%x AES1 0x%x AES2 0x%x AES3 0x%x %s%s}",
+ IEC958_AES0_CON_EMPHASIS_NONE | IEC958_AES0_NONAUDIO |
+ IEC958_AES0_CON_NOT_COPYRIGHT,
+ IEC958_AES1_CON_ORIGINAL | IEC958_AES1_CON_PCM_CODER,
+ 0, rate == 48000 ? IEC958_AES3_CON_FS_48000 : IEC958_AES3_CON_FS_44100,
+ card ? " CARD " : "",
+ card ? card : "");
+

summary: - no sound/audio, traps: pulseaudio[25921] trap divide error
+ [a52 plugin] no sound/audio, traps: pulseaudio[25921] trap divide error
ip:7fe46a303a57 sp:7fff825b91d0 error:0 in libavutil.so.51.22.1
affects: pulseaudio (Ubuntu) → alsa-plugins (Ubuntu)
Revision history for this message
quequotion (quequotion) wrote :

Is this bug different from bug 1242390?

Revision history for this message
quequotion (quequotion) wrote :

>>sp:7fff94bff400 error:0 in libavutil.so.51.22.1[7fde05ee9000+1c000]

Could this mean the error originates in libavutil or that something else caused an error in libavutil?

Revision history for this message
ddephazz (vapula31) wrote :

Found !

* A52 plugin allocates an input buffer at pcm_a52.c:556:
 if (av_samples_alloc(rec->frame->data, rec->frame->linesize,
        io->channels, rec->avctx->frame_size,
        rec->avctx->sample_fmt, 0) < 0)

* The last parameter which equals 0 is "align":
http://libav.org/doxygen/master/samplefmt_8h.html#a4db4c77f928d32c7d8854732f50b8c04

* The problem is in libavutil::av_samples_get_buffer_size(). The parameter "align" is not checked if it equals 0. And the following crash, division by 0
 if (nb_channels > INT_MAX / align ||

* I suggest the following patch, based on FFMpeg source code:
http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavutil/samplefmt.c;h=08ecc834678eced8c3029095a824d8ae9d29406a;hb=HEAD#l137

* I tested it on Ubuntu 13.10 64 bit and it works :-)

---------------------------
Libav patch
---------------------------

--- libavutil/samplefmt_origine.c 2013-05-12 09:08:17.000000000 +0200
+++ libavutil/samplefmt.c 2014-01-21 20:04:45.272527345 +0100
@@ -104,6 +104,12 @@
     if (!sample_size || nb_samples <= 0 || nb_channels <= 0)
         return AVERROR(EINVAL);

+ /* auto-select alignment if not specified */
+ if (!align) {
+ align = 1;
+ nb_samples = FFALIGN(nb_samples, 32);
+ }
+
     /* check for integer overflow */
     if (nb_channels > INT_MAX / align ||
         (int64_t)nb_channels * nb_samples > (INT_MAX - (align * nb_channels)) / sample_size)

Revision history for this message
Michael G (mag1024) wrote :

Tested the patch, and it also fixes the problem for me.
Many thanks, ddephazz!

Revision history for this message
Ladios Jonquil (ladios) wrote :

This is related to bug 1264886

Revision history for this message
David Henningsson (diwic) wrote :
affects: alsa-plugins (Ubuntu) → libav (Ubuntu)
Changed in libav (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → Medium
Revision history for this message
David Henningsson (diwic) wrote :

From what I can tell (looking at the source code), this is fixed in Ubuntu 14.04.

Changed in libav (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.