compile alsa driver for Xen kernel - Suse

This is a discussion on compile alsa driver for Xen kernel - Suse ; I have opensuse with xen installed. The asus xonar sound card didn't work with the alsa version provided with opensuse. I downloaded the last alsa version and was able to compile and install it on the pae kernel (32 bits). ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: compile alsa driver for Xen kernel

  1. compile alsa driver for Xen kernel

    I have opensuse with xen installed. The asus xonar sound card didn't work
    with the alsa version provided with opensuse. I downloaded the last alsa
    version and was able to compile and install it on the pae kernel (32 bits).
    ok==> sound card configured with alsaconf and working

    But with the xen kernel I'm unable to compile it.
    this is what I did
    a)copy xen kernel template from /usr/src/arch/i386/defconfig.xen
    to /usr/src/.config
    b) in usr/src/linux run make oldconfig && make scripts && make prepare
    c) in alsa source ./configure OK
    d) in alsa source .make ==> error 2
    see error messages below

    Any idea?

    Many thanks in advance


    make output
    make -C /lib/modules/2.6.25.11-0.1-xen/source
    SUBDIRS=/local/alsa-driver-1.0.18rc1/alsa-driver-1.0.18rc1
    O=/lib/modules/2.6.25.11-0.1-xen/build CPP="gcc -E" CC="gcc" modules
    make[1]: Entering directory `/usr/src/linux-2.6.25.11-0.1'
    CC [M] /local/alsa-driver-1.0.18rc1/alsa-driver-1.0.18rc1/acore/hwdep.o
    In file included
    from /local/alsa-driver-1.0.18rc1/alsa-driver-1.0.18rc1/acore/hwdep.c:1:
    /local/alsa-driver-1.0.18rc1/alsa-driver-1.0.18rc1/include/adriver.h:278:1:
    warning: "GFP_DMA32" redefined
    In file included from /usr/src/linux-2.6.25.11-0.1/include/linux/slab.h:14,
    from /usr/src/linux-2.6.25.11-0.1/include/linux/percpu.h:5,
    from include2/asm/local.h:4,

    from /usr/src/linux-2.6.25.11-0.1/include/linux/module.h:19,

    from /local/alsa-driver-1.0.18rc1/alsa-driver-1.0.18rc1/include/adriver.h:26,

    from /local/alsa-driver-1.0.18rc1/alsa-driver-1.0.18rc1/acore/hwdep.c:1:
    /usr/src/linux-2.6.25.11-0.1/include/linux/gfp.h:105:1: warning: this is the
    location of the previous definition
    In file included
    from /local/alsa-driver-1.0.18rc1/alsa-driver-1.0.18rc1/include/adriver.h:944,

    from /local/alsa-driver-1.0.18rc1/alsa-driver-1.0.18rc1/acore/hwdep.c:1:
    /usr/src/linux-2.6.25.11-0.1/include/linux/pci.h:594: error: expected
    identifier or ‘(’ before numeric constant
    In file included from include2/asm/mach-xen/asm/pci.h:4,
    from /usr/src/linux-2.6.25.11-0.1/include/linux/pci.h:948,

    from /local/alsa-driver-1.0.18rc1/alsa-driver-1.0.18rc1/include/adriver.h:944,

    from /local/alsa-driver-1.0.18rc1/alsa-driver-1.0.18rc1/acore/hwdep.c:1:
    /usr/src/linux-2.6.25.11-0.1/include/linux/mm.h:244: error: conflicting
    types for ‘snd_compat_vmalloc_to_page’
    /local/alsa-driver-1.0.18rc1/alsa-driver-1.0.18rc1/include/adriver.h:748:
    error: previous declaration of ‘snd_compat_vmalloc_to_page’ was here
    In file included
    from /local/alsa-driver-1.0.18rc1/alsa-driver-1.0.18rc1/acore/hwdep.c:1:
    /local/alsa-driver-1.0.18rc1/alsa-driver-1.0.18rc1/include/adriver.h: In
    function ‘snd_pci_orig_save_state’:
    /local/alsa-driver-1.0.18rc1/alsa-driver-1.0.18rc1/include/adriver.h:1186:
    error: too many arguments to function ‘pci_save_state’
    /local/alsa-driver-1.0.18rc1/alsa-driver-1.0.18rc1/include/adriver.h: In
    function ‘snd_pci_orig_restore_state’:
    /local/alsa-driver-1.0.18rc1/alsa-driver-1.0.18rc1/include/adriver.h:1190:
    error: too many arguments to function ‘pci_restore_state’
    In file included
    from /local/alsa-driver-1.0.18rc1/alsa-driver-1.0.18rc1/acore/hwdep.c:1:
    /local/alsa-driver-1.0.18rc1/alsa-driver-1.0.18rc1/include/adriver.h:1552:1:
    warning: "page_to_pfn" redefined
    In file included from include2/asm/mach-xen/asm/page.h:225,
    from include2/asm/mach-xen/asm/hypervisor.h:47,
    from include2/asm/mach-xen/asm/system.h:9,
    from include2/asm/mach-xen/asm/processor.h:21,

    from /usr/src/linux-2.6.25.11-0.1/include/linux/prefetch.h:14,
    from /usr/src/linux-2.6.25.11-0.1/include/linux/list.h:8,
    from /usr/src/linux-2.6.25.11-0.1/include/linux/module.h:9,

    from /local/alsa-driver-1.0.18rc1/alsa-driver-1.0.18rc1/include/adriver.h:26,

    from /local/alsa-driver-1.0.18rc1/alsa-driver-1.0.18rc1/acore/hwdep.c:1:
    /usr/src/linux-2.6.25.11-0.1/include/asm-generic/memory_model.h:79:1:
    warning: this is the location of the previous definition
    make[4]: ***
    [/local/alsa-driver-1.0.18rc1/alsa-driver-1.0.18rc1/acore/hwdep.o] Error 1
    make[3]: *** [/local/alsa-driver-1.0.18rc1/alsa-driver-1.0.18rc1/acore]
    Error 2
    make[2]: *** [_module_/local/alsa-driver-1.0.18rc1/alsa-driver-1.0.18rc1]
    Error 2
    make[1]: *** [sub-make] Error 2

  2. Re: compile alsa driver for Xen kernel

    pconde wrote:
    > I have opensuse with xen installed. The asus xonar sound card didn't work
    > with the alsa version provided with opensuse. I downloaded the last alsa
    > version and was able to compile and install it on the pae kernel (32 bits).
    > ok==> sound card configured with alsaconf and working
    >
    > But with the xen kernel I'm unable to compile it.
    > this is what I did
    > a)copy xen kernel template from /usr/src/arch/i386/defconfig.xen
    > to /usr/src/.config
    > b) in usr/src/linux run make oldconfig && make scripts && make prepare
    > c) in alsa source ./configure OK
    > d) in alsa source .make ==> error 2
    > ...
    > /local/alsa-driver-1.0.18rc1/alsa-driver-1.0.18rc1/include/adriver.h:278:1: warning: "GFP_DMA32" redefined
    > ...


    These errors indicate that ALSA's configure script did not use the
    correct kernel source. (Search for "directory with kernel source" and
    "directory with kernel build" in config.log.)

    By default, it tries to use the source of the kernel version that is
    currently running. To use another source directory, specify the
    --with-kernel and/or --with-build options.


    HTH
    Clemens

  3. Re: compile alsa driver for Xen kernel

    Clemens Ladisch wrote:

    > These errors indicate that ALSA's configure script did not use the
    > correct kernel source. *(Search for "directory with kernel source" and
    > "directory with kernel build" in config.log.)


    Hi,

    Thanks for your answer,

    I checked this in config.log but all seems correct the kernel described is
    the xen kernel:
    "
    configure:4677: checking for directory with kernel source
    configure:4698: result: /lib/modules/2.6.25.16-0.1-xen/source
    configure:4701: checking for directory with kernel build
    configure:4713: result: /lib/modules/2.6.25.16-0.1-xen/build
    "
    and I'm running at this moment the xen kernel.

    The errors is the same if I try to compile sound module for xen on a 32 bit
    or 64 bit kernel but I don't have enough knowledge in make to resolve this
    the error.

    I think that this have to do how opensuse build the xen kernel at top of the
    non xen kernel

    Many thanks in advance
    Philippe















  4. Re: compile alsa driver for Xen kernel

    pconde wrote:
    > Clemens Ladisch wrote:
    > > These errors indicate that ALSA's configure script did not use the
    > > correct kernel source. (Search for "directory with kernel source" and
    > > "directory with kernel build" in config.log.)

    >
    > I checked this in config.log but all seems correct the kernel described is
    > the xen kernel:
    > "
    > configure:4677: checking for directory with kernel source
    > configure:4698: result: /lib/modules/2.6.25.16-0.1-xen/source
    > configure:4701: checking for directory with kernel build
    > configure:4713: result: /lib/modules/2.6.25.16-0.1-xen/build


    But somehow configure's checks do not work with this kernel. Please
    show the entire config.log.


    Regards,
    Clemens

  5. Re: compile alsa driver for Xen kernel

    Clemens Ladisch wrote:

    > pconde wrote:
    >> Clemens Ladisch wrote:
    >> > These errors indicate that ALSA's configure script did not use the
    >> > correct kernel source. (Search for "directory with kernel source" and
    >> > "directory with kernel build" in config.log.)

    >>
    >> I checked this in config.log but all seems correct the kernel described
    >> is the xen kernel:
    >> "
    >> configure:4677: checking for directory with kernel source
    >> configure:4698: result: /lib/modules/2.6.25.16-0.1-xen/source
    >> configure:4701: checking for directory with kernel build
    >> configure:4713: result: /lib/modules/2.6.25.16-0.1-xen/build

    >
    > But somehow configure's checks do not work with this kernel. Please
    > show the entire config.log.
    >
    >
    > Regards,
    > Clemens

    Hi Clemens

    Thanks for your answer . But the config.log has 3455 lines :-(

    A bit long for cut and paste. I'll send it via e-mail

    Regards
    Philippe



  6. Re: compile alsa driver for Xen kernel

    pconde wrote:
    > Clemens Ladisch wrote:
    > > But somehow configure's checks do not work with this kernel. Please
    > > show the entire config.log.

    >
    > [...]
    > configure:9982: checking for pci_set_consistent_dma_mask
    > configure:10021: gcc -c ... conftest.c >&5
    > In file included from /lib/modules/2.6.25.16-0.1-xen/build/include2/asm/smp.h:4,
    > from /lib/modules/2.6.25.16-0.1-xen/source/include/linux/smp.h:19,
    > from /lib/modules/2.6.25.16-0.1-xen/source/include/linux/topology.h:33,
    > from /lib/modules/2.6.25.16-0.1-xen/source/include/linux/mmzone.h:691,
    > from /lib/modules/2.6.25.16-0.1-xen/source/include/linux/gfp.h:4,
    > from /lib/modules/2.6.25.16-0.1-xen/source/include/linux/slab.h:14,
    > from /lib/modules/2.6.25.16-0.1-xen/source/include/linux/percpu.h:5,
    > from /lib/modules/2.6.25.16-0.1-xen/build/include2/asm/local.h:4,
    > from /lib/modules/2.6.25.16-0.1-xen/source/include/linux/module.h:19,
    > from /lib/modules/2.6.25.16-0.1-xen/source/include/linux/device.h:21,
    > from /lib/modules/2.6.25.16-0.1-xen/source/include/linux/pci.h:52,
    > from conftest.c:31:
    > /lib/modules/2.6.25.16-0.1-xen/build/include2/asm/smp_64.h: In function 'logical_smp_processor_id':
    > /lib/modules/2.6.25.16-0.1-xen/build/include2/asm/smp_64.h:91: warning: implicit declaration of function 'GET_APIC_LOGICAL_ID'
    > /lib/modules/2.6.25.16-0.1-xen/build/include2/asm/smp_64.h:91: error: 'APIC_BASE' undeclared (first use in this function)
    > /lib/modules/2.6.25.16-0.1-xen/build/include2/asm/smp_64.h:91: error: (Each undeclared identifier is reported only once
    > /lib/modules/2.6.25.16-0.1-xen/build/include2/asm/smp_64.h:91: error: for each function it appears in.)
    > /lib/modules/2.6.25.16-0.1-xen/build/include2/asm/smp_64.h:91: error: 'APIC_LDR' undeclared (first use in this function)
    > /lib/modules/2.6.25.16-0.1-xen/build/include2/asm/smp_64.h: In function 'hard_smp_processor_id':
    > /lib/modules/2.6.25.16-0.1-xen/build/include2/asm/smp_64.h:97: warning: implicit declaration of function 'GET_APIC_ID'
    > /lib/modules/2.6.25.16-0.1-xen/build/include2/asm/smp_64.h:97: error: 'APIC_BASE' undeclared (first use in this function)
    > /lib/modules/2.6.25.16-0.1-xen/build/include2/asm/smp_64.h:97: error: 'APIC_ID' undeclared (first use in this function)
    > configure:10027: $? = 1
    > ...
    > configure:10055: result: no


    It seems that in the Xen kernel, some headers have been modified in a
    way that makes them unusable if some other header hasn't been included
    before. Several of the configure checks fail for this reason.

    In this case, asm/apic.h is needed before asm/smp_64.h can be used.
    Try changing the order of these two includes in build/include2/asm/smp.h
    (or add asm/apic.h if asm/smp.h doens't include it at all).


    HTH
    Clemens

  7. Re: compile alsa driver for Xen kernel

    Clemens Ladisch wrote:

    > pconde wrote:
    >> Clemens Ladisch wrote:
    >> > But somehow configure's checks do not work with this kernel. Please
    >> > show the entire config.log.

    >>
    >> [...]
    >> configure:9982: checking for pci_set_consistent_dma_mask
    >> configure:10021: gcc -c ... conftest.c >&5
    >> In file included from
    >> /lib/modules/2.6.25.16-0.1-xen/build/include2/asm/smp.h:4,
    >> from
    >> /lib/modules/2.6.25.16-0.1-xen/source/include/linux/smp.h:19,
    >> from
    >> /lib/modules/2.6.25.16-0.1-xen/source/include/linux/topology.h:33,
    >> from
    >> /lib/modules/2.6.25.16-0.1-xen/source/include/linux/mmzone.h:691,
    >> from
    >> /lib/modules/2.6.25.16-0.1-xen/source/include/linux/gfp.h:4,
    >> from
    >> /lib/modules/2.6.25.16-0.1-xen/source/include/linux/slab.h:14,
    >> from
    >> /lib/modules/2.6.25.16-0.1-xen/source/include/linux/percpu.h:5,
    >> from
    >> /lib/modules/2.6.25.16-0.1-xen/build/include2/asm/local.h:4,
    >> from
    >> /lib/modules/2.6.25.16-0.1-xen/source/include/linux/module.h:19,
    >> from
    >> /lib/modules/2.6.25.16-0.1-xen/source/include/linux/device.h:21,
    >> from
    >> /lib/modules/2.6.25.16-0.1-xen/source/include/linux/pci.h:52,
    >> from conftest.c:31:
    >> /lib/modules/2.6.25.16-0.1-xen/build/include2/asm/smp_64.h: In function
    >> 'logical_smp_processor_id':
    >> /lib/modules/2.6.25.16-0.1-xen/build/include2/asm/smp_64.h:91: warning:
    >> implicit declaration of function 'GET_APIC_LOGICAL_ID'
    >> /lib/modules/2.6.25.16-0.1-xen/build/include2/asm/smp_64.h:91: error:
    >> 'APIC_BASE' undeclared (first use in this function)
    >> /lib/modules/2.6.25.16-0.1-xen/build/include2/asm/smp_64.h:91: error:
    >> (Each undeclared identifier is reported only once
    >> /lib/modules/2.6.25.16-0.1-xen/build/include2/asm/smp_64.h:91: error: for
    >> each function it appears in.)
    >> /lib/modules/2.6.25.16-0.1-xen/build/include2/asm/smp_64.h:91: error:
    >> 'APIC_LDR' undeclared (first use in this function)
    >> /lib/modules/2.6.25.16-0.1-xen/build/include2/asm/smp_64.h: In function
    >> 'hard_smp_processor_id':
    >> /lib/modules/2.6.25.16-0.1-xen/build/include2/asm/smp_64.h:97: warning:
    >> implicit declaration of function 'GET_APIC_ID'
    >> /lib/modules/2.6.25.16-0.1-xen/build/include2/asm/smp_64.h:97: error:
    >> 'APIC_BASE' undeclared (first use in this function)
    >> /lib/modules/2.6.25.16-0.1-xen/build/include2/asm/smp_64.h:97: error:
    >> 'APIC_ID' undeclared (first use in this function) configure:10027: $? = 1
    >> ... configure:10055: result: no

    >
    > It seems that in the Xen kernel, some headers have been modified in a
    > way that makes them unusable if some other header hasn't been included
    > before. Several of the configure checks fail for this reason.
    >
    > In this case, asm/apic.h is needed before asm/smp_64.h can be used.
    > Try changing the order of these two includes in build/include2/asm/smp.h
    > (or add asm/apic.h if asm/smp.h doens't include it at all).
    >
    >
    > HTH
    > Clemens

    Hi Clemens

    Thanks for your advice.

    I added this is smp.h but after configure run the diff between the 2
    config.log doesn't show any difference (only line number was +1)
    I did a grep on APIC_BASE and found it in apicdef.h.

    But there I think that there is a problem the defines are after a "ifndef
    CONFIG_XEN". So they are never taken in account for modules build for XEN
    kernels.

    in smp_64.h the define problem occurs for these two functions

    "static __inline int logical_smp_processor_id(void)
    {
    /* we don't want to mark this access volatile - bad code generation
    */
    return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR));
    }

    static inline int hard_smp_processor_id(void)
    {
    /* we don't want to mark this access volatile - bad code generation
    */
    return GET_APIC_ID(*(u32 *)(APIC_BASE + APIC_ID));
    }"

    Is it possible that the smp_64.h is not the correct xen kernel source file?

    I did a find on smp_64.h in /usr/src/linux and found 2 files
    ../linux-2.6.25.16-0.1/include/asm-x86/mach-xen/asm/smp_64.h
    ../linux-2.6.25.16-0.1/include/asm-x86/smp_64.h

    I copied asm-x86/mach-xen/asm/smp_64.h on asm-x86/smp_64.h.
    Rerun configure. ==> problem with apic_base is away :-)
    and the make is also successful.

    I need still to install the modules and test the sound.

    Thanks for your help, without your remarks I should never found this
    solution

    Regards
    Philippe







  8. Re: compile alsa driver for Xen kernel

    Philippe & Clemens,

    Thank you! Thank you! Thank you!

    I had a similar problem and got HDA working on my Tyan S7010,
    thanks to this discussion thread. Sound-related hardware on the
    board is: ICH10R and an ALC262.

    Below is an excerpt from my admin log (Tyan S7010 aside:
    I had to go to Tyan's website and upgrade the bios to 1.1 beforehand,
    due to the HD audio device being turned off by default & having
    no way to turn it back on in the bios setup... Nutty. The 1.1 bios fixes that).

    -------------

    o Fixing snd-hda-intel

    Alsa HDA works for ICH10R + ALC262 on the linux 2.6.29 kernel,
    but not on 2.6.26. The latest kernel you can easily get a dom0 for
    in Xen is 2.6.26.... which means I need to go the AMD64 2.6.26 route,
    and rebuild Alsa from source for dom0.

    Unfortunately, Alsa does not compile properly in dom0 -- it looks like
    they just imagined people compiling alsa in some domu.

    Found big clue on fixunix.com.
    The problem was:

    /usr/src/linux-headers-2.6.26-2-xen-amd64/include/asm-x86/smp.h
    includes
    /usr/src/linux-headers-2.6.26-2-xen-amd64/include/asm-x86/apic.h
    which says on line 43:
    #ifndef CONFIG_XEN
    .... some stuff needed to compile alsa...
    #endif
    So when you try to build alsa, it barfs.

    To hack around this problem, you can do the following:

    # cd /usr/src/linux-headers-2.6.26-2-xen-amd64/include/asm-x86/

    Notice that:
    smp.h -> ../../../linux-headers-2.6.26-2-common-xen/include/asm-x86/smp.h

    Hack that for a moment:

    # rm smp.h
    # ln -s ../../../linux-headers-2.6.26-2-common-xen/include/asm-x86/mach-xen/asm/smp.h

    Now:
    smp.h -> ../../../linux-headers-2.6.26-2-common-xen/include/asm-x86/mach-xen/asm/smp.h

    Ok, now build ~/incoming/realtek-linux-audiopack-5.11/alsa-driver-1.0.19-5.11/
    install stuff, then because I'm a scaredy-cat, reset the pointer to the header
    file back to where it was:

    # cd /usr/src/linux-headers-2.6.26-2-xen-amd64/include/asm-x86/
    # rm smp.h
    # ln -s ../../../linux-headers-2.6.26-2-common-xen/include/asm-x86/smp.h .

    If you're lazy, just reboot at this point,
    otherwise, rmmod all the snd related modules,
    then modprobe your new snd-intel-hda by hand.

    You may need to run alsaconf.
    You can test it out via speaker-test.

    I did the rmmod stuff by hand, and had sound working but gnome showed the
    speaker as muted (when it actually wasn't). Rebooting fixed this.
    I probably didn't rmmod/insmod/modprobe exactly the right things.
    It may have just been the audio mixer setting ... it's a blur now. Oh well.
    In the future, if this ever happens again, I'd just reboot, as that fixed everything.

    Sounds great!


    -----------------

    Aside:
    Once I upgraded the bios to 1.1, lspci showed the audio device as:
    00:1b.0 Audio device: Intel Corporation 82801JI (ICH10 Family) HD Audio Controller

    Tech support at Tyan was clueless about this initially, but when I got things working
    and called them back to tell them I'd gotten things working, they were extremely
    grateful & nice. The S7010 has turned out to be a really fantastic motherboard
    other than this initial setup issue. Running with dual Xeon E5520 & 12G single ranked
    ecc registered ram... no audio stutters... ever -- even when doing a massive compile.

+ Reply to Thread