[PATCH] hw/audio/gus: Use AUDIO_HOST_ENDIANNESS definition from 'audio/audio.h'

Philippe Mathieu-Daudé posted 1 patch 5 years, 6 months ago
Test docker-mingw@fedora failed
Test checkpatch failed
Test asan failed
Test docker-quick@centos7 failed
Test FreeBSD failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200505100750.27332-1-f4bug@amsat.org
hw/audio/gus.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
[PATCH] hw/audio/gus: Use AUDIO_HOST_ENDIANNESS definition from 'audio/audio.h'
Posted by Philippe Mathieu-Daudé 5 years, 6 months ago
Use the generic AUDIO_HOST_ENDIANNESS definition instead
of a custom one.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
Who/what machine is using this device anyway?
---
 hw/audio/gus.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/hw/audio/gus.c b/hw/audio/gus.c
index eb4a803fb5..c8df2bde6b 100644
--- a/hw/audio/gus.c
+++ b/hw/audio/gus.c
@@ -41,12 +41,6 @@
 #define ldebug(...)
 #endif
 
-#ifdef HOST_WORDS_BIGENDIAN
-#define GUS_ENDIANNESS 1
-#else
-#define GUS_ENDIANNESS 0
-#endif
-
 #define TYPE_GUS "gus"
 #define GUS(obj) OBJECT_CHECK (GUSState, (obj), TYPE_GUS)
 
@@ -256,7 +250,7 @@ static void gus_realizefn (DeviceState *dev, Error **errp)
     as.freq = s->freq;
     as.nchannels = 2;
     as.fmt = AUDIO_FORMAT_S16;
