takaswie / linux-firewire-dkms

Currently this repository is maintained for Linux firewire subsystem and unit drivers.
http://ieee1394.docs.kernel.org/
39 stars 8 forks source link

No playback with Terratec Phase 88 #7

Closed muranyia closed 9 years ago

muranyia commented 9 years ago
aplay -vv -Dplughw:0,0 test.wav 
aplay: main:722: audio open error: Function not implemented
cat /proc/asound/card0/firewire/firmware 
Manufacturer:   bridgeCo
Protocol Ver:   1
Build Ver:  0
GUID:       0x000AAC0300592827
Model ID:   0x03
Model Rev:  1
Firmware Date:  20051215
Firmware Time:  163713
Firmware ID:    0x3
Firmware Ver:   17960223
Base Addr:  0x20080000
Max Size:   1572864
Loader Date:    20040719
Loader Time:    134046
cat /proc/asound/card0/firewire/clock 
Sampling rate: 48000
cat /proc/asound/card0/firewire/formation 
Output Stream from device:
    Rate    PCM MIDI
    32000   10  1
    44100   10  1
    48000   10  1
    88200   10  1
    96000   10  1
    176400  0   0
    192000  0   0
Input Stream to device:
    Rate    PCM MIDI
    32000   10  1
    44100   10  1
    48000   10  1
    88200   10  1
    96000   10  1
    176400  0   0
    192000  0   0
uname -r
3.13.0-36-generic
takaswie commented 9 years ago

Fix released. Thanks for your report. If possible, would you give me some feedback about this fix?

bebob: Fix failure to detect source of clock for Terratec Phase 88 https://github.com/takaswie/snd-firewire-improve/commit/a16d728fe70199b4913bfb7d336fb0e291387151

muranyia commented 9 years ago

Thank You Takashi, I have just tested the new version, and it was playing (although no sound, but my Phase 88 is new and I never managed to get sound yet). When stopping aplay with CTRL-C, then starting again, however, it does not play any more. I wonder if this is normal.

$ aplay -vv -Dplughw:0,0 test.wav 
Playing WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
Plug PCM: Route conversion PCM (sformat=S16_LE)
  Transformation table:
    0 <- 0
    1 <- 1
    2 <- none
    3 <- none
    4 <- none
    5 <- none
    6 <- none
    7 <- none
    8 <- none
    9 <- none
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 2
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 16
  buffer_size  : 8192
  period_size  : 2048
  period_time  : 46439
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 2048
  period_event : 0
  start_threshold  : 8192
  stop_threshold   : 8192
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
Slave: Hardware PCM card 0 'PHASE 88 Rack FW' device 0 subdevice 0
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 10
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 16
  buffer_size  : 8192
  period_size  : 2048
  period_time  : 46439
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 2048
  period_event : 0
  start_threshold  : 8192
  stop_threshold   : 8192
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
  appl_ptr     : 0
  hw_ptr       : 0
################                                  +| 98%^C
Aborted by signal Interrupt...
aplay: pcm_write:1939: write error: Interrupted system call
$ aplay -vv -Dplughw:0,0 test.wav 
Playing WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
Plug PCM: Route conversion PCM (sformat=S16_LE)
  Transformation table:
    0 <- 0
    1 <- 1
    2 <- none
    3 <- none
    4 <- none
    5 <- none
    6 <- none
    7 <- none
    8 <- none
    9 <- none
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 2
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 16
  buffer_size  : 8192
  period_size  : 2048
  period_time  : 46439
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 2048
  period_event : 0
  start_threshold  : 8192
  stop_threshold   : 8192
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
Slave: Hardware PCM card 0 'PHASE 88 Rack FW' device 0 subdevice 0
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 10
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 16
  buffer_size  : 8192
  period_size  : 2048
  period_time  : 46439
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 2048
  period_event : 0
  start_threshold  : 8192
  stop_threshold   : 8192
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
  appl_ptr     : 0
  hw_ptr       : 0
#+                                                 | 00%
muranyia commented 9 years ago

I have found the problem:

$ cat /proc/asound/card0/firewire/clock 
Sampling rate: 44100
Clock Source: Digital In

Setting the clock source to Internal makes to problem go away.

takaswie commented 9 years ago

Setting the clock source to Internal makes to problem go away.

When the source of clock is not internal (in your case 'Digital In' or 'Word Clock'), an available sampling rate is fixed to the sampling rate at which the device is set.

In this case, I think you try to playback 44.1kHz samples. But your device has 'Digital In' as source of clock and 44.1kHz as sampling rate. Then ALSA BeBoB driver won't change sampling rate and ALSA applications fails to playback.

takaswie commented 9 years ago

Now I have a plan to post a patch to ALSA upstream to fix this issue (failure of detection for clock source).

As a custom, we, Linux kernel developers use or tag in patches, to show thanks to reporter or tester. https://www.kernel.org/doc/Documentation/SubmittingPatches

If you don't mind, I'd like to add your name and e-mail address to the patch. Would you please send your name and e-mail address to my e-mail address? You can see my e-mail address in README.

Regards