takaswie / linux-firewire-dkms

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

snd-bebob does not recognize Behringer FCA1616 #52

Closed alesandar closed 1 year ago

alesandar commented 1 year ago

I have used an FCA1616 exclusively over USB for more than one year, but just decided to see how it will perform over FireWire, since I relied on snd-motu (with MOTU 828mk3) in the past, while using the same laptop and the same FireWire chipset.

Hardware/software details about my current setup: ```yaml laptop model: ThinkPad W530 integrated firewire controller: Ricoh Co Ltd R5C832 operating system: Arch Linux kernel version: 6.3.3.15.realtime2-1-rt ```

It looks like snd-bebob was not loaded automatically after hot-plugging the device and I am sure that it is not blacklisted. However, firewire_core successfully detected a new device and this is the only relevant system log after the hot-plug:

firewire_core 0000:02:00.3: phy config: new root=ffc1, gap_count=5

What I tried to do next was to load snd-bebob manually by running $ sudo modprobe -vv snd-bebob, which returns this:

modprobe: INFO: custom logging function 0x55de1411caf0 registered
modprobe: INFO: context 0x55de14cb53d0 released

I have collected the attribute/value pairs for some of the relevant kernel modules and here is the output for each one of them:

$ systool -vm firewire_core ```yaml Module = "firewire_core" Attributes: coresize = "106496" initsize = "0" initstate = "live" refcnt = "3" srcversion = "67F2C7904F3BB92B859573B" taint = "" uevent = Sections: .altinstr_replacement= "0xffffffffc0936c7c" .altinstructions = "0xffffffffc09371c8" .bss = "0xffffffffc093f000" .call_sites = "0xffffffffc0938864" .data = "0xffffffffc093e600" .exit.data = "0xffffffffc093ec30" .exit.text = "0xffffffffc0936c80" .gnu.linkonce.this_module= "0xffffffffc093ec40" .ibt_endbr_seal = "0xffffffffc0939430" .init.data = "0xffffffffc0949000" .init.text = "0xffffffffc0948000" .note.Linux = "0xffffffffc093d4ec" .note.gnu.build-id = "0xffffffffc093d4c8" .note.gnu.property = "0xffffffffc093d488" .orc_unwind = "0xffffffffc0939478" .orc_unwind_ip = "0xffffffffc093bae8" .parainstructions = "0xffffffffc0938518" .printk_index = "0xffffffffc093ec20" .retpoline_sites = "0xffffffffc0938538" .return_sites = "0xffffffffc09385e4" .rodata = "0xffffffffc0937200" .rodata.str1.1 = "0xffffffffc0937e54" .rodata.str1.8 = "0xffffffffc09381d8" .smp_locks = "0xffffffffc093811c" .strtab = "0xffffffffc094db58" .symtab = "0xffffffffc094a000" .text = "0xffffffffc092d000" __bug_table = "0xffffffffc093e000" __ksymtab = "0xffffffffc0937000" __ksymtab_gpl = "0xffffffffc09371a4" __ksymtab_strings = "0xffffffffc09375c0" __mcount_loc = "0xffffffffc093790c" __patchable_function_entries= "0xffffffffc093e0a8" ```
$ systool -vm firewire_ohci ```yaml Module = "firewire_ohci" Attributes: coresize = "61440" initsize = "0" initstate = "live" refcnt = "0" srcversion = "E7A9075D5DE58FF3D1F1086" taint = "" uevent = Parameters: debug = "0" quirks = "0" remote_dma = "N" Sections: .altinstr_replacement= "0xffffffffc0d5ac6c" .altinstructions = "0xffffffffc0d5b000" .bss = "0xffffffffc0d60880" .call_sites = "0xffffffffc0d5ccd4" .data.once = "0xffffffffc0d60498" .data = "0xffffffffc0d601e0" .exit.data = "0xffffffffc0d60330" .exit.text = "0xffffffffc0d5ac40" .gnu.linkonce.this_module= "0xffffffffc0d604c0" .init.data = "0xffffffffc0d66000" .init.text = "0xffffffffc0d65000" .note.Linux = "0xffffffffc0d5f134" .note.gnu.build-id = "0xffffffffc0d5f110" .note.gnu.property = "0xffffffffc0d5f0d0" .orc_unwind = "0xffffffffc0d5d288" .orc_unwind_ip = "0xffffffffc0d5e4b2" .printk_index = "0xffffffffc0d60338" .retpoline_sites = "0xffffffffc0d5cb50" .return_sites = "0xffffffffc0d5cb90" .rodata = "0xffffffffc0d5b020" .rodata.str1.1 = "0xffffffffc0d5c120" .rodata.str1.8 = "0xffffffffc0d5c698" .smp_locks = "0xffffffffc0d5ca9c" .strtab = "0xffffffffc0d691a8" .symtab = "0xffffffffc0d67000" .text = "0xffffffffc0d55000" __bug_table = "0xffffffffc0d60000" __mcount_loc = "0xffffffffc0d5bf80" __param = "0xffffffffc0d5cad8" __patchable_function_entries= "0xffffffffc0d60030" ```
$ systool -vm snd_firewire_lib ```yaml Module = "snd_firewire_lib" Attributes: coresize = "69632" initsize = "0" initstate = "live" refcnt = "1" srcversion = "2A86CB007524F713701FEFE" taint = "" uevent = Sections: .bss = "0xffffffffc1a53d40" .call_sites = "0xffffffffc1a4f452" .data = "0xffffffffc1a532e0" .exit.data = "0xffffffffc1a53870" .exit.text = "0xffffffffc1a4d2f0" .gnu.linkonce.this_module= "0xffffffffc1a53980" .init.data = "0xffffffffc1a5b000" .init.text = "0xffffffffc1a5a000" .note.Linux = "0xffffffffc1a5175c" .note.gnu.build-id = "0xffffffffc1a51738" .note.gnu.property = "0xffffffffc1a516f8" .orc_unwind = "0xffffffffc1a4f8a6" .orc_unwind_ip = "0xffffffffc1a50ad6" .printk_index = "0xffffffffc1a537f0" .ref.data = "0xffffffffc1a538c0" .retpoline_sites = "0xffffffffc1a4f2e2" .return_sites = "0xffffffffc1a4f2fa" .rodata = "0xffffffffc1a4e220" .rodata.cst2 = "0xffffffffc1a4f2de" .rodata.str1.1 = "0xffffffffc1a4ec6d" .rodata.str1.8 = "0xffffffffc1a4f0a8" .static_call.text = "0xffffffffc1a4d330" .static_call_sites = "0xffffffffc1a53968" .strtab = "0xffffffffc1a5eb50" .symtab = "0xffffffffc1a5c000" .text = "0xffffffffc1a48000" __bpf_raw_tp_map = "0xffffffffc1a53880" __bug_table = "0xffffffffc1a53000" __jump_table = "0xffffffffc1a52000" __ksymtab = "0xffffffffc1a4e000" __ksymtab_gpl = "0xffffffffc1a4e174" __ksymtab_strings = "0xffffffffc1a4e831" __mcount_loc = "0xffffffffc1a4ee6b" __patchable_function_entries= "0xffffffffc1a53070" __tracepoints_ptrs = "0xffffffffc1a4f2cc" __tracepoints_strings= "0xffffffffc1a4f2d0" __tracepoints = "0xffffffffc1a53920" _ftrace_events = "0xffffffffc1a538a0" ```
$ systool -vm snd_bebob ```yaml Module = "snd_bebob" Attributes: coresize = "65536" initsize = "0" initstate = "live" refcnt = "0" srcversion = "67917B5F2F6555E7722E386" taint = "" uevent = Parameters: enable = "Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y" id = "(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null)" index = "-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1" Sections: .bss = "0xffffffffc1a3d900" .call_sites = "0xffffffffc1a3963c" .data = "0xffffffffc1a3d300" .exit.data = "0xffffffffc1a3d500" .exit.text = "0xffffffffc1a36f30" .gnu.linkonce.this_module= "0xffffffffc1a3d540" .ibt_endbr_seal = "0xffffffffc1a39d5c" .init.data = "0xffffffffc197b000" .init.text = "0xffffffffc197a000" .note.Linux = "0xffffffffc1a3c054" .note.gnu.build-id = "0xffffffffc1a3c030" .note.gnu.property = "0xffffffffc1a3bff0" .orc_unwind = "0xffffffffc1a39dbc" .orc_unwind_ip = "0xffffffffc1a3b23e" .printk_index = "0xffffffffc1a3d460" .retpoline_sites = "0xffffffffc1a39498" .return_sites = "0xffffffffc1a394bc" .rodata = "0xffffffffc1a37000" .rodata.cst2 = "0xffffffffc1a39412" .rodata.str1.1 = "0xffffffffc1a39040" .rodata.str1.8 = "0xffffffffc1a38c08" .smp_locks = "0xffffffffc1a39414" .strtab = "0xffffffffc197ef70" .symtab = "0xffffffffc197c000" .text = "0xffffffffc1a32000" __bug_table = "0xffffffffc1a3d000" __mcount_loc = "0xffffffffc1a38940" __param = "0xffffffffc1a39420" __patchable_function_entries= "0xffffffffc1a3d010" ```

