← Back to team overview

touch-packages team mailing list archive

[Bug 1315212] Re: [CA0106 - CA0106, playback] Playback problem - Surround dies, no valid output

 

Launchpad has imported 13 comments from the remote bug at
https://bugs.freedesktop.org/show_bug.cgi?id=87713.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2014-12-25T17:34:04+00:00 Rkfg wrote:

Created attachment 111331
pulseaudio log

The game uses MonoGame as the engine, it outputs audio via ALSA. Often,
but not every time, when I start the game the sound is played at double
speed. What's worse all other apps also start playing audio too fast,
including paplay, Chrome etc. Even those which are started after I exit
the game. This can be fixed by restarting PA or after killing all
clients connections with paman (if there are none after I exit the game,
sound seems to be working correctly). I believe no client should affect
other clients like this, no matter how it's broken. A friend of mine
completed Transistor without such issues using PA. I also found that
something like this was long ago fixed in Wine but this game is native.
At least more native than pure Win32 apps+Wine and it doesn't use Wine.
It uses Mono though and FMOD as the sound engine.

My soundcard is CA0106 Soundblaster (SB0410 SBLive! 24-bit), CPU is
Intel Core i7-2600, 32Gb RAM, NVIDIA GeForce 770 GTX driver v340.65,
Debian Jessie GNU/Linux amd64, Awesome WM 3.4.15, kernel v3.16.

I also have another sound chip, ALC889 Analog. It's disabled in
pavucontrol.

You can also see some ALSA underruns, I couldn't fix it no matter what
priorities and realtime priorities I set. They happen on both snd-hda-
intel and snd-ca0106.

Reply at: https://bugs.launchpad.net/ubuntu/+source/alsa-
driver/+bug/1315212/comments/10

------------------------------------------------------------------------
On 2014-12-25T17:58:43+00:00 Rkfg wrote:

The issue seems to go away after I set the default sample spec to s32le
(default is s16le). I also noticed that with s16le both Chrome and
Transistor use "resample method: (null)" (according to pacmd list-sink-
inputs), and with s32le it becomes "resample method: copy" for both. And
no, Chrome isn't the culprit as it happens even when it's not running,
I've tried. The speedup happens right after starting the game, I've run
a song in Chrome and launched Transistor. First time it was ok in both
Chrome and the game but on the second run the song immediately sped up
to double speed. I have no idea how the sample spec (not the sample
rate!) affects the speed but it's what it is.

SBLive! seems not to support 44100 Hz as it switches to 48k by default and even if I set 44100 explicitly in the daemon.conf. Though here paman and pacmd disagree with each other, pacmd says "sample spec: s16le 2ch 48000Hz" and paman says "Default Sample Type: s16le 2ch 44100Hz". Mumble notification sounds doesn't
crackle as they do on ALC889 @ 44100Hz so I believe pacmd is correct here.

Reply at: https://bugs.launchpad.net/ubuntu/+source/alsa-
driver/+bug/1315212/comments/11

------------------------------------------------------------------------
On 2014-12-29T15:41:41+00:00 Raymond wrote:

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/plain/sound/pci/ca0106/ca0106_main.c

static struct snd_pcm_hardware snd_ca0106_playback_hw = {
	.info =			SNDRV_PCM_INFO_MMAP | 
				SNDRV_PCM_INFO_INTERLEAVED |
				SNDRV_PCM_INFO_BLOCK_TRANSFER |
				SNDRV_PCM_INFO_MMAP_VALID |
				SNDRV_PCM_INFO_SYNC_START,
	.formats =		SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE,
	.rates =		(SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 |
				 SNDRV_PCM_RATE_192000),
	.rate_min =		48000,
	.rate_max =		192000,
	.channels_min =		2,  //1,
	.channels_max =		2,  //6,
	.buffer_bytes_max =	((65536 - 64) * 8),
	.period_bytes_min =	64,
	.period_bytes_max =	(65536 - 64),
	.periods_min =		2,
	.periods_max =		8,
	.fifo_size =		0,
};

seem support both s16_le and s32_le but require
SNDRV_PCM_INFO_SYNC_START


post the pulseaudio  verbose log

and


aplay -D hw:CARD=CA0106  --dump-hw-params any.wav

Reply at: https://bugs.launchpad.net/ubuntu/+source/alsa-
driver/+bug/1315212/comments/12

------------------------------------------------------------------------
On 2014-12-29T17:28:08+00:00 Rkfg wrote:

> aplay -D hw:CARD=CA0106  --dump-hw-params /usr/share/sounds/alsa/Front_Center.wav
Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
HW Params of device "hw:CARD=CA0106":
--------------------
ACCESS:  MMAP_INTERLEAVED RW_INTERLEAVED
FORMAT:  S16_LE S32_LE
SUBFORMAT:  STD
SAMPLE_BITS: [16 32]
FRAME_BITS: [32 64]
CHANNELS: 2
RATE: [48000 192000]
PERIOD_TIME: (41 170667)
PERIOD_SIZE: [8 8192]
PERIOD_BYTES: [64 65472]
PERIODS: [2 8]
BUFFER_TIME: (83 341334)
BUFFER_SIZE: [16 16384]
BUFFER_BYTES: [64 65536]
TICK_TIME: ALL
--------------------
aplay: set_params:1239: Channels count non available

The pulseaudio log is attached to the first message. This is the debug
level, AFAIK, it's the most verbose one.

Reply at: https://bugs.launchpad.net/ubuntu/+source/alsa-
driver/+bug/1315212/comments/13

------------------------------------------------------------------------
On 2014-12-30T02:34:12+00:00 Raymond wrote:

how about

aplay -D surround40:CARD=CA0106  --dump-hw-params any.wav


aplay -D surround51:CARD=CA0106  --dump-hw-params any.wav

pulseaudio does not support SND_PCM_ACCESS_MMAP_COMPLEX and fallback to
use SND_PCM_ACCESS_RW_INTERLEAVED

this force pulseaudio to use irq polling instead of timer scheduling 
for those surround devices

http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/src/modules
/alsa-util.c?id=045c1d602dcba57868845ba3270510593c39480f

+    if (!_use_mmap)
+        _use_tsched = FALSE;
+


your log did not contain the probing of your ca0106 and those errors

alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_START failed (-77)

and

pulseaudio] (alsa-lib)setup.c: Cannot lock ctl elem


http://lists.freedesktop.org/archives/pulseaudio-
discuss/2014-November/022670.html

https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1315212

Reply at: https://bugs.launchpad.net/ubuntu/+source/alsa-
driver/+bug/1315212/comments/14

------------------------------------------------------------------------
On 2014-12-30T03:03:08+00:00 Raymond wrote:

static snd_pcm_uframes_t
snd_ca0106_pcm_pointer_playback(struct snd_pcm_substream *substream)
{
	struct snd_ca0106 *emu = snd_pcm_substream_chip(substream);
	struct snd_pcm_runtime *runtime = substream->runtime;
	struct snd_ca0106_pcm *epcm = runtime->private_data;
	unsigned int ptr, prev_ptr;
	int channel = epcm->channel_id;
	int timeout = 10;

	if (!epcm->running)
		return 0;

	prev_ptr = -1;
	do {
		ptr = snd_ca0106_ptr_read(emu, PLAYBACK_LIST_PTR, channel);
		ptr = (ptr >> 3) * runtime->period_size;
		ptr += bytes_to_frames(runtime,
			snd_ca0106_ptr_read(emu, PLAYBACK_POINTER, channel));
		if (ptr >= runtime->buffer_size)
			ptr -= runtime->buffer_size;
		if (prev_ptr == ptr)
			return ptr;
		prev_ptr = ptr;
	} while (--timeout);
	dev_warn(emu->card->dev, "ca0106: unstable DMA pointer!\n");
	return 0;
}

pointer callback return value from hardware register,

do the sound card report realtime accurate update poistion ?


http://cgit.freedesktop.org/pulseaudio/pulseaudio/plain/src/tests/alsa-time-test.c

try different fill rate

do the sound card report hw_ptr better than period size ?

Reply at: https://bugs.launchpad.net/ubuntu/+source/alsa-
driver/+bug/1315212/comments/15

------------------------------------------------------------------------
On 2014-12-30T20:04:57+00:00 Rkfg wrote:

Created attachment 111535
PA startup log

Here's the startup log.

> aplay -D surround40:CARD=CA0106  --dump-hw-params /usr/share/sounds/alsa/Front_Center.wav 
Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
HW Params of device "surround40:CARD=CA0106":
--------------------
ACCESS:  MMAP_COMPLEX RW_INTERLEAVED RW_NONINTERLEAVED
FORMAT:  S16_LE S32_LE
SUBFORMAT:  STD
SAMPLE_BITS: [16 32]
FRAME_BITS: [64 128]
CHANNELS: 4
RATE: [48000 192000]
PERIOD_TIME: (41 170667)
PERIOD_SIZE: [8 8192]
PERIOD_BYTES: [64 131072]
PERIODS: [2 8]
BUFFER_TIME: (83 341334)
BUFFER_SIZE: [16 16384]
BUFFER_BYTES: [128 262144]
TICK_TIME: ALL
--------------------
aplay: set_params:1239: Channels count non available

