Discussion:
[Alsa-user] snd-firewire-digi00x random popping/clicking with Digi002
Chuck Ritola
2017-05-23 10:07:18 UTC
Permalink
Hi list

I'm getting popping/clicking (missed samples) when playing back through my
Digi002r using snd-firewire-digi00x and am looking for help in addressing
the issue or confirming it as a bug. I have not yet found a linux machine
where my Digi002r works without these anomalies. Other sound devices on
these systems work fine when activated. Details below:

Occurs when using test tone in audacity and music from paplay, aplay, etc.

Does not occur during silence, even if playing back silence. (suspect
missed samples)

Occurrence is irregular, not on any persistent interval. Also occurs on
S/PDIF. Capturing the output of a 1khz sawtooth via S/PDIF, linked below is
a closeup image of the gap in ProTools:

http://imgur.com/a/HDRrE

Tested the hardware on Pro Tools LE system, works fine there.

Ubuntu 16.04
Digi002 Rack, Firewire
Intel motherboard / i5
CPU load less than 5%.
VIA-chipset FireWire Card, PCIe 1x
Moved FW card to other slots, issue persists
Originally with kernel 4.4
Switch to 4.11-low-latency, issue persists
Bypass Pulseaudio - direct to ALSA - issue persists
Disabled or removed all other sound devices - issue persists
Attempted with another 16.04 system with Gigabyte motherboard / builtin
1394 Phenom II - issue persists
Switched to 88.2, 24bit little endian - issue persists

$ sudo dmidecode -t 2
# dmidecode 3.0
Getting SMBIOS data from sysfs.
SMBIOS 2.8 present.

Handle 0x0002, DMI type 2, 15 bytes
Base Board Information
Manufacturer: Intel Corporation
Product Name: DH87MC
Version: AAG74242-402
Features:
Board is a hosting board
Board is replaceable
Chassis Handle: 0x0003
Type: Motherboard
Contained Object Handles: 0

/var/log/syslog:
pulseaudio[2484]: [alsa-source-Digi00x] alsa-source.c: ALSA woke us up to
read new data from the device, but there was actually nothing to read.
pulseaudio[2484]: [alsa-source-Digi00x] alsa-source.c: Most likely this is
a bug in the ALSA driver 'snd_fired_firewire_digi00x'. Please report this
issue to the ALSA developers.
pulseaudio[2484]: [alsa-source-Digi00x] alsa-source.c: We were woken up
with POLLIN set -- however a subsequent snd_pcm_avail() returned 0 or
another value < min_avail.

...however the pops/clicks persist long after these messages with no new
messages coinciding with them.

/etc/pulse/daemon.conf changes (issue persists through all)
realtime-scheduling = yes
default-fragments / default-fragment-size = various values, no change
between them.

This is the original machine in question:
$ uname -a
Linux xxxx 4.11.0-041100-lowlatency #201705041534 SMP PREEMPT Thu May 4
19:41:32 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

This is the second machine on which I tested Digi002:
$ uname -a
Linux xxxx 4.4.0-78-generic #99-Ubuntu SMP Thu Apr 27 15:29:09 UTC 2017
x86_64 x86_64 x86_64 GNU/Linux