The last thing I did was to compare my current configuration ROM with yours and all I can say is that they differ from each other.

takaswie commented 1 year ago

Hi,

Thanks for your report.

The last thing I did was to compare my current configuration ROM with yours and all I can say is that they differ from each other.

The content of attached configuration ROM is for 1394 OHCI controller. When compiling and install linux-firewire-utils, you can use config-rom-pretty-printer program[1] to dump it, like:

$ cat FCA1616_config_rom.img | config-rom-pretty-printer 
               ROM header and bus information block
               -----------------------------------------------------------------
1024  04047d6a  bus_info_length 4, crc_length 4, crc 32106
1028  31333934  bus_name "1394"
1032  f000a222  irmc 1, cmc 1, isc 1, bmc 1, pmc 0, cyc_clk_acc 0,
               max_rec 10 (2048), max_rom 2, gen 2, spd 2 (S400)
1036  3c970eff  company_id 3c970e     | 
1040  eb2cf3ff  device_id 1099162252287  | EUI-64 4365974856084026367

               root directory
               -----------------------------------------------------------------
1044  00051b70  directory_length 5, crc 7024
1048  0c0083c0  node capabilities: per IEEE 1394
1052  03001f11  vendor
1056  81000003  --> descriptor leaf at 1068
1060  17023901  model
1064  81000008  --> descriptor leaf at 1096

               descriptor leaf at 1068
               -----------------------------------------------------------------
1068  00064cb7  leaf_length 6, crc 19639
1072  00000000  textual descriptor
1076  00000000  minimal ASCII
1080  4c696e75  "Linu"
1084  78204669  "x Fi"
1088  72657769  "rewi"
1092  72650000  "re"

               descriptor leaf at 1096
               -----------------------------------------------------------------
1096  0003ff1c  leaf_length 3, crc 65308
1100  00000000  textual descriptor
1104  00000000  minimal ASCII
1108  4a756a75  "Juju"

I guess that it was retrieved from /dev/fw0, while typically /dev/fw1 is added to system for any node in the bus. Would I ask you to check whether the character device is created or not?

[1] The original implementation is written in Python 2 by Clemens Ladisch's linux-firewire-utils, but I rewrite it in C language when pushing to git.kernel.org to simplify dependency so that packaging is easier in major Linux distribution.

alesandar commented 1 year ago

The content of attached configuration ROM is for 1394 OHCI controller. When compiling and install linux-firewire-utils, you can use config-rom-pretty-printer program[1] to dump it...

Nice tip, thank you.

I guess that it was retrieved from /dev/fw0, while typically /dev/fw1 is added to system for any node in the bus. Would I ask you to check whether the character device is created or not?

That's right, the ROM was retrieved from /dev/fw0, because /dev/fw1 was not present at all.

takaswie commented 1 year ago

/dev/fw1 was not present at all.

It means that the node on your device does not appears in IEEE 1394 bus yet.

As long as I know, the combination of DIGITAL SELECT button and powering switches bus mode between USB 2.0 and IEEE 1394. Let you manage to switch the mode before inserting IEEE 1394 plug.

Regards

alesandar commented 1 year ago

As long as I know, the combination of DIGITAL SELECT button and powering switches bus mode between USB 2.0 and IEEE 1394. Let you manage to switch the mode before inserting IEEE 1394 plug.

Wow, it worked. Quite unbelievable why Behringer chose a similar procedure for a device that lacks a physical power button.

Here is what I did:

Note that it was not necessary to remove the FireWire cable.

I will open a new issue if something weird happens while I am testing the performance of the interface with your driver. Thanks you for your assistance.

Regards

takaswie commented 1 year ago

Wow, it worked.

Sounds good.

Quite unbelievable why Behringer chose a similar procedure for a device that lacks a physical power button.

Aha. I suggested based on my FCA610, while FCA1616 has no physical power button.

I will open a new issue if something weird happens while I am testing the performance of the interface with your driver.

In my TODO list, FCA1616 does not have protocol implementation in snd-firewire-ctl-service yet. I guess that the unit can switch source signal for sampling clock, while it is not so urgent.

I'm pleased if you retrieve some logs when I prepare for it.

Thanks

alesandar commented 1 year ago

In my TODO list, FCA1616 does not have protocol implementation in snd-firewire-ctl-service yet. I guess that the unit can switch source signal for sampling clock, while it is not so urgent.

Yes, the digital clock parameter is exposed by ALSA (if connected over USB). I think it was the only "writable" parameter.

I'm pleased if you retrieve some logs when I prepare for it.

It might be nice if you create a new issue in snd-firewire-ctl-services and tag me (whenever you are ready). I find your work more than valuable and will be really happy to help out.