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

snd-dice / TC Electronic Konnekt 24D #33

Closed capoei closed 3 years ago

capoei commented 3 years ago

snd-dice never worked for my device. I guess the issue is known? the sound is crackling, and these are no x-runs. It was ok for me all those years since ffado works great for this device. now I am interested in snd-dice again whatever, since I would like to use Pipewire which doesn't suport ffado. If there is anything I can do to help debug the issue let me know

takaswie commented 3 years ago

Hi @capoei,

I'm sorry for the inconvenience. I use all of models produced by TC Electronic with ASICs of DICE series to test ALSA dice driver:

All of them are a kind of device which uses unique sampling transfer frequency and expects drivers to recover media transfer clock on incoming packet for outgoing packet. In short, the device doesn't work with fidelity sampling rate, at least on the series of packet on IEEE 1394 bus, even if configured for well-known sampling rate such as 48.0 kHz.

At present, ALSA IEC 61883-1/6 packet streaming engine is designed to use sampling transfer frequency exactly as the same as sampling rate configured by ALSA PCM applications, ignoring the media transfer clock. This can cause the kind of device to generate sound with noises.

I've been working to improve the packet streaming engine this year but not finished yet. For the work, developer needs enough knowledge about IEC 61883-1/6 packet streaming and quirks of actual devices retrieved by appropriate way without any biases. Therefore at present I don't expect any support from user unless the user have enough knowledge.

For your information, in another project to implement control service in userspace, I did reverse-engineering for the models of TC Electronic and clear the way to control them somehow. I publish Google Spreadsheet for register mapping[2] and Rust implementation in topic/dice remote branch of the repository.

Thanks

[1] https://github.com/alsa-project/snd-firewire-ctl-services/ [2] https://docs.google.com/spreadsheets/d/1hb86pABzKT8abvgVVQoObUQEAMav6bQ05jA6yVwNHaY/edit#gid=0

capoei commented 3 years ago

Hi @takaswie what a pitty. is there a updated list of win/mac-obsolete great pro devices that work flawlessly with the alsa driver?

takaswie commented 3 years ago

is there a updated list of win/mac-obsolete great pro devices that work flawlessly with the alsa driver?

The meaning of pro differs depending on context (e.g. audio listening, audio recording, audio mastering and so on). It's better to describe your needs when posting such kind of question as detal as possible, in my opinion.

capoei commented 3 years ago

is there a updated list of win/mac-obsolete great pro devices that work flawlessly with the alsa driver?

The meaning of pro differs depending on context (e.g. audio listening, audio recording, audio mastering and so on). It's better to describe your needs when posting such kind of question as detal as possible, in my opinion.

I am thinking of something like Presonus Firestudio Project or Digi 002 Rack for example. both which I saw used for cheap only to find out that their alsa drivers also have problems

takaswie commented 3 years ago

I am thinking of something like Presonus Firestudio Project or Digi 002 Rack for example. both which I saw used for cheap only to find out that their alsa drivers also have problems

Presonus Firestudio Project uses TCD2210 and support TCAT protocol extension. Digidesign Digi002 rack uses FPGA[1] to process payload of isochronous packet by own way.

Both models use different way to transfer media transfer clock, however in a point of expecting drivers to recover the media transfer clock on incoming packet for outgoing packet, they are the same.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/sound/firewire/digi00x?id=9edf723fd85822c7b7d8ef4f41a74c5a33eeca0c

capoei commented 3 years ago

well, both have problems with the driver, right?

On Nov 4 2020, at 10:39 pm, 坂本 貴史 notifications@github.com wrote:

I am thinking of something like Presonus Firestudio Project or Digi 002 Rack for example. both which I saw used for cheap only to find out that their alsa drivers also have problems Presonus Firestudio Project uses TCD2210 and support TCAT protocol extension. Digidesign Digi002 rack uses FPGA[1] to process payload of isochronous packet by own way.

