* Rates/formats available upstream from the plug plugin @ 2010-08-03 13:13 Pavel Hofman 2010-08-03 13:44 ` Jaroslav Kysela 2010-08-03 15:35 ` Raymond Yau 0 siblings, 2 replies; 6+ messages in thread From: Pavel Hofman @ 2010-08-03 13:13 UTC (permalink / raw) To: alsa-devel Hi, mplayer checks hw_params for availability of the current format http://mplayer-ww.git.sourceforge.net/git/gitweb.cgi?p=mplayer-ww/mplayer-ww;a=blob;f=libao2/ao_alsa.c;h=57f0bd07cb5ec300d327682a0b5209ba9dc10e30;hb=09ab9f6346aaf15d20792ca3df761a45fe46d83d#l514 . If the check fails, it uses 16bits as fixed default. Now if we define the card to be plughw:0, the check still fails for formats unsupported directly by the card. Which in fact is incorrect since the plug plugin takes care of most formats known. The same holds for sample rates. IMO either the plug plugin should reconfigure hw_params for upstream use, or mplayer should use a different API call for checking parameters of the actual alsa device (not just the hardware itself, as defined by its alsa driver) - which one? Thanks a lot, Pavel. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Rates/formats available upstream from the plug plugin 2010-08-03 13:13 Rates/formats available upstream from the plug plugin Pavel Hofman @ 2010-08-03 13:44 ` Jaroslav Kysela 2010-08-03 14:17 ` Pavel Hofman 2010-08-03 15:35 ` Raymond Yau 1 sibling, 1 reply; 6+ messages in thread From: Jaroslav Kysela @ 2010-08-03 13:44 UTC (permalink / raw) To: Pavel Hofman; +Cc: alsa-devel On Tue, 3 Aug 2010, Pavel Hofman wrote: > Hi, > > mplayer checks hw_params for availability of the current format > http://mplayer-ww.git.sourceforge.net/git/gitweb.cgi?p=mplayer-ww/mplayer-ww;a=blob;f=libao2/ao_alsa.c;h=57f0bd07cb5ec300d327682a0b5209ba9dc10e30;hb=09ab9f6346aaf15d20792ca3df761a45fe46d83d#l514 > . If the check fails, it uses 16bits as fixed default. > > Now if we define the card to be plughw:0, the check still fails for > formats unsupported directly by the card. Which in fact is incorrect > since the plug plugin takes care of most formats known. The same holds > for sample rates. It works for me: perex@eeebox2:~/alsa/alsa-lib/test> ./pcm Playback device is plughw:0,0 Stream parameters are 44100Hz, S16_LE, 1 channels Sine wave rate is 440.0000Hz Using transfer method: write test format float_le: 0 test format mpeg: -22 Using modified alsa-lib/test/pcm.c code: diff --git a/test/pcm.c b/test/pcm.c index abb83e4..0582891 100644 --- a/test/pcm.c +++ b/test/pcm.c @@ -106,6 +106,8 @@ static int set_hwparams(snd_pcm_t *handle, printf("Broken configuration for playback: no configurations available: %s\n", snd_strerror(err)); return err; } + printf("test format float_le: %i\n", snd_pcm_hw_params_test_format(handle, params, SND_PCM_FORMAT_FLOAT_LE)); + printf("test format mpeg: %i\n", snd_pcm_hw_params_test_format(handle, params, SND_PCM_FORMAT_MPEG)); /* set hardware resampling */ err = snd_pcm_hw_params_set_rate_resample(handle, params, resample); if (err < 0) { Could you describe you hw configuration or can you reproduce this issue with the snd-dummy module? Jaroslav ----- Jaroslav Kysela <perex@perex.cz> Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc. ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: Rates/formats available upstream from the plug plugin 2010-08-03 13:44 ` Jaroslav Kysela @ 2010-08-03 14:17 ` Pavel Hofman 2010-08-03 14:54 ` Jaroslav Kysela 0 siblings, 1 reply; 6+ messages in thread From: Pavel Hofman @ 2010-08-03 14:17 UTC (permalink / raw) To: Jaroslav Kysela; +Cc: alsa-devel Jaroslav Kysela napsal(a): > On Tue, 3 Aug 2010, Pavel Hofman wrote: > >> Hi, >> >> mplayer checks hw_params for availability of the current format >> http://mplayer-ww.git.sourceforge.net/git/gitweb.cgi?p=mplayer-ww/mplayer-ww;a=blob;f=libao2/ao_alsa.c;h=57f0bd07cb5ec300d327682a0b5209ba9dc10e30;hb=09ab9f6346aaf15d20792ca3df761a45fe46d83d#l514 >> >> . If the check fails, it uses 16bits as fixed default. >> >> Now if we define the card to be plughw:0, the check still fails for >> formats unsupported directly by the card. Which in fact is incorrect >> since the plug plugin takes care of most formats known. The same holds >> for sample rates. > > It works for me: > > perex@eeebox2:~/alsa/alsa-lib/test> ./pcm > Playback device is plughw:0,0 > Stream parameters are 44100Hz, S16_LE, 1 channels > Sine wave rate is 440.0000Hz > Using transfer method: write > test format float_le: 0 > test format mpeg: -22 > > Using modified alsa-lib/test/pcm.c code: > > diff --git a/test/pcm.c b/test/pcm.c > index abb83e4..0582891 100644 > --- a/test/pcm.c > +++ b/test/pcm.c > @@ -106,6 +106,8 @@ static int set_hwparams(snd_pcm_t *handle, > printf("Broken configuration for playback: no configurations > available: %s\n", snd_strerror(err)); > return err; > } > + printf("test format float_le: %i\n", > snd_pcm_hw_params_test_format(handle, params, SND_PCM_FORMAT_FLOAT_LE)); > + printf("test format mpeg: %i\n", > snd_pcm_hw_params_test_format(handle, params, SND_PCM_FORMAT_MPEG)); > /* set hardware resampling */ > err = snd_pcm_hw_params_set_rate_resample(handle, params, resample); > if (err < 0) { > > > Could you describe you hw configuration or can you reproduce this issue > with the snd-dummy module? > Thanks for your reply. How do you compile the test directory? Neither gitcompile nor make in the test dir did the trick. Thanks, Pavel. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Rates/formats available upstream from the plug plugin 2010-08-03 14:17 ` Pavel Hofman @ 2010-08-03 14:54 ` Jaroslav Kysela 2010-08-03 15:40 ` Pavel Hofman 0 siblings, 1 reply; 6+ messages in thread From: Jaroslav Kysela @ 2010-08-03 14:54 UTC (permalink / raw) To: Pavel Hofman; +Cc: alsa-devel On Tue, 3 Aug 2010, Pavel Hofman wrote: > Jaroslav Kysela napsal(a): >> On Tue, 3 Aug 2010, Pavel Hofman wrote: >> >>> Hi, >>> >>> mplayer checks hw_params for availability of the current format >>> http://mplayer-ww.git.sourceforge.net/git/gitweb.cgi?p=mplayer-ww/mplayer-ww;a=blob;f=libao2/ao_alsa.c;h=57f0bd07cb5ec300d327682a0b5209ba9dc10e30;hb=09ab9f6346aaf15d20792ca3df761a45fe46d83d#l514 >>> >>> . If the check fails, it uses 16bits as fixed default. >>> >>> Now if we define the card to be plughw:0, the check still fails for >>> formats unsupported directly by the card. Which in fact is incorrect >>> since the plug plugin takes care of most formats known. The same holds >>> for sample rates. >> >> It works for me: >> >> perex@eeebox2:~/alsa/alsa-lib/test> ./pcm >> Playback device is plughw:0,0 >> Stream parameters are 44100Hz, S16_LE, 1 channels >> Sine wave rate is 440.0000Hz >> Using transfer method: write >> test format float_le: 0 >> test format mpeg: -22 >> >> Using modified alsa-lib/test/pcm.c code: >> >> diff --git a/test/pcm.c b/test/pcm.c >> index abb83e4..0582891 100644 >> --- a/test/pcm.c >> +++ b/test/pcm.c >> @@ -106,6 +106,8 @@ static int set_hwparams(snd_pcm_t *handle, >> printf("Broken configuration for playback: no configurations >> available: %s\n", snd_strerror(err)); >> return err; >> } >> + printf("test format float_le: %i\n", >> snd_pcm_hw_params_test_format(handle, params, SND_PCM_FORMAT_FLOAT_LE)); >> + printf("test format mpeg: %i\n", >> snd_pcm_hw_params_test_format(handle, params, SND_PCM_FORMAT_MPEG)); >> /* set hardware resampling */ >> err = snd_pcm_hw_params_set_rate_resample(handle, params, resample); >> if (err < 0) { >> >> >> Could you describe you hw configuration or can you reproduce this issue >> with the snd-dummy module? >> > > Thanks for your reply. How do you compile the test directory? Neither > gitcompile nor make in the test dir did the trick. Thanks, cd alsa-lib/test make pcm Jaroslav ----- Jaroslav Kysela <perex@perex.cz> Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Rates/formats available upstream from the plug plugin 2010-08-03 14:54 ` Jaroslav Kysela @ 2010-08-03 15:40 ` Pavel Hofman 0 siblings, 0 replies; 6+ messages in thread From: Pavel Hofman @ 2010-08-03 15:40 UTC (permalink / raw) To: Jaroslav Kysela; +Cc: alsa-devel Jaroslav Kysela napsal(a): > On Tue, 3 Aug 2010, Pavel Hofman wrote: > >> Jaroslav Kysela napsal(a): >>> On Tue, 3 Aug 2010, Pavel Hofman wrote: >>> >>>> Hi, >>>> >>>> mplayer checks hw_params for availability of the current format >>>> http://mplayer-ww.git.sourceforge.net/git/gitweb.cgi?p=mplayer-ww/mplayer-ww;a=blob;f=libao2/ao_alsa.c;h=57f0bd07cb5ec300d327682a0b5209ba9dc10e30;hb=09ab9f6346aaf15d20792ca3df761a45fe46d83d#l514 >>>> >>>> >>>> . If the check fails, it uses 16bits as fixed default. >>>> >>>> Now if we define the card to be plughw:0, the check still fails for >>>> formats unsupported directly by the card. Which in fact is incorrect >>>> since the plug plugin takes care of most formats known. The same holds >>>> for sample rates. >>> >>> It works for me: >>> >>> perex@eeebox2:~/alsa/alsa-lib/test> ./pcm >>> Playback device is plughw:0,0 >>> Stream parameters are 44100Hz, S16_LE, 1 channels >>> Sine wave rate is 440.0000Hz >>> Using transfer method: write >>> test format float_le: 0 >>> test format mpeg: -22 >>> >>> Using modified alsa-lib/test/pcm.c code: >>> >>> diff --git a/test/pcm.c b/test/pcm.c >>> index abb83e4..0582891 100644 >>> --- a/test/pcm.c >>> +++ b/test/pcm.c >>> @@ -106,6 +106,8 @@ static int set_hwparams(snd_pcm_t *handle, >>> printf("Broken configuration for playback: no configurations >>> available: %s\n", snd_strerror(err)); >>> return err; >>> } >>> + printf("test format float_le: %i\n", >>> snd_pcm_hw_params_test_format(handle, params, SND_PCM_FORMAT_FLOAT_LE)); >>> + printf("test format mpeg: %i\n", >>> snd_pcm_hw_params_test_format(handle, params, SND_PCM_FORMAT_MPEG)); >>> /* set hardware resampling */ >>> err = snd_pcm_hw_params_set_rate_resample(handle, params, >>> resample); >>> if (err < 0) { >>> >>> >>> Could you describe you hw configuration or can you reproduce this issue >>> with the snd-dummy module? >>> >> >> Thanks for your reply. How do you compile the test directory? Neither >> gitcompile nor make in the test dir did the trick. Thanks, > > cd alsa-lib/test > make pcm > Thanks a lot. You are right, it works OK now. The problem was older mplayer (its internal s24le code was translated to mpeg code of alsa :) ) , it is fixed in later versions. Thanks for help. Pavel. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Rates/formats available upstream from the plug plugin 2010-08-03 13:13 Rates/formats available upstream from the plug plugin Pavel Hofman 2010-08-03 13:44 ` Jaroslav Kysela @ 2010-08-03 15:35 ` Raymond Yau 1 sibling, 0 replies; 6+ messages in thread From: Raymond Yau @ 2010-08-03 15:35 UTC (permalink / raw) To: ALSA Development Mailing List 2010/8/3 Pavel Hofman <pavel.hofman@ivitera.com> > Hi, > > mplayer checks hw_params for availability of the current format > > http://mplayer-ww.git.sourceforge.net/git/gitweb.cgi?p=mplayer-ww/mplayer-ww;a=blob;f=libao2/ao_alsa.c;h=57f0bd07cb5ec300d327682a0b5209ba9dc10e30;hb=09ab9f6346aaf15d20792ca3df761a45fe46d83d#l514 > . If the check fails, it uses 16bits as fixed default. > > Now if we define the card to be plughw:0, the check still fails for > formats unsupported directly by the card. Which in fact is incorrect > since the plug plugin takes care of most formats known. The same holds > for sample rates. > > IMO either the plug plugin should reconfigure hw_params for upstream > use, or mplayer should use a different API call for checking parameters > of the actual alsa device (not just the hardware itself, as defined by > its alsa driver) - which one? > > Thanks a lot, > > Pavel. > AFAIK , "plug" plugin does not support AC3 encode/decode , and alsa spdif device support AC3 passthrough ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-08-03 15:40 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-08-03 13:13 Rates/formats available upstream from the plug plugin Pavel Hofman 2010-08-03 13:44 ` Jaroslav Kysela 2010-08-03 14:17 ` Pavel Hofman 2010-08-03 14:54 ` Jaroslav Kysela 2010-08-03 15:40 ` Pavel Hofman 2010-08-03 15:35 ` Raymond Yau
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.