Here is info about my Digi002:
$ grep . /sys/bus/firewire/devices/fw*/*
Binary file /sys/bus/firewire/devices/fw0/config_rom matches
/sys/bus/firewire/devices/fw0/dev:245:0
/sys/bus/firewire/devices/fw0/guid:0x001106660000010a
/sys/bus/firewire/devices/fw0/is_local:1
/sys/bus/firewire/devices/fw0/model:0x023901
/sys/bus/firewire/devices/fw0/model_name:Juju
grep: /sys/bus/firewire/devices/fw0/power: Is a directory
grep: /sys/bus/firewire/devices/fw0/subsystem: Is a directory
/sys/bus/firewire/devices/fw0/uevent:MAJOR=245
/sys/bus/firewire/devices/fw0/uevent:MINOR=0
/sys/bus/firewire/devices/fw0/uevent:DEVNAME=fw0
/sys/bus/firewire/devices/fw0/vendor:0x001f11
/sys/bus/firewire/devices/fw0/vendor_name:Linux Firewire
grep: /sys/bus/firewire/devices/fw1.0/driver: Is a directory
/sys/bus/firewire/devices/fw1.0/modalias:ieee1394:
ven0000A07Emo00000002sp000000A4ver00000001
/sys/bus/firewire/devices/fw1.0/model:0x000002
/sys/bus/firewire/devices/fw1.0/model_name:Digi 002Rack
grep: /sys/bus/firewire/devices/fw1.0/power: Is a directory
/sys/bus/firewire/devices/fw1.0/rom_index:11
grep: /sys/bus/firewire/devices/fw1.0/sound: Is a directory
/sys/bus/firewire/devices/fw1.0/specifier_id:0x0000a4
grep: /sys/bus/firewire/devices/fw1.0/subsystem: Is a directory
/sys/bus/firewire/devices/fw1.0/uevent:DRIVER=snd-firewire-digi00x
/sys/bus/firewire/devices/fw1.0/uevent:MODALIAS=ieee1394:
ven0000A07Emo00000002sp000000A4ver00000001
/sys/bus/firewire/devices/fw1.0/version:0x000001
Binary file /sys/bus/firewire/devices/fw1/config_rom matches
/sys/bus/firewire/devices/fw1/dev:245:1
grep: /sys/bus/firewire/devices/fw1/fw1.0: Is a directory
/sys/bus/firewire/devices/fw1/guid:0x00a07e0000a40000
/sys/bus/firewire/devices/fw1/hardware_version:0x000001
/sys/bus/firewire/devices/fw1/is_local:0
grep: /sys/bus/firewire/devices/fw1/power: Is a directory
grep: /sys/bus/firewire/devices/fw1/subsystem: Is a directory
/sys/bus/firewire/devices/fw1/uevent:MAJOR=245
/sys/bus/firewire/devices/fw1/uevent:MINOR=1
/sys/bus/firewire/devices/fw1/uevent:DEVNAME=fw1
/sys/bus/firewire/devices/fw1/units:0x0000a4:0x000001
/sys/bus/firewire/devices/fw1/vendor:0x00a07e

My firewire card on the original machine:
04:00.0 FireWire (IEEE 1394): VIA Technologies, Inc. VT6315 Series Firewire
Controller (rev 01) (prog-if 10 [OHCI])
Subsystem: VIA Technologies, Inc. VT6315 Series Firewire Controller
Flags: bus master, fast devsel, latency 0, IRQ 19
Memory at f7d00000 (64-bit, non-prefetchable) [size=2K]
I/O ports at d000 [size=256]
Capabilities: [50] Power Management version 3
Capabilities: [80] MSI: Enable- Count=1/1 Maskable+ 64bit+
Capabilities: [98] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [130] Device Serial Number 00-11-06-ff-ff-00-01-0a
Kernel driver in use: firewire_ohci
Kernel modules: firewire_ohci

$ dmesg | grep firewire
[ 1.121108] firewire_ohci 0000:04:00.0: added OHCI v1.10 device as card
0, 4 IR + 8 IT contexts, quirks 0x10
[ 1.625229] firewire_core 0000:04:00.0: created device fw0: GUID
001106660000010a, S400
[ 1.625234] firewire_core 0000:04:00.0: phy config: new root=ffc1,
gap_count=5
[ 4.642950] firewire_core 0000:04:00.0: created device fw1: GUID
00a07e0000a40000, S400

... I'm running low on ideas. What to do?
Takashi Sakamoto
2017-05-24 13:22:38 UTC
Permalink
Hi,

I'm an author of ALSA digi00x driver.
Post by Chuck Ritola
I'm getting popping/clicking (missed samples) when playing back through my
Digi002r using snd-firewire-digi00x and am looking for help in addressing
the issue or confirming it as a bug. I have not yet found a linux machine
where my Digi002r works without these anomalies. Other sound devices on
Occurs when using test tone in audacity and music from paplay, aplay, etc.
Does not occur during silence, even if playing back silence. (suspect
missed samples)
Occurrence is irregular, not on any persistent interval. Also occurs on
S/PDIF. Capturing the output of a 1khz sawtooth via S/PDIF, linked below is
http://imgur.com/a/HDRrE
Yes. The driver brings periodical noise to supported devices, as I
reported[1]. I remember an author for initial version (Damien Zammit)
reported this issue, thus this issue has been known and not resolved for
a long time (since 2013).

Unfortunately, mechanism to generate the noise is not cleared yet.
However, I know that this is often observed but there's a case not to
observe this.

For your information, I note that devices transfer notification when
brings the noise. You can see the notification with my tool.

I wrote a tool. 'hinawa-dg00x-cui', in 'hinawa-utils' package[2]. I note
that this tool is an application of 'libhinawa'[3] with GObject
Introspection and PyGObject. When running below command, you can see
notifications during playback.

$ ./hinawa-dg00x-cui 1 listen-message
00007052
00007050
00007052
00007050
...

or
00007051
00007051
...

Meaning of the content is not cleared. But when hearing noise, we can
see the new lines as notification.

(In the command line, '1' means numerical ID as sound card. I note that
you need to care of your access permission to firewire character device.
In typical case, it's /dev/fw1.)

As I stated, there's a case of playback not to observe this issue. I've
already got packet dumps in the case and continue to analyze it. I wish
to resolve this issue soon, but there's no guarantee. This is a kind of
work based on reverse engineering.
Post by Chuck Ritola
Tested the hardware on Pro Tools LE system, works fine there.
Ubuntu 16.04
Digi002 Rack, Firewire
Intel motherboard / i5
CPU load less than 5%.
VIA-chipset FireWire Card, PCIe 1x
Moved FW card to other slots, issue persists
Originally with kernel 4.4
Switch to 4.11-low-latency, issue persists
Bypass Pulseaudio - direct to ALSA - issue persists
Disabled or removed all other sound devices - issue persists
Attempted with another 16.04 system with Gigabyte motherboard / builtin
1394 Phenom II - issue persists
Switched to 88.2, 24bit little endian - issue persists
$ sudo dmidecode -t 2
# dmidecode 3.0
Getting SMBIOS data from sysfs.
SMBIOS 2.8 present.
Handle 0x0002, DMI type 2, 15 bytes
Base Board Information
Manufacturer: Intel Corporation
Product Name: DH87MC
Version: AAG74242-402
Board is a hosting board
Board is replaceable
Chassis Handle: 0x0003
Type: Motherboard
Contained Object Handles: 0
pulseaudio[2484]: [alsa-source-Digi00x] alsa-source.c: ALSA woke us up to
read new data from the device, but there was actually nothing to read.
pulseaudio[2484]: [alsa-source-Digi00x] alsa-source.c: Most likely this is
a bug in the ALSA driver 'snd_fired_firewire_digi00x'. Please report this
issue to the ALSA developers.
pulseaudio[2484]: [alsa-source-Digi00x] alsa-source.c: We were woken up
with POLLIN set -- however a subsequent snd_pcm_avail() returned 0 or
another value < min_avail.
...however the pops/clicks persist long after these messages with no new
messages coinciding with them.
/etc/pulse/daemon.conf changes (issue persists through all)
realtime-scheduling = yes
default-fragments / default-fragment-size = various values, no change
between them.
$ uname -a
Linux xxxx 4.11.0-041100-lowlatency #201705041534 SMP PREEMPT Thu May 4
19:41:32 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
$ uname -a
Linux xxxx 4.4.0-78-generic #99-Ubuntu SMP Thu Apr 27 15:29:09 UTC 2017
x86_64 x86_64 x86_64 GNU/Linux
$ grep . /sys/bus/firewire/devices/fw*/*
Binary file /sys/bus/firewire/devices/fw0/config_rom matches
/sys/bus/firewire/devices/fw0/dev:245:0
/sys/bus/firewire/devices/fw0/guid:0x001106660000010a
/sys/bus/firewire/devices/fw0/is_local:1
/sys/bus/firewire/devices/fw0/model:0x023901
/sys/bus/firewire/devices/fw0/model_name:Juju
grep: /sys/bus/firewire/devices/fw0/power: Is a directory
grep: /sys/bus/firewire/devices/fw0/subsystem: Is a directory
/sys/bus/firewire/devices/fw0/uevent:MAJOR=245
/sys/bus/firewire/devices/fw0/uevent:MINOR=0
/sys/bus/firewire/devices/fw0/uevent:DEVNAME=fw0
/sys/bus/firewire/devices/fw0/vendor:0x001f11
/sys/bus/firewire/devices/fw0/vendor_name:Linux Firewire
grep: /sys/bus/firewire/devices/fw1.0/driver: Is a directory
ven0000A07Emo00000002sp000000A4ver00000001
/sys/bus/firewire/devices/fw1.0/model:0x000002
/sys/bus/firewire/devices/fw1.0/model_name:Digi 002Rack
grep: /sys/bus/firewire/devices/fw1.0/power: Is a directory
/sys/bus/firewire/devices/fw1.0/rom_index:11
grep: /sys/bus/firewire/devices/fw1.0/sound: Is a directory
/sys/bus/firewire/devices/fw1.0/specifier_id:0x0000a4
grep: /sys/bus/firewire/devices/fw1.0/subsystem: Is a directory
/sys/bus/firewire/devices/fw1.0/uevent:DRIVER=snd-firewire-digi00x
ven0000A07Emo00000002sp000000A4ver00000001
/sys/bus/firewire/devices/fw1.0/version:0x000001
Binary file /sys/bus/firewire/devices/fw1/config_rom matches
/sys/bus/firewire/devices/fw1/dev:245:1
grep: /sys/bus/firewire/devices/fw1/fw1.0: Is a directory
/sys/bus/firewire/devices/fw1/guid:0x00a07e0000a40000
/sys/bus/firewire/devices/fw1/hardware_version:0x000001
/sys/bus/firewire/devices/fw1/is_local:0
grep: /sys/bus/firewire/devices/fw1/power: Is a directory
grep: /sys/bus/firewire/devices/fw1/subsystem: Is a directory
/sys/bus/firewire/devices/fw1/uevent:MAJOR=245
/sys/bus/firewire/devices/fw1/uevent:MINOR=1
/sys/bus/firewire/devices/fw1/uevent:DEVNAME=fw1
/sys/bus/firewire/devices/fw1/units:0x0000a4:0x000001
/sys/bus/firewire/devices/fw1/vendor:0x00a07e
04:00.0 FireWire (IEEE 1394): VIA Technologies, Inc. VT6315 Series Firewire
Controller (rev 01) (prog-if 10 [OHCI])
Subsystem: VIA Technologies, Inc. VT6315 Series Firewire Controller
Flags: bus master, fast devsel, latency 0, IRQ 19
Memory at f7d00000 (64-bit, non-prefetchable) [size=2K]
I/O ports at d000 [size=256]
Capabilities: [50] Power Management version 3
Capabilities: [80] MSI: Enable- Count=1/1 Maskable+ 64bit+
Capabilities: [98] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [130] Device Serial Number 00-11-06-ff-ff-00-01-0a
Kernel driver in use: firewire_ohci
Kernel modules: firewire_ohci
$ dmesg | grep firewire
[ 1.121108] firewire_ohci 0000:04:00.0: added OHCI v1.10 device as card
0, 4 IR + 8 IT contexts, quirks 0x10
[ 1.625229] firewire_core 0000:04:00.0: created device fw0: GUID
001106660000010a, S400
[ 1.625234] firewire_core 0000:04:00.0: phy config: new root=ffc1,
gap_count=5
[ 4.642950] firewire_core 0000:04:00.0: created device fw1: GUID
00a07e0000a40000, S400
... I'm running low on ideas. What to do?
[1] [alsa-devel] Status of ALSA firewire stack at Linux v4.12
development period
http://mailman.alsa-project.org/pipermail/alsa-devel/2017-April/120061.html
[2] https://github.com/takaswie/hinawa-utils
[3] https://github.com/takaswie/libhinawa

Regards

Takashi Sakamoto

Loading...