[Bug 1188425] Re: Audio breaks up and pulseaudio eventually crashes with Alsa a52 (ac3) plugin (Ubuntu 13.04)

2014-05-12 Thread Artur Agostinho Araújo
Yes this bug affects all ubuntu releases since at least 13.04
No I haven't found a solution yet. This was the best I came up with. You can 
try to increase the default-fragments number but that will increase latency. A 
number of 5 is a compromise between latency and probability of crash.
I suggest you use Alexander Patrakov's dca alsa plugin 

http://aepatrakov.narod.ru/index/0-2

Its main disadvantage is the higher cpu usage! However it doesn't suffer
from this bug.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1188425

Title:
  Audio breaks up and pulseaudio eventually crashes with Alsa a52 (ac3)
  plugin (Ubuntu 13.04)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1188425/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1188425] Re: Audio breaks up and pulseaudio eventually crashes with Alsa a52 (ac3) plugin (Ubuntu 13.04)

2013-06-18 Thread Artur Agostinho Araújo
I think I found a way to at least minimize this issue. From the
pulseaudio logs I found that for the AC3 plugin it isn't using the
default fragment settings from /etc/pulse/daemon.conf which are:

default-fragments = 8
default-fragment-size-msec = 10

Instead it adjusts to the nearest latency with a default fragment size
of 32 ms. So 8*10=80 ms. 32*3=96 ms is the nearest latency. It is using
a default fragment size of 32 ms no matter what size I set in
daemon.conf. This is what I am talking about:

I: [pulseaudio] alsa-sink.c: Using 3.0 fragments of size 18432 bytes (32.00ms), 
buffer size is 55296 bytes (96.00ms)
I: [pulseaudio] alsa-sink.c: Disabling rewind for device a52:0

I tried to lower the number of fragments and found that the frequency of
the audio drops increases. It might be too frequent actually. So
increasing the number of fragments should minimize the problem, right? I
can increase the number of fragments to the maximum hw buffer size
reported:

D: [pulseaudio] alsa-util.c: Maximum hw buffer size is 320 ms
D: [pulseaudio] alsa-util.c: Set buffer size first (to 3840 samples), period 
size second (to 480 samples).

So if I set 10 or more fragments it will use 10 fragments. However when
I set a too large buffer size (at leat 8 fragments) applications that
play through the alsa plugin for pulseaudio will cause noise. So now I
am using 5 fragments with good results so far. Here is what I have
written inside daemon.conf:

default-fragments = 5 # 8
default-fragment-size-msec = 32 # 10

This yields a buffer size of 160 ms. An increase of 64 ms from the
original 96 ms.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1188425

Title:
  Audio breaks up and pulseaudio eventually crashes with Alsa a52 (ac3)
  plugin (Ubuntu 13.04)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1188425/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1188425] Re: Audio breaks up and pulseaudio eventually crashes with Alsa a52 (ac3) plugin (Ubuntu 13.04)

2013-06-16 Thread Artur Agostinho Araújo
I added this to the a52.conf file located in
/us/share/alsa/alsa.conf.d/a52.conf:

ctl.a52 {
@args [ CARD ]
@args.CARD {
type string
default 0
}
type hw
card $CARD
}

And now I get this from pulseaudio:

I: [pulseaudio] alsa-sink.c: Successfully opened device a52:0.
I: [pulseaudio] alsa-sink.c: Selected mapping 'Digital Surround 5.1 
(IEC958/AC3)' (iec958-ac3-surround-51).
I: [pulseaudio] alsa-sink.c: Cannot enable timer-based scheduling, falling back 
to sound IRQ scheduling.
I: [pulseaudio] alsa-sink.c: Successfully enabled mmap() mode.
I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'a52:0'

Previously pulseaudio reported this:

I: [pulseaudio] alsa-sink.c: Successfully opened device a52:0.
I: [pulseaudio] alsa-sink.c: Selected mapping 'Digital Surround 5.1 
(IEC958/AC3)' (iec958-ac3-surround-51).
I: [pulseaudio] alsa-sink.c: Cannot enable timer-based scheduling, falling back 
to sound IRQ scheduling.
I: [pulseaudio] alsa-sink.c: Successfully enabled mmap() mode.
I: [pulseaudio] (alsa-lib)control.c: Invalid CTL a52:0
I: [pulseaudio] alsa-util.c: Unable to attach to mixer a52:0: No such file or 
directory
I: [pulseaudio] alsa-sink.c: Failed to find a working mixer device.

This is an improvement that didn't resolved the audio breaking. The rest
of the log file still looks the same!

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1188425

Title:
  Audio breaks up and pulseaudio eventually crashes with Alsa a52 (ac3)
  plugin (Ubuntu 13.04)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1188425/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1188425] Re: Audio breaks up and pulseaudio eventually crashes with Alsa a52 (ac3) plugin (Ubuntu 13.04)

2013-06-15 Thread Artur Agostinho Araújo
Thanks for giving attention to my problem.

The hardware decoder is integrated in the logitech Z-5500 speakers. I
don't have knowledge of any specific limit on the amount of data. There
is however information regarding a maximum hw buffer size on the
pulseaudio logs:

D: [pulseaudio] alsa-util.c: Trying a52:0 with SND_PCM_NO_AUTO_FORMAT ...
D: [pulseaudio] alsa-util.c: Managed to open a52:0
D: [pulseaudio] alsa-util.c: snd_pcm_hw_params_set_format(Signed 32 bit Little 
Endian) failed: Invalid argument
D: [pulseaudio] alsa-util.c: snd_pcm_hw_params_set_format(Signed 32 bit Big 
Endian) failed: Invalid argument
D: [pulseaudio] alsa-util.c: snd_pcm_hw_params_set_format(Float 32 bit Little 
Endian) failed: Invalid argument
D: [pulseaudio] alsa-util.c: snd_pcm_hw_params_set_format(Float 32 bit Big 
Endian) failed: Invalid argument
D: [pulseaudio] alsa-util.c: snd_pcm_hw_params_set_format(Signed 32 bit Little 
Endian) failed: Invalid argument
D: [pulseaudio] alsa-util.c: snd_pcm_hw_params_set_format(Signed 32 bit Big 
Endian) failed: Invalid argument
D: [pulseaudio] alsa-util.c: snd_pcm_hw_params_set_format(Signed 24 bit Little 
Endian) failed: Invalid argument
D: [pulseaudio] alsa-util.c: snd_pcm_hw_params_set_format(Signed 24 bit Big 
Endian) failed: Invalid argument
D: [pulseaudio] alsa-util.c: snd_pcm_hw_params_set_format(Signed 24 bit Little 
Endian in 3bytes) failed: Invalid argument
D: [pulseaudio] alsa-util.c: snd_pcm_hw_params_set_format(Signed 24 bit Big 
Endian in 3bytes) failed: Invalid argument
D: [pulseaudio] alsa-util.c: Maximum hw buffer size is 320 ms
D: [pulseaudio] alsa-util.c: Set buffer size first (to 3840 samples), period 
size second (to 480 samples).
I: [pulseaudio] alsa-util.c: Device a52:0 doesn't support sample format s32le, 
changed to s16le.
I: [pulseaudio] alsa-sink.c: Successfully opened device a52:0.
I: [pulseaudio] alsa-sink.c: Selected mapping 'Digital Surround 5.1 
(IEC958/AC3)' (iec958-ac3-surround-51).
I: [pulseaudio] alsa-sink.c: Cannot enable timer-based scheduling, falling back 
to sound IRQ scheduling.
I: [pulseaudio] alsa-sink.c: Successfully enabled mmap() mode.
I: [pulseaudio] (alsa-lib)control.c: Invalid CTL a52:0
I: [pulseaudio] alsa-util.c: Unable to attach to mixer a52:0: No such file or 
directory
I: [pulseaudio] alsa-sink.c: Failed to find a working mixer device.