> aplay -D surround51:CARD=CA0106  --dump-hw-params /usr/share/sounds/alsa/Front_Center.wav 
Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
HW Params of device "surround51:CARD=CA0106":
--------------------
ACCESS:  MMAP_COMPLEX RW_INTERLEAVED RW_NONINTERLEAVED
FORMAT:  S16_LE S32_LE
SUBFORMAT:  STD
SAMPLE_BITS: [16 32]
FRAME_BITS: [96 192]
CHANNELS: 6
RATE: [48000 192000]
PERIOD_TIME: (41 170667)
PERIOD_SIZE: [8 8192]
PERIOD_BYTES: [96 196608]
PERIODS: [2 8]
BUFFER_TIME: (83 341334)
BUFFER_SIZE: [16 16384]
BUFFER_BYTES: [192 393216]
TICK_TIME: ALL
--------------------
aplay: set_params:1239: Channels count non available

Reply at: https://bugs.launchpad.net/ubuntu/+source/alsa-
driver/+bug/1315212/comments/16

------------------------------------------------------------------------
On 2014-12-30T20:06:17+00:00 Rkfg wrote:

Created attachment 111536
ALSA time test

The output of alsa-time-test.c

It ends with:
a.out: alsa-time-test.c:244: main: Assertion `(unsigned) avail <= buffer_size' failed.
zsh: abort      ./a.out > timetest.log

I think it's ok.

Reply at: https://bugs.launchpad.net/ubuntu/+source/alsa-
driver/+bug/1315212/comments/17

------------------------------------------------------------------------
On 2014-12-31T02:36:46+00:00 Raymond wrote:

(In reply to rkfg from comment #7)
> Created attachment 111536 [details]
> ALSA time test
> 
> The output of alsa-time-test.c
> 
> It ends with:
> a.out: alsa-time-test.c:244: main: Assertion `(unsigned) avail <=
> buffer_size' failed.
> zsh: abort      ./a.out > timetest.log
> 
> I think it's ok.

how did you run the program ?

the program is hardcoded to use 44100Hz , it should run continously
without any error if fillrate is equal to period size

if sound card can report hw_ptr with better grannularity, the program
can still run continously when fillrate is smaller than period size
(e.g. dma brust size )

Reply at: https://bugs.launchpad.net/ubuntu/+source/alsa-
driver/+bug/1315212/comments/18

------------------------------------------------------------------------
On 2014-12-31T03:01:56+00:00 Raymond wrote:

(In reply to rkfg from comment #6)
> Created attachment 111535 [details]
> PA startup log
> 
> Here's the startup log.


Dec 30 22:56:29 homecomp pulseaudio[1103]: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0'
Dec 30 22:56:29 homecomp pulseaudio[1103]: [pulseaudio] (alsa-lib)control.c: Invalid CTL iec958:0
Dec 30 22:56:29 homecomp pulseaudio[1103]: [pulseaudio] alsa-util.c: Unable to attach to mixer iec958:0: No such file or directory
Dec 30 22:56:29 homecomp pulseaudio[1103]: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0'
Dec 30 22:56:29 homecomp pulseaudio[1103]: [pulseaudio] (alsa-lib)setup.c: Cannot lock ctl elem
Dec 30 22:56:29 homecomp pulseaudio[1103]: [pulseaudio] (alsa-lib)setup.c: Cannot lock ctl elem
Dec 30 22:56:29 homecomp pulseaudio[1103]: [pulseaudio] (alsa-lib)setup.c: Cannot lock ctl elem
Dec 30 22:56:29 homecomp pulseaudio[1103]: [pulseaudio] (alsa-lib)setup.c: Cannot lock ctl elem
Dec 30 22:56:29 homecomp pulseaudio[1103]: [pulseaudio] (alsa-lib)setup.c: Cannot lock ctl elem
Dec 30 22:56:29 homecomp pulseaudio[1103]: [pulseaudio] alsa-util.c: snd_pcm_hw_params failed: Device or resource busy


git.alsa-project.org/?p=alsa-lib.git;a=blob_plain;f=src/conf/cards/CA0106.conf;hb=HEAD


seem related to lock in iec958 playback when pulseaudio try to open iec958 for playback and capture

need to use asym plugin if your ca0106 support both iec958 playback and
capture

Reply at: https://bugs.launchpad.net/ubuntu/+source/alsa-
driver/+bug/1315212/comments/19

------------------------------------------------------------------------
On 2014-12-31T03:04:37+00:00 Raymond wrote:

	}
	type hooks
	slave.pcm {
		type hw
		card $CARD
	}
	hooks.0 {
		type ctl_elems
		hook_args [
			{
				name "IEC958 Front Playback Volume"
				index 0
				lock true
				preserve true
				value [ 207 207 ]   # Puts 0x30303030 in the Volume register. 0xff - 0x30 = 0xcf = 207
			}
			{
				name "IEC958 Playback Switch"
				lock true
				preserve true
				value 1
			}
			{
				interface PCM
				name "IEC958 Playback Default"
				index 1
				lock true
				preserve true
				optional true
				value [ $AES0 $AES1 $AES2 $AES3 ]
			}
			{
				# for compatibility with older drivers
				name "IEC958 Playback Default"
				index 1
				lock true
				preserve true
				optional true
				value [ $AES0 $AES1 $AES2 $AES3 ]
			}
		]
	}
}

