Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • L libao
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 35
    • Issues 35
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Xiph.Org
  • libao
  • Issues
  • #1815

Closed
Open
Created Jun 25, 2011 by Maarten ter Huurne@mth

ALSA driver always uses native byte order

In ao_alsa.c, the alsa_get_sample_bitformat() function will return constants like SND_PCM_FORMAT_S16, which specify the native byte order for ALSA. However, in ao_plugin_open() there is a comment "alsa's endinness will be the same as the application's" and there the device byte order is made equal to the client byte order.

One possible solution would be to make alsa_get_sample_bitformat() respect its "bigendian" argument and return SND_PCM_FORMAT_S16_LE or SND_PCM_FORMAT_S16_BE depending on that. This would yield the best performance if the hardware can support both byte orders. I don't know whether libalsa will convert the byte order or return an error if the byte order requested is not available though.

Another possible solution would be to set the device byte order to the native byte order. This might lead to unnecessary byte swapping, but it is a two-line fix (line 528 and 530).

Assignee
Assign to
Time tracking