-    as.endianness = GUS_ENDIANNESS;
+    as.endianness = AUDIO_HOST_ENDIANNESS;
 
     s->voice = AUD_open_out (
         &s->card,
-- 
2.21.3


Re: [PATCH] hw/audio/gus: Use AUDIO_HOST_ENDIANNESS definition from 'audio/audio.h'
Posted by Paolo Bonzini 5 years, 6 months ago
On 05/05/20 12:07, Philippe Mathieu-Daudé wrote:
> Use the generic AUDIO_HOST_ENDIANNESS definition instead
> of a custom one.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> Who/what machine is using this device anyway?

PC, like all old ISA audio cards.

Paolo


Re: [PATCH] hw/audio/gus: Use AUDIO_HOST_ENDIANNESS definition from 'audio/audio.h'
Posted by Philippe Mathieu-Daudé 5 years, 6 months ago
On 5/5/20 12:10 PM, Paolo Bonzini wrote:
> On 05/05/20 12:07, Philippe Mathieu-Daudé wrote:
>> Use the generic AUDIO_HOST_ENDIANNESS definition instead
>> of a custom one.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>> Who/what machine is using this device anyway?
> 
> PC, like all old ISA audio cards.

I imagined, but any particular project in mind? I'm wondering if we 
should add a test for it, and what kind of testing.

Re: [PATCH] hw/audio/gus: Use AUDIO_HOST_ENDIANNESS definition from 'audio/audio.h'
Posted by Paolo Bonzini 5 years, 6 months ago
On 05/05/20 12:45, Philippe Mathieu-Daudé wrote:
> On 5/5/20 12:10 PM, Paolo Bonzini wrote:
>> On 05/05/20 12:07, Philippe Mathieu-Daudé wrote:
>>> Use the generic AUDIO_HOST_ENDIANNESS definition instead
>>> of a custom one.
>>>
>>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>>> ---
>>> Who/what machine is using this device anyway?
>>
>> PC, like all old ISA audio cards.
> 
> I imagined, but any particular project in mind? I'm wondering if we
> should add a test for it, and what kind of testing.

Old games and demos use it.  Most demos don't work that well on QEMU though.

Paolo

Re: [PATCH] hw/audio/gus: Use AUDIO_HOST_ENDIANNESS definition from 'audio/audio.h'
Posted by Philippe Mathieu-Daudé 5 years, 6 months ago
On 5/5/20 12:49 PM, Paolo Bonzini wrote:
> On 05/05/20 12:45, Philippe Mathieu-Daudé wrote:
>> On 5/5/20 12:10 PM, Paolo Bonzini wrote:
>>> On 05/05/20 12:07, Philippe Mathieu-Daudé wrote:
>>>> Use the generic AUDIO_HOST_ENDIANNESS definition instead
>>>> of a custom one.
>>>>
>>>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>>>> ---
>>>> Who/what machine is using this device anyway?
>>>
>>> PC, like all old ISA audio cards.
>>
>> I imagined, but any particular project in mind? I'm wondering if we
>> should add a test for it, and what kind of testing.
> 
> Old games and demos use it.  Most demos don't work that well on QEMU though.

Good. Cc'ing Max in case he knows a such demo we can use for testing.

Thanks!

> 
> Paolo
> 

Re: [PATCH] hw/audio/gus: Use AUDIO_HOST_ENDIANNESS definition from 'audio/audio.h'
Posted by Max Reitz 5 years, 6 months ago
On 05.05.20 12:55, Philippe Mathieu-Daudé wrote:
> On 5/5/20 12:49 PM, Paolo Bonzini wrote:
>> On 05/05/20 12:45, Philippe Mathieu-Daudé wrote:
>>> On 5/5/20 12:10 PM, Paolo Bonzini wrote:
>>>> On 05/05/20 12:07, Philippe Mathieu-Daudé wrote:
>>>>> Use the generic AUDIO_HOST_ENDIANNESS definition instead
>>>>> of a custom one.
>>>>>
>>>>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>>>>> ---
>>>>> Who/what machine is using this device anyway?
>>>>
>>>> PC, like all old ISA audio cards.
>>>
>>> I imagined, but any particular project in mind? I'm wondering if we
>>> should add a test for it, and what kind of testing.
>>
>> Old games and demos use it.  Most demos don't work that well on QEMU
>> though.
> 
> Good. Cc'ing Max in case he knows a such demo we can use for testing.

I don’t know how that impression could have manifested, but I’m actually
not really an expert on old demos or games.  (I just happened to write
some 512 byte stuff at some point, but the only sound I ever used there
was over the PC speaker...)

Max


Re: [PATCH] hw/audio/gus: Use AUDIO_HOST_ENDIANNESS definition from 'audio/audio.h'
Posted by Philippe Mathieu-Daudé 5 years, 5 months ago
ping...

On 5/5/20 12:07 PM, Philippe Mathieu-Daudé wrote:
> Use the generic AUDIO_HOST_ENDIANNESS definition instead
> of a custom one.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> Who/what machine is using this device anyway?
> ---
>  hw/audio/gus.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/hw/audio/gus.c b/hw/audio/gus.c
> index eb4a803fb5..c8df2bde6b 100644
> --- a/hw/audio/gus.c
> +++ b/hw/audio/gus.c
> @@ -41,12 +41,6 @@
>  #define ldebug(...)
>  #endif
>  
> -#ifdef HOST_WORDS_BIGENDIAN
> -#define GUS_ENDIANNESS 1
> -#else
> -#define GUS_ENDIANNESS 0
> -#endif
> -
>  #define TYPE_GUS "gus"
>  #define GUS(obj) OBJECT_CHECK (GUSState, (obj), TYPE_GUS)
>  
> @@ -256,7 +250,7 @@ static void gus_realizefn (DeviceState *dev, Error **errp)
>      as.freq = s->freq;
>      as.nchannels = 2;
>      as.fmt = AUDIO_FORMAT_S16;
> -    as.endianness = GUS_ENDIANNESS;
> +    as.endianness = AUDIO_HOST_ENDIANNESS;
>  
>      s->voice = AUD_open_out (
>          &s->card,
>