Reply at: https://bugs.launchpad.net/ubuntu/+source/alsa-
driver/+bug/1315212/comments/20

------------------------------------------------------------------------
On 2014-12-31T03:12:07+00:00 Raymond wrote:

alternative is to force pulseaudio not to open iec958 for capture


by removing all paths-input of iec958 from

http://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/modules/alsa/mixer
/profile-sets/default.conf


[Mapping iec958-stereo]
device-strings = iec958:%f
channel-map = left,right
paths-input = iec958-stereo-input
paths-output = iec958-stereo-output
priority = 5

Reply at: https://bugs.launchpad.net/ubuntu/+source/alsa-
driver/+bug/1315212/comments/21

------------------------------------------------------------------------
On 2014-12-31T03:37:52+00:00 Raymond wrote:

APLAY

**** List of PLAYBACK Hardware Devices ****
card 0: CA0106 [CA0106], device 0: ca0106 [CA0106]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: CA0106 [CA0106], device 1: ca0106 [CA0106]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: CA0106 [CA0106], device 2: ca0106 [CA0106]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: CA0106 [CA0106], device 3: ca0106 [CA0106]
  Subdevices: 1/1
  Subdevice #0: subdevice #0


ARECORD

**** List of CAPTURE Hardware Devices ****
card 0: CA0106 [CA0106], device 0: ca0106 [CA0106]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: CA0106 [CA0106], device 1: ca0106 [CA0106]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: CA0106 [CA0106], device 2: ca0106 [CA0106]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: CA0106 [CA0106], device 3: ca0106 [CA0106]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Reply at: https://bugs.launchpad.net/ubuntu/+source/alsa-
driver/+bug/1315212/comments/22


** Changed in: alsa-driver
       Status: Unknown => Confirmed

** Changed in: alsa-driver
   Importance: Unknown => Medium

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to alsa-driver in Ubuntu.
https://bugs.launchpad.net/bugs/1315212

Title:
  [CA0106 - CA0106, playback] Playback problem - Surround dies, no valid
  output

Status in ALSA driver:
  Confirmed
Status in alsa-driver package in Ubuntu:
  Incomplete

Bug description:
  This is tested against a Creative Labs Sounblaster live! (sb0410) card
  and a SoundBlaster Audigy se (sb0570). Both of them behave strangely,
  output coming through some, but not all speakers, etc. This was
  working in 13.10 under the sb0410. the ca0106 driver is the same for
  both cards.

  ProblemType: Bug
  DistroRelease: Ubuntu 14.04
  Package: alsa-base 1.0.25+dfsg-0ubuntu4
  ProcVersionSignature: Ubuntu 3.13.0-24.46-generic 3.13.9
  Uname: Linux 3.13.0-24-generic i686
  ApportVersion: 2.14.1-0ubuntu3
  Architecture: i386
  AudioDevicesInUse:
   USER        PID ACCESS COMMAND
   /dev/snd/controlC1:  joshp     30385 F.... pulseaudio
   /dev/snd/controlC0:  joshp     30385 F.... pulseaudio
  CurrentDesktop: Unity
  Date: Thu May  1 21:37:12 2014
  InstallationDate: Installed on 2014-04-28 (3 days ago)
  InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Release i386 (20140417)
  PackageArchitecture: all
  SourcePackage: alsa-driver
  Symptom: audio
  Symptom_AlsaPlaybackTest: ALSA playback test through plughw:CA0106 failed
  Symptom_Card: Built-in Audio - Intel ICH6
  Symptom_Type: None of the above
  Title: [CA0106 - CA0106, playback] Playback problem
  UpgradeStatus: No upgrade log present (probably fresh install)
  dmi.bios.date: 03/03/2006
  dmi.bios.vendor: Dell Inc.
  dmi.bios.version: A08
  dmi.board.name: 0G8310
  dmi.board.vendor: Dell Inc.
  dmi.chassis.type: 3
  dmi.chassis.vendor: Dell Inc.
  dmi.modalias: dmi:bvnDellInc.:bvrA08:bd03/03/2006:svnDellInc.:pnOptiPlexGX280:pvr:rvnDellInc.:rn0G8310:rvr:cvnDellInc.:ct3:cvr:
  dmi.product.name: OptiPlex GX280
  dmi.sys.vendor: Dell Inc.

To manage notifications about this bug go to:
https://bugs.launchpad.net/alsa-driver/+bug/1315212/+subscriptions