Both models use different way to transfer media transfer clock, however in a point of expecting drivers to recover the media transfer clock on incoming packet for outgoing packet, they are the same. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/sound/firewire/digi00x?id=9edf723fd85822c7b7d8ef4f41a74c5a33eeca0c (https://link.getmailspring.com/link/34E11825-12F7-4F28-9010-DD2C9C899345@getmailspring.com/0?redirect=https%3A%2F%2Fgit.kernel.org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Ftorvalds%2Flinux.git%2Fcommit%2Fsound%2Ffirewire%2Fdigi00x%3Fid%3D9edf723fd85822c7b7d8ef4f41a74c5a33eeca0c&recipient=cmVwbHkrQUZMSlJPQVVHRkNSVTdERlNaWjRaVTU1VjQ0TlhFVkJOSEhDWE80WFpNQHJlcGx5LmdpdGh1Yi5jb20%3D) — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub (https://link.getmailspring.com/link/34E11825-12F7-4F28-9010-DD2C9C899345@getmailspring.com/1?redirect=https%3A%2F%2Fgithub.com%2Ftakaswie%2Fsnd-firewire-improve%2Fissues%2F33%23issuecomment-722070760&recipient=cmVwbHkrQUZMSlJPQVVHRkNSVTdERlNaWjRaVTU1VjQ0TlhFVkJOSEhDWE80WFpNQHJlcGx5LmdpdGh1Yi5jb20%3D), or unsubscribe (https://link.getmailspring.com/link/34E11825-12F7-4F28-9010-DD2C9C899345@getmailspring.com/2?redirect=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAFLJROEDSVX32ZFJKVBHQ5TSOH65XANCNFSM4TF4D2NQ&recipient=cmVwbHkrQUZMSlJPQVVHRkNSVTdERlNaWjRaVTU1VjQ0TlhFVkJOSEhDWE80WFpNQHJlcGx5LmdpdGh1Yi5jb20%3D).

takaswie commented 3 years ago

Hi @capoei ,

Just now I pushed patches to topic/media-clock-recovery remote branch (f3bdd2c269d1). Would I request your cooperation to debug the patches?

With this patchset, ALSA IEC 61883-1/6 packet streaming engine processes incoming and outgoing packets by:

  1. Transfer outgoing packet with pre-computed table rate in its beginning.
  2. Pool presentation timestamp in incoming packets after starting receiving them
  3. Then transfer outgoing packet by media clock recovered from the presentation timestamp

In a prompt test, it looks well with my TC Electronic Konnekt 24d at all of supported sampling rate (44.1/48.0/88.2/96.0/1764.0/192.0 kHz). I wish it also works well in your side.

Cheers.

capoei commented 3 years ago

Hi @capoei ,

Just now I pushed patches to topic/media-clock-recovery remote branch (f3bdd2c). Would I request your cooperation to debug the patches?

With this patchset, ALSA IEC 61883-1/6 packet streaming engine processes incoming and outgoing packets by:

  1. Transfer outgoing packet with pre-computed table rate in its beginning.
  2. Pool presentation timestamp in incoming packets after starting receiving them
  3. Then transfer outgoing packet by media clock recovered from the presentation timestamp

In a prompt test, it looks well with my TC Electronic Konnekt 24d at all of supported sampling rate (44.1/48.0/88.2/96.0/1764.0/192.0 kHz). I wish it also works well in your side.

Cheers.

Hi @takaswie surprised you are working on this, very cool. I must say that I am a long time Arch user who is used to using AUR for aything which is not in the repos. I have no clue how to install this and aply patches (lol). with that beeing said, I am very intrested in the subject and will try to get my head around it soon. I´ll let you know

alesandar commented 3 years ago

@takaswie, I decided to take a look at topic/media-clock-recovery and I can see that you've implemented some interesting stuff in sound/firewire/amdtp-stream.c, but your last commit (f3bdd2c269d189d7ff9652a919f77ee52316ef36) affects only the dice module. I am not sure if this will actually affect the corresponding modules for Motu 828mk3 and Digi 002 Rack without any further changes. I know how to use DKMS and I am willing to test your recent changes with both devices.

takaswie commented 3 years ago

Hi @alesandar,

I decided to take a look at topic/media-clock-recovery and I can see that you've implemented some interesting stuff in sound/firewire/amdtp-stream.c, but your last commit (f3bdd2c) affects only the dice module. I am not sure if this will actually affect the corresponding modules for Motu 828mk3 and Digi 002 Rack without any further changes. I know how to use DKMS and I am willing to test your recent changes with both devices.

If you have interests in the patches, I feel happy. However, they are not applied to the devices as is since the devices uses complete different mechanism for media clock recovery.

Within devices supported by drivers in ALSA firewire stack, the level of Dice devices to be complianant to IEC 61883-1/6 is the best. On the other hand, devices in MOTU firewire series uses own way. The devices use timestamp for media clock recovery, however the way is not standard defined in IEC 61883-1/6. Furthermore, devices in Digi 00x series doesn't use timestamp itself for media clock recovery.

Like this, each category of device require specific implementation for media clock recovery. This is the first step for me to integrate toward it...

takaswie commented 3 years ago

I note that patchset for the issue is posted to upstream:

takaswie commented 3 years ago

The patchset is merged to upstream. The patches are also available in master branch of the repository.

The service program to control the device is available. Please refer to below URL if you are interested:

Let me close the issue. Thanks for your cooperation.