The dca plugin reports the same number of samples. Here is what I get
from the dca plugin (heavier cpu usage):

D: [pulseaudio] reserve-wrap.c: Successfully create reservation lock monitor 
for device 'Audio0'
D: [pulseaudio] alsa-util.c: Trying dca:0 with SND_PCM_NO_AUTO_FORMAT ...
D: [pulseaudio] alsa-util.c: Managed to open dca:0
I: [pulseaudio] alsa-util.c: Trying to disable ALSA period wakeups, using 
timers only
D: [pulseaudio] alsa-util.c: Maximum hw buffer size is 341 ms
D: [pulseaudio] alsa-util.c: Set buffer size first (to 96000 samples), period 
size second (to 96000 samples).
I: [pulseaudio] alsa-util.c: ALSA period wakeups disabled
I: [pulseaudio] alsa-sink.c: Successfully opened device dca:0.
I: [pulseaudio] alsa-sink.c: Selected mapping 'Digital Surround 5.1 
(IEC958/DTS)' (iec958-dts-surround-51).
I: [pulseaudio] alsa-sink.c: Successfully enabled mmap() mode.
I: [pulseaudio] alsa-sink.c: Successfully enabled timer-based scheduling mode.
I: [pulseaudio] (alsa-lib)control.c: Invalid CTL dca:0
I: [pulseaudio] alsa-util.c: Unable to attach to mixer dca:0: No such file or 
directory
I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0'

Note that the dca plugin finds mixer 'hw:0' while the a52 plugin
doesn't. The dca.conf file is also a lot different from the a52.conf
file. Here is the dca.conf:

defaults.pcm.dca.aes0 0x06
defaults.pcm.dca.aes1 0x82
defaults.pcm.dca.aes2 0x00
defaults.pcm.dca.aes3 0x02

pcm.!dca {
@args [ CARD DEV AES0 AES1 AES2 AES3 ]

@args.CARD {
type string
default {
@func getenv
vars [
ALSA_IEC958_CARD
ALSA_PCM_CARD
ALSA_CARD
]
default {
@func refer
name defaults.pcm.iec958.card
}
}
}

@args.DEV {
type integer
default {
@func igetenv
vars [
ALSA_IEC958_DEVICE
]
default {
@func refer
name defaults.pcm.iec958.device
}
}
}

@args.AES0 {
type integer
default {
@func refer
name defaults.pcm.dca.aes0
}
}

@args.AES1 {
type integer
default {
@func refer
name defaults.pcm.dca.aes1
}
}

@args.AES2 {
type integer
default {
@func refer
name defaults.pcm.dca.aes2
}
}

@args.AES3 {
type integer
default {
@func refer
name defaults.pcm.dca.aes3
}

[Bug 1188425] Re: Audio breaks up and pulseaudio eventually crashes with Alsa a52 (ac3) plugin (Ubuntu 13.04)

2013-06-15 Thread Artur Agostinho Araújo
This also appears in the logs at least once:

D: [alsa-sink-] protocol-native.c: Requesting rewind due to end of underrun.
D: [alsa-sink-] protocol-native.c: Requesting rewind due to end of underrun.
D: [alsa-sink-] protocol-native.c: Requesting rewind due to end of underrun.
D: [alsa-sink-] sink-input.c: Requesting rewind due to uncorking
D: [alsa-sink-] alsa-sink.c: Requested to rewind 0 bytes.
D: [pulseaudio] module-suspend-on-idle.c: Sink 
alsa_output.pci-_00_1b.0.iec958-ac3-surround-51 becomes busy, resuming.
D: [alsa-sink-] alsa-sink.c: Mhmm, actually there is nothing to rewind.
E: [alsa-sink-] alsa-sink.c: ALSA woke us up to write new data to the device, 
but there was actually nothing to write!
E: [alsa-sink-] alsa-sink.c: Most likely this is a bug in the ALSA driver 
'(null)'. Please report this issue to the ALSA developers.
E: [alsa-sink-] alsa-sink.c: We were woken up with POLLOUT set -- however a 
subsequent snd_pcm_avail() returned 0 or another value < min_avail.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1188425

Title:
  Audio breaks up and pulseaudio eventually crashes with Alsa a52 (ac3)
  plugin (Ubuntu 13.04)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1188425/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1188425] Re: Audio breaks up and pulseaudio eventually crashes with Alsa a52 (ac3) plugin (Ubuntu 13.04)

2013-06-15 Thread Artur Agostinho Araújo
Updated alsa-lib and alsa-plugins to latest version 1.0.27.
Unfortunately the a52 plugin makes pulseaudio crash immediately. Had to
compile the alsa-plugins against libav 9 instead of libav 0.8.6 (that
comes with raring) to make it work! Unfortunately the problem with audio
breaking up persists. The pulseaudio log is attached.


** Attachment added: "pulse_20130614.7z"
   
https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1188425/+attachment/3704128/+files/pulse_20130614.7z

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1188425

Title:
  Audio breaks up and pulseaudio eventually crashes with Alsa a52 (ac3)
  plugin (Ubuntu 13.04)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1188425/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1188425] Re: Audio breaks up and pulseaudio eventually crashes with Alsa a52 (ac3) plugin (Ubuntu 13.04)

