All of lore.kernel.org
 help / color / mirror / Atom feed
* ALSA
@ 2000-04-12 20:46 Dave Mielke
  2000-06-06 12:17 ` ALSA Mr I.E. Esten
  2000-06-06 14:43 ` ALSA flatmax
  0 siblings, 2 replies; 5+ messages in thread
From: Dave Mielke @ 2000-04-12 20:46 UTC (permalink / raw)
  To: linux-sound

The INSTALL file for the ALSA driver describes a special control file named
"/proc/asound/0/pcmD0o". It says that a line like the following can be written
to this file:

    Playback <app_name> <fragments> <fragment_size> [<options>]

The description of the <app_name> parameter says:

    <app_name> - name of application with (higher priority) or without path

Does anyone know what the phrase "higher priority" here actually means? Also,
what is the syntax for assigning a priority to an application?

-- 
Dave Mielke           | 856 Grenon Avenue | I believe that the Bible is the
Phone: 1-613-726-0014 | Ottawa, Ontario   | Word of God. Please contact me
EMail: dave@mielke.cc | Canada  K2B 6G3   | if you're concerned about Hell.

^ permalink raw reply	[flat|nested] 5+ messages in thread
* ALSA
@ 2011-09-09  6:52 Latha Prabhu
  0 siblings, 0 replies; 5+ messages in thread
From: Latha Prabhu @ 2011-09-09  6:52 UTC (permalink / raw)
  To: alsa-devel, lvprabhu

I wrote a sample program as follows to OPEN ALSA sound device and set its hw
params -

Code:

    /* Open PCM device for playback. */
    rc = snd_pcm_open(&handle, "default",
                    SND_PCM_STREAM_PLAYBACK, 0);
    if (rc < 0) {
      fprintf(stderr,
            "unable to open pcm device: %s\n",
            snd_strerror(rc));
      return 1;
    }

    /* Allocate a hardware parameters object. */
    snd_pcm_hw_params_alloca(&params);

    /* Fill it in with default values. */
    snd_pcm_hw_params_any(handle, params);

    /* Set the desired hardware parameters. */

    /* Interleaved mode */
    snd_pcm_hw_params_set_access(handle, params,
SND_PCM_ACCESS_RW_INTERLEAVED);

    /* Signed 16-bit little-endian format */
    snd_pcm_hw_params_set_format(handle, params, SND_PCM_FORMAT_S16_LE);

    /* One channel (mono) */
    snd_pcm_hw_params_set_channels(handle, params, 1);

    /* 8000 bits/second sampling rate  */
    val = 8000;
    snd_pcm_hw_params_set_rate_near(handle, params,
                                  &val, &dir);

    /* Set period size to 32 frames. */
    frames = 32;
    snd_pcm_hw_params_set_period_size_near(handle,
                              params, &frames, &dir);
    fflush(stderr);

    /* Write the parameters to the driver */
    rc = snd_pcm_hw_params(handle, params);

Above lines of code works fine if I run it as an independent test program.
When I use the same lines of code in my application, it is failing in
snd_pcm_hw_params_any(). It returns "Operation not permitted". So I changed
the device name to "plughw:0,0", instead of "default".
With this change, its failing at snd_pcm_hw_params_set_rate_near(). It
returns some huge value 192000. Also, following
snd_pcm_hw_params_set_period_size() also fails with 699050.

Any idea, why I'm getting this error? Is link to some other library or some
header file inclusion, in my application causing this error? I am trying to
play 8k, 16 bit PCM audio.

Then I changed snd_pcm_hw_set_rate_near() to snd_pcm_hw_set_rate() and also
snd_pcm_hw_params_set_period_size_near() to
snd_pcm_hw_params_set_period_size(). These 2 calls succeed. But when I check
period_size after calling snd_pcm_hw_params(), it is different. My set value
was 32 but I got it as 1. Then call to snd_pcm_writei() crashes with -
 pcm.c:1240: snd_pcm_writei: Assertion `pcm' failed.

Please note my application is  multi threaded but opening the device and
setting hardware parameters are under one place.

I appreciate your help on this.

Thanks,
Latha

^ permalink raw reply	[flat|nested] 5+ messages in thread
* alsa
@ 2019-09-13 14:05 Nuno Sá
  0 siblings, 0 replies; 5+ messages in thread
From: Nuno Sá @ 2019-09-13 14:05 UTC (permalink / raw)
  To: kernelnewbies

Hi all,

Im currently doing a driver for the alsa subsystem. This is my first
interaction with it, so sorry if this is to trivial. Since this is my
first time on the subsystem I'm first posting my question here before
going to the alsa mailing list.

So, I'm doing a codec driver for this device 
https://www.analog.com/media/en/technical-documentation/data-sheets/ADAU7118.pdf
. The device is a converter from PDM to I2S/TDM and it has 4 PDM inputs
which can be enabled/disabled via I2C. My question is, how can I add
controls to enable/disable the inputs? I'm trying to use
`SND_SOC_DAPM_SWITCH()` together with a `SOC_DAPM_SINGLE()` control.
The thing is, when I use alsamixer this controls only come up on the
playback tab which makes me feel that something is not ok (the device
only supports Capture stream). Is this correct way to add controls for
input's?

Any inputs would be helpful...


Thanks in advance,
Nuno Sá


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-09-13 14:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-04-12 20:46 ALSA Dave Mielke
2000-06-06 12:17 ` ALSA Mr I.E. Esten
2000-06-06 14:43 ` ALSA flatmax
  -- strict thread matches above, loose matches on Subject: below --
2011-09-09  6:52 ALSA Latha Prabhu
2019-09-13 14:05 alsa Nuno Sá

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.