Topic: Hammerfall DSP at 96kHz and alsa mmap doesn't keep going

Hi,

I've looked through the forum posts and can't see anything quite like my problem.

On a SUSE 10 64 bit system with alsa v1.0.15 machine, it used to work. I'm using alsa in memory mapped mode using the snd_pcm_mmap* calls. This system ran fine, once the alsamixer was used to setup the MADI in 96kHz correctly.
The machine died.

Now on a new SUSE 11 64 bit machine, same soundcard, with alsa v1.0.18 it hangs. I get a short peep from the speaker but then there are no more async callbacks to the pcm handler and it just stops. Using default channels 31 & 32 for output (in 96kHz mode).
If I use aplay to play a 96kHz wav file, it skips and jerks and misses much of the file. Perhaps this is the same problem showing up in a different way ?

I have also tried the latest alsa v1.0.27, and the old alsa version v1.0.15 and it behaves exactly the same !
I cannot compile/run hdspmixer since SUSE 11 appears to have no fltk-config package sad

What can I try next ?

Re: Hammerfall DSP at 96kHz and alsa mmap doesn't keep going

This post of mine to the alsa forum is relevant to the above question.
It seems the RME linux driver has changed since alsa 1.0.15, and the changes have caused my code to stop working.
Any hints ?

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

See original thread below first.
What I've since discovered is that the code works fine using the module(driver) from alsa 1.0.15 and the RME card, but fails using the module from alsa 1.0.18+. Besides the module, any version of alsa can be used for the alsa library and utils and it works still.
I have not tried the same tests with the Asus STX Xonar card yet.

So, either some problem has crept into alsa after 1.0.15 that causes this issue, or something on the API has changed so that my usage is no longer correct. Any hints ?  What changes to the mmap API ?

Note the controls for the RME card change in alsamixer with the change in alsa module. Some of the clocking options have been re-arranged, and name of the card has also changed (for the same hardware).

Usage parameters mentioned below. I am registering and using an async callback. I can provide source code if that helps.

If required, how would I go about using an old 1.0.15 module in a later alsa system ? I tried ./configure in the alsa-driver-1.0.15 directory and that fails; things seem to have changed so much since with kernel source etc. The tests above (working) with the 1.0.15 module were done with an older kernel too.

PS: Compiling with 1.0.27 alsa I get a warning about deprecated call "snd_pcm_sw_params_set_xfer_align". What should now be done instead ?

Hope someone can help !
Bruce
> Subject: Problem with async callbacks stopping

> Hi,

> I've combed the web for a possible solution to my problem and I can't seem
> to find anything germane, so here goes !
> I'm hoping someone can lead me in the right direction, as this has become
> very frustrating.

> Some History:

> A few years ago I wrote a dedicated app specific record/playback application
> on alsa 1.0.15, running on a Sun 64bit machine running Suse 10.
> The soundcard was a professional 32 channel RME DSP Hammerfall.
> It used an async receive callback and memory mapping (mmap). Eventually I
> got it all working smoothly. It performs both playback (on 2 channels
> 31/32 or 63/64, depending on whether sample rate was 96k or 48k) and
> sampling on up to 32 channels simultaneously. I have a comment in the code
> that I had troubles getting both receive and transmit callbacks working at
> the same time, so I simply ended up calling the transmit routine from the
> receive callback (the rate was the same) and that worked fine.

> Recently I have had need to re-visit this project. The Sun machine has died,
> but the RME soundcard lives on.
> It was installed on a new HP 64bit machine, now running Suse 11 which has
> alsa 1.0.18.

> Running my original program (recompiled with the new alsa libs), I can get
> about 1s of audio out. The program then hangs. On closer investigation, it
> seems the async receive callback runs for a while, then simply stops.
> I can get sounds out using aplay, but they are skipping and distorted.
> Pulse audio has been disabled by simply removing the alsa-pulse.conf file in
> /etc.
> I downloaded and installed the lastest alsa 1.0.27, but the symptoms were
> the same. In desperation I also tried the original alsa 1.0.15, but that
> didn't help either.
> All other soundcards are disabled. There is on-board sound (both Intel, and
> on the Nvidea video card for HDMI) so I can't physically remove them.

> Thinking there may be some problem with the old soundcard hardware, a modern
> Asus Xonar STX was fitted. I have modified my application to use only 2
> channels, and interleaved samples (the STX hardware doesn't support
> non-interleaved at the low level, and I'm trying to avoid using plughw to be
> sure I'm getting exactly what I want). The card appears as card 2 for some
> reason. That's OK, just use hw:2,0 instead.
> Encouragingly, aplay seems to behave OK, playing 48k wav files through plug.
> Unfortunately, after all this effort, the callbacks seem to die in pretty
> much the same way as they did with the RME card. I can see I get up to about
> 49000 samples (or roughly 1s at 48k sample rate). Then no more callbacks.
> No xrun errors are reported in the callbacks that do happen.

> The application architecture is quite similar in structure to the alsa
> example code pcm.c.

> I can give you /proc or other outputs as required, but as I'm actually
> communicating with the soundcard I'm not sure that's much help.
> I tweaked the hardware parameters passed in hwparams as required so as not
> to get an error back from the card driver that something wasn't supported.
> Currently using on the STX: SND_PCM_ACCESS_MMAP_INTERLEAVED, 48k, 2
> channels, SND_PCM_FORMAT_S32_LE.

> On the RME I was using: SND_PCM_ACCESS_MMAP_NONINTERLEAVED, 48k/96k,
> 64/32 channels, SND_PCM_FORMAT_S32_LE

> It could be the code, but it used to work on the Sun.....
> It coud be the soundcard, but the RME worked on the Sun and neither the RME
> or the STX work on the HP....
> It could be the HP,  but how ?

> I'm not sure what to do now ?

> A basic polled method doesn't lend itself well to handling 32 channels, and
> would result in double buffer handling.

3 (edited by abruceperson 2013-10-08 05:10:22)

Re: Hammerfall DSP at 96kHz and alsa mmap doesn't keep going

Further findings:
1/ Even if I poll instead of relying on the callback mechanism, the output stops after about 1s with alsa 1.0.18. It is something at the driver or hardware level, not the alsa callback mechanism itself failing.
2/ aplay and arecord both do not work properly with the 1.0.18 or 1.0.27 alsa drivers, but work fine with 1.0.15. I don't believe it is my application at fault here.

I posted the following to the alsa developers forum:

I cannot get our card to work with alsa 1.0.27 (or 1.0.18), but it does work fine with 1.0.15. I'm trying to work out what could be different from my setup to yours [a user reported he had it working with 1.0.27]. I have tried different PCs, different Linux distributions and two different HDSP cards.
I'm using a HDSPe MADI Rev1.1 loaded with the latest firmware. Is yours the same ?

May I send you a particular application to attempt running on your system with 1.0.27 and see if it works ?

Note I can use all parts of 1.0.27 (eg, lib, alsamixer, aplay) except for the Hammerfall driver (remains at 1.0.15) and it still works for me. I cannot install the new driver under an older kernel due to incompatibilities, but trying 1.0.18 or 1.0.27 (including later driver) with a newer kernel fails.

I thought if I could somehow get the 1.0.15 hammerfall driver working with a new kernel (help ??) I could then somehow step through the subsequent changes made to the driver one by one till it breaks. This approach could take some considerable time, so any pointers as to how to do this would be much appreciated !  I do not profess to know much about alsa driver development, or how to even access the (svn ?) revision steps, but this might be the only way to work out what is happening here.

Re: Hammerfall DSP at 96kHz and alsa mmap doesn't keep going

Hi,
i think at first your SUSE11 is out of Date, OpenSuse is at Version 12.3 and the Version 13.1 will be released in 29 Days. Before you do anything else i suggest you make sure the Card sits proper in the Slot and then you install the actual OpenSuse 12.3.
http://software.opensuse.org/123/en

greets
rmm

Re: Hammerfall DSP at 96kHz and alsa mmap doesn't keep going

Hi Rmm,

Have tried exactly what you suggested with the following results:
Installed OpenSuse12.3 (with alsa 1.0.26).
Ran aplay -D plughw:0,card
1) On internal intel sound card: works fine
2) On a Xonar sound card: works fine
3) On RME Hammerfall: skips with long silences

Seems there is nothing wrong with my actual application; Florian Faber has tested it on his machine and it works fine on the Hammerfall with latest alsa.
Hammerfall hardware definitely OK because with Suse 10 disk (with alsa 1.0.15) plugged into the same machine aplay works fine on the Hammerfall.

So, I'm still baffled as to where the problem lies. The above seems to imply some sort of strange interaction between the later (after 1.0.15) Hammerfall driver and the HP machine hardware ?

1) It's not the Hammerfall hardware or it's slot (Suse 10 works)
2) I'm assured it's not the alsa hammerfall driver
3) It's not the flavour of Linux running (works fine on other sound cards, newer version no change)
4) It's not the alsa version (works fine on other sound cards)
What is left ??

Re: Hammerfall DSP at 96kHz and alsa mmap doesn't keep going

Do you use Jack with alsa-backend or plain alsa?
I remember i couln't use my old Digi9652 with alsa, only with jack.

Re: Hammerfall DSP at 96kHz and alsa mmap doesn't keep going

It's a plain alsa app that I want to run; with callbacks and high quality/quantity sampling.
No idea if that can work through Jack and whether I'd want to do that.
Never had Jack on Suse 10, where the RME works fine.

Can anyone shine some light on this topic ?

Re: Hammerfall DSP at 96kHz and alsa mmap doesn't keep going

You may have to update the Firmware of the HDSP Card.
Do you know this guide? Check it out.
http://www.esaracco.fr/documentation/li … dware.html

Re: Hammerfall DSP at 96kHz and alsa mmap doesn't keep going

I must add that you should of course upgrade the HDSP 9632 to the newest Firmware Version 154.
https://archiv.rme-audio.de/download/fut_wdm_dsp.zip