2013-06-06 Thread Artur Agostinho Araújo
This is the pulseadio log where you can see the dca alsa plugin doing
it's job. There is no registry of audio breaks!


** Attachment added: "pulseaudio log with dca alsa plugin"
   
https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1188425/+attachment/3696819/+files/pulse_20130606.7z

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1188425

Title:
  Audio breaks up and pulseaudio eventually crashes with Alsa a52 (ac3)
  plugin (Ubuntu 13.04)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1188425/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1188425] [NEW] Audio breaks up and pulseaudio eventually crashes with Alsa a52 (ac3) plugin (Ubuntu 13.04)

2013-06-06 Thread Artur Agostinho Araújo
Public bug reported:

I am encoding all audio in AC3 and sending it to my Logitech Z-5500
speakers through the SPDIF out jack on my laptop. Audio works fine for a
while until it breaks up randomly and pulseaudio eventually crashes. By
looking to the pulseaudio logs one can see some buffer underruns. I also
tested with the 3.9.4 mainline kernel though I am not sure this issue is
driver related. The result is always the same! I have this in
/usr/share/alsa/alsa.conf.d/a52.conf

pcm.a52 {
@args [CARD]
@args.CARD {
type string
}
type rate
slave {
pcm {
type a52
format S16_LE # S16_LE, S16_BE
channels 6 # 2, 4, 6
bitrate 640 # 192, 224, 256, 320, 384, 448, 512,  576, 
640
card $CARD
}
rate 48000 # 44100, 48000
}
}

One other thing I tried was the dcaenc-2 alsa plugin from this web page
http://aepatrakov.narod.ru/index/0-2 and this plugin appears to not have
the same problem. The disadvantage of the dca plugin is that it needs a
lot more processing power! So I would prefer the a52 plugin if it worked
flawlessly.

These are the answers to the first two questions:

1)
Ubuntu 13.04

2)
libasound2-plugins-extra:
  Installed: 1.0.25-2ubuntu3
  Candidate: 1.0.25-2ubuntu3
  Version table:
 *** 1.0.25-2ubuntu3 0
500 http://pt.archive.ubuntu.com/ubuntu/ raring/universe amd64 Packages
100 /var/lib/dpkg/status

** Affects: pulseaudio (Ubuntu)
 Importance: Undecided
 Status: New

** Attachment added: "pulseaudio log with a52 alsa plugin on ubuntu 13.04 
kernel"
   
https://bugs.launchpad.net/bugs/1188425/+attachment/3696818/+files/pulse_20130526.7z

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1188425

Title:
  Audio breaks up and pulseaudio eventually crashes with Alsa a52 (ac3)
  plugin (Ubuntu 13.04)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